From 0bec8b7e5ca1a629f26173691526432f9d7cf8c1 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 14 Aug 2019 10:46:38 -0700 Subject: Input: remove dev_err() usage after platform_get_irq() We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // While we're here, remove braces on if statements that only have one statement (manually). Signed-off-by: Stephen Boyd Signed-off-by: Dmitry Torokhov --- drivers/input/misc/stpmic1_onkey.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'drivers/input/misc/stpmic1_onkey.c') diff --git a/drivers/input/misc/stpmic1_onkey.c b/drivers/input/misc/stpmic1_onkey.c index 7b49c9997df7..d8dc2f2f8000 100644 --- a/drivers/input/misc/stpmic1_onkey.c +++ b/drivers/input/misc/stpmic1_onkey.c @@ -61,18 +61,12 @@ static int stpmic1_onkey_probe(struct platform_device *pdev) return -ENOMEM; onkey->irq_falling = platform_get_irq_byname(pdev, "onkey-falling"); - if (onkey->irq_falling < 0) { - dev_err(dev, "failed: request IRQ onkey-falling %d\n", - onkey->irq_falling); + if (onkey->irq_falling < 0) return onkey->irq_falling; - } onkey->irq_rising = platform_get_irq_byname(pdev, "onkey-rising"); - if (onkey->irq_rising < 0) { - dev_err(dev, "failed: request IRQ onkey-rising %d\n", - onkey->irq_rising); + if (onkey->irq_rising < 0) return onkey->irq_rising; - } if (!device_property_read_u32(dev, "power-off-time-sec", &val)) { if (val > 0 && val <= 16) { -- cgit v1.2.3-59-g8ed1b