diff options
author | Biju Das <biju.das.jz@bp.renesas.com> | 2024-03-19 10:53:52 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-03-27 07:57:15 +0100 |
commit | a79c5b6f675634387de8e88b0c85a053b9952970 (patch) | |
tree | 3e5058fc21fbe52d6b45f07427d74c8a32f2baa4 /drivers/usb/renesas_usbhs | |
parent | c4f426460febadd10002248f579ee69374a4ef99 (diff) |
usb: renesas_usbhs: Simplify obtaining device data
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>
Diffstat (limited to 'drivers/usb/renesas_usbhs')
-rw-r--r-- | drivers/usb/renesas_usbhs/common.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index dd1c17542439..0c62e4c6c88d 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -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 */ |