mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-25 11:55:37 +00:00
phy: renesas: rcar-gen3-usb2: Fix returning wrong error code
[ Upstream commit249abaf3bf
] 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 <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Closes: https://lore.kernel.org/r/202312161021.gOLDl48K-lkp@intel.com/ Fixes:441a681b88
("phy: rcar-gen3-usb2: fix implementation for runtime PM") Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20240105093703.3359949-1-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
25ab4d72eb
commit
ed3bb52a05
1 changed files with 0 additions and 4 deletions
|
@ -675,8 +675,6 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
|
|||
channel->irq = platform_get_irq_optional(pdev, 0);
|
||||
channel->dr_mode = rcar_gen3_get_dr_mode(dev->of_node);
|
||||
if (channel->dr_mode != USB_DR_MODE_UNKNOWN) {
|
||||
int ret;
|
||||
|
||||
channel->is_otg_channel = true;
|
||||
channel->uses_otg_pins = !of_property_read_bool(dev->of_node,
|
||||
"renesas,no-otg-pins");
|
||||
|
@ -740,8 +738,6 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
|
|||
ret = PTR_ERR(provider);
|
||||
goto error;
|
||||
} else if (channel->is_otg_channel) {
|
||||
int ret;
|
||||
|
||||
ret = device_create_file(dev, &dev_attr_role);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
|
|
Loading…
Reference in a new issue