Skip to content

Commit a794331

Browse files
andy-shevBartosz Golaszewski
authored andcommitted
gpio: stmpe: Fix IRQ related error messages
First of all, remove duplicate message that platform_get_irq() does already print. Second, correct the error message when unable to register a handler, which is broken in two ways: 1) the misleading 'get' vs. 'register'; 2) missing '\n' at the end. (Yes, for the curious ones, the dev_*() cases do not require '\n' and issue it automatically, but it's better to have them explicit) Fix all this here. Fixes: 1882e76 ("gpio: stmpe: Simplify with dev_err_probe()") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240902133148.2569486-2-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent e1df5d0 commit a794331

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

drivers/gpio/gpio-stmpe.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ static void stmpe_gpio_disable(void *stmpe)
464464

465465
static int stmpe_gpio_probe(struct platform_device *pdev)
466466
{
467+
struct device *dev = &pdev->dev;
467468
struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent);
468469
struct device_node *np = pdev->dev.of_node;
469470
struct stmpe_gpio *stmpe_gpio;
@@ -493,12 +494,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
493494
of_property_read_u32(np, "st,norequest-mask",
494495
&stmpe_gpio->norequest_mask);
495496

496-
irq = platform_get_irq(pdev, 0);
497-
if (irq < 0)
498-
dev_info(&pdev->dev,
499-
"device configured in no-irq mode: "
500-
"irqs are not available\n");
501-
502497
ret = stmpe_enable(stmpe, STMPE_BLOCK_GPIO);
503498
if (ret)
504499
return ret;
@@ -507,15 +502,15 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
507502
if (ret)
508503
return ret;
509504

505+
irq = platform_get_irq(pdev, 0);
510506
if (irq > 0) {
511507
struct gpio_irq_chip *girq;
512508

513509
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
514510
stmpe_gpio_irq, IRQF_ONESHOT,
515511
"stmpe-gpio", stmpe_gpio);
516512
if (ret)
517-
return dev_err_probe(&pdev->dev, ret,
518-
"unable to get irq");
513+
return dev_err_probe(dev, ret, "unable to register IRQ handler\n");
519514

520515
girq = &stmpe_gpio->chip.irq;
521516
gpio_irq_chip_set_chip(girq, &stmpe_gpio_irq_chip);

0 commit comments

Comments
 (0)