Message ID | 20201125023147.2819115-1-wangli74@huawei.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | phy: renesas: rcar-gen3-usb2: disable pm_runtime in case of failure | expand |
Hello! On 25.11.2020 5:31, Wang Li wrote: > pm_runtime_enable will increase power disable depth. Thus a pairing Decrease? > decrement is needed on the error handling path to keep it balanced. Increment? > Fixes: 5d8042e95fd4 ("phy: rcar-gen3-usb2: Add support for r8a77470") > Reported-by: Hulk Robot <hulkci@huawei.com> > Signed-off-by: Wang Li <wangli74@huawei.com> [...] MBR, Sergei
diff --git a/drivers/phy/renesas/phy-rcar-gen3-usb2.c b/drivers/phy/renesas/phy-rcar-gen3-usb2.c index e34e4475027c..2cb949f931b6 100644 --- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c +++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c @@ -656,8 +656,10 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev) */ pm_runtime_enable(dev); phy_usb2_ops = of_device_get_match_data(dev); - if (!phy_usb2_ops) - return -EINVAL; + if (!phy_usb2_ops) { + ret = -EINVAL; + goto error; + } mutex_init(&channel->lock); for (i = 0; i < NUM_OF_PHYS; i++) {
pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced. Fixes: 5d8042e95fd4 ("phy: rcar-gen3-usb2: Add support for r8a77470") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wang Li <wangli74@huawei.com> --- drivers/phy/renesas/phy-rcar-gen3-usb2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)