usb: renesas_usbhs: Simplify obtaining device data
authorBiju Das <biju.das.jz@bp.renesas.com>
Tue, 19 Mar 2024 10:53:52 +0000 (10:53 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Mar 2024 06:57:15 +0000 (07:57 +0100)
Simplify probe() by removing redundant dev->of_node check.

While at it, replace dev_err->dev_err_probe for error path.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240319105356.87287-3-biju.das.jz@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/renesas_usbhs/common.c

index dd1c17542439424150f5dffa62089602fbabe0b6..0c62e4c6c88d4e2111eba9a7e0efe0ba71d55822 100644 (file)
@@ -595,16 +595,11 @@ static int usbhs_probe(struct platform_device *pdev)
        u32 tmp;
        int irq;
 
-       /* check device node */
-       if (dev_of_node(dev))
-               info = of_device_get_match_data(dev);
-       else
-               info = renesas_usbhs_get_info(pdev);
-
-       /* check platform information */
+       info = of_device_get_match_data(dev);
        if (!info) {
-               dev_err(dev, "no platform information\n");
-               return -EINVAL;
+               info = renesas_usbhs_get_info(pdev);
+               if (!info)
+                       return dev_err_probe(dev, -EINVAL, "no platform info\n");
        }
 
        /* platform data */