Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1650784

[PATCH 2/3] phy: twl4030-usb: handle usb_add_phy_dev return value

From Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Newsgroups linux.kernel
Subject [PATCH 2/3] phy: twl4030-usb: handle usb_add_phy_dev return value
Date 2017-05-25 22:00 +0200
Message-ID <tL75o-40J-13@gated-at.bofh.it> (permalink)
References <tL75o-40J-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


usb_add_phy_dev can fail, so propagate this error instead of ignoring
that.

Fixes: 6747caa76cab ("usb: phy: twl4030: use the new generic PHY framework")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/phy/phy-twl4030-usb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index 07cb0150d008..6aefbd55fcee 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -723,7 +723,10 @@ static int twl4030_usb_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "ldo init failed\n");
 		return err;
 	}
-	usb_add_phy_dev(&twl->phy);
+
+	err = usb_add_phy_dev(&twl->phy);
+	if (err)
+		return err;
 
 	platform_set_drvdata(pdev, twl);
 	if (device_create_file(&pdev->dev, &dev_attr_vbus))
-- 
2.11.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] phy: twl4030-usb: undo usb_add_phy_dev in error path Uwe Kleine-König          <u.kleine-koenig@pengutronix.de> - 2017-05-25 22:00 +0200
  [PATCH 2/3] phy: twl4030-usb: handle usb_add_phy_dev return value Uwe Kleine-König          <u.kleine-koenig@pengutronix.de> - 2017-05-25 22:00 +0200
  [PATCH 3/3] phy: twl4030-usb: propagate actual error on regulator lookup Uwe Kleine-König          <u.kleine-koenig@pengutronix.de> - 2017-05-25 22:00 +0200

csiph-web