Message ID | 20230120154437.22025-3-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers | show |
Series | [v1,1/5] usb: fotg210-hcd: use sysfs_emit() to instead of scnprintf() | expand |
On Fri, Jan 20, 2023 at 4:44 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > A call to platform_get_irq() already prints an error on failure within > its own implementation. So printing another error based on its return > value in the caller is redundant and should be removed. The clean up > also makes if condition block braces unnecessary. Remove that as well. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij
diff --git a/drivers/usb/fotg210/fotg210-udc.c b/drivers/usb/fotg210/fotg210-udc.c index 4334504fccc8..18d254125186 100644 --- a/drivers/usb/fotg210/fotg210-udc.c +++ b/drivers/usb/fotg210/fotg210-udc.c @@ -1169,10 +1169,8 @@ int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg) int i; irq = platform_get_irq(pdev, 0); - if (irq < 0) { - pr_err("could not get irq\n"); - return -ENODEV; - } + if (irq < 0) + return irq; /* initialize udc */ fotg210 = kzalloc(sizeof(struct fotg210_udc), GFP_KERNEL);
A call to platform_get_irq() already prints an error on failure within its own implementation. So printing another error based on its return value in the caller is redundant and should be removed. The clean up also makes if condition block braces unnecessary. Remove that as well. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/usb/fotg210/fotg210-udc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)