Skip to content

Commit 8d44827

Browse files
committed
Merge tag 'gpio-fixes-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO fixes from Linus Walleij: "Two GPIO fixes for the v3.9 series: - Fix erroneous return value in the ICH driver - Make the STMPE driver proper properly on device tree boots" * tag 'gpio-fixes-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpio: stmpe: pass DT node to irqdomain gpio-ich: Fix value returned by ichx_gpio_request
2 parents 66ade47 + 9afd9b7 commit 8d44827

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

drivers/gpio/gpio-ich.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static int ichx_gpio_request(struct gpio_chip *chip, unsigned nr)
214214
* If it can't be trusted, assume that the pin can be used as a GPIO.
215215
*/
216216
if (ichx_priv.desc->use_sel_ignore[nr / 32] & (1 << (nr & 0x1f)))
217-
return 1;
217+
return 0;
218218

219219
return ichx_read_bit(GPIO_USE_SEL, nr) ? 0 : -ENODEV;
220220
}

drivers/gpio/gpio-stmpe.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,15 @@ static const struct irq_domain_ops stmpe_gpio_irq_simple_ops = {
307307
.xlate = irq_domain_xlate_twocell,
308308
};
309309

310-
static int stmpe_gpio_irq_init(struct stmpe_gpio *stmpe_gpio)
310+
static int stmpe_gpio_irq_init(struct stmpe_gpio *stmpe_gpio,
311+
struct device_node *np)
311312
{
312-
int base = stmpe_gpio->irq_base;
313+
int base = 0;
313314

314-
stmpe_gpio->domain = irq_domain_add_simple(NULL,
315+
if (!np)
316+
base = stmpe_gpio->irq_base;
317+
318+
stmpe_gpio->domain = irq_domain_add_simple(np,
315319
stmpe_gpio->chip.ngpio, base,
316320
&stmpe_gpio_irq_simple_ops, stmpe_gpio);
317321
if (!stmpe_gpio->domain) {
@@ -346,6 +350,9 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
346350
stmpe_gpio->chip = template_chip;
347351
stmpe_gpio->chip.ngpio = stmpe->num_gpios;
348352
stmpe_gpio->chip.dev = &pdev->dev;
353+
#ifdef CONFIG_OF
354+
stmpe_gpio->chip.of_node = np;
355+
#endif
349356
stmpe_gpio->chip.base = pdata ? pdata->gpio_base : -1;
350357

351358
if (pdata)
@@ -366,7 +373,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
366373
goto out_free;
367374

368375
if (irq >= 0) {
369-
ret = stmpe_gpio_irq_init(stmpe_gpio);
376+
ret = stmpe_gpio_irq_init(stmpe_gpio, np);
370377
if (ret)
371378
goto out_disable;
372379

0 commit comments

Comments
 (0)