Skip to content

Commit 4368a12

Browse files
shimodaySasha Levin
authored andcommitted
phy: renesas: rcar-gen3-usb2: Fix returning wrong error code
[ Upstream commit 249abaf ] Even if device_create_file() returns error code, rcar_gen3_phy_usb2_probe() will return zero because the "ret" is variable shadowing. Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Fixes: 441a681 ("phy: rcar-gen3-usb2: fix implementation for runtime PM") Signed-off-by: Yoshihiro Shimoda <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent fcedce8 commit 4368a12

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/phy/renesas/phy-rcar-gen3-usb2.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,6 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
673673
channel->irq = platform_get_irq_optional(pdev, 0);
674674
channel->dr_mode = rcar_gen3_get_dr_mode(dev->of_node);
675675
if (channel->dr_mode != USB_DR_MODE_UNKNOWN) {
676-
int ret;
677-
678676
channel->is_otg_channel = true;
679677
channel->uses_otg_pins = !of_property_read_bool(dev->of_node,
680678
"renesas,no-otg-pins");
@@ -738,8 +736,6 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
738736
ret = PTR_ERR(provider);
739737
goto error;
740738
} else if (channel->is_otg_channel) {
741-
int ret;
742-
743739
ret = device_create_file(dev, &dev_attr_role);
744740
if (ret < 0)
745741
goto error;

0 commit comments

Comments
 (0)