OSDN Git Service

phy: renesas: rcar-gen3-usb2: exit if request_irq() failed
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Fri, 17 Jul 2020 11:44:57 +0000 (20:44 +0900)
committerVinod Koul <vkoul@kernel.org>
Mon, 20 Jul 2020 06:33:44 +0000 (12:03 +0530)
To avoid unexpected behaviors, it's better to exit if request_irq()
failed.

Suggested-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/1594986297-12434-3-git-send-email-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/renesas/phy-rcar-gen3-usb2.c

index 5087b7c..e34e447 100644 (file)
@@ -419,8 +419,10 @@ static int rcar_gen3_phy_usb2_init(struct phy *p)
                INIT_WORK(&channel->work, rcar_gen3_phy_usb2_work);
                ret = request_irq(channel->irq, rcar_gen3_phy_usb2_irq,
                                  IRQF_SHARED, dev_name(channel->dev), channel);
-               if (ret < 0)
+               if (ret < 0) {
                        dev_err(channel->dev, "No irq handler (%d)\n", channel->irq);
+                       return ret;
+               }
        }
 
        /* Initialize USB2 part */