diff options
author | Tomasz Figa <t.figa@samsung.com> | 2013-05-16 05:57:08 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-05-28 13:06:39 -0400 |
commit | 0aa823a2ca02cd21c587713e8195a2ffb8bd7872 (patch) | |
tree | 74f6e7bdbc4a60f899d0bb504593fe1dab7cc8a3 /drivers/usb/phy/phy-samsung-usb3.c | |
parent | 87331b069761a292c7d832fc3bb34cde56418982 (diff) |
usb: phy: samsung: Consolidate reference clock rate handling
This patch cleans up handling of reference clock rate in Samsung USB PHY
drivers. It is mostly a cosmetic change but improves error handling in
case of failing to get reference clock or invalid clock rate.
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy/phy-samsung-usb3.c')
-rw-r--r-- | drivers/usb/phy/phy-samsung-usb3.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/phy/phy-samsung-usb3.c b/drivers/usb/phy/phy-samsung-usb3.c index 5a9efcbcb532..ec44b35fb24a 100644 --- a/drivers/usb/phy/phy-samsung-usb3.c +++ b/drivers/usb/phy/phy-samsung-usb3.c | |||
@@ -274,7 +274,10 @@ static int samsung_usb3phy_probe(struct platform_device *pdev) | |||
274 | sphy->phy.init = samsung_usb3phy_init; | 274 | sphy->phy.init = samsung_usb3phy_init; |
275 | sphy->phy.shutdown = samsung_usb3phy_shutdown; | 275 | sphy->phy.shutdown = samsung_usb3phy_shutdown; |
276 | sphy->drv_data = samsung_usbphy_get_driver_data(pdev); | 276 | sphy->drv_data = samsung_usbphy_get_driver_data(pdev); |
277 | sphy->ref_clk_freq = samsung_usbphy_get_refclk_freq(sphy); | 277 | |
278 | sphy->ref_clk_freq = samsung_usbphy_get_refclk_freq(sphy); | ||
279 | if (sphy->ref_clk_freq < 0) | ||
280 | return -EINVAL; | ||
278 | 281 | ||
279 | spin_lock_init(&sphy->lock); | 282 | spin_lock_init(&sphy->lock); |
280 | 283 | ||
@@ -300,6 +303,7 @@ static int samsung_usb3phy_remove(struct platform_device *pdev) | |||
300 | static struct samsung_usbphy_drvdata usb3phy_exynos5 = { | 303 | static struct samsung_usbphy_drvdata usb3phy_exynos5 = { |
301 | .cpu_type = TYPE_EXYNOS5250, | 304 | .cpu_type = TYPE_EXYNOS5250, |
302 | .devphy_en_mask = EXYNOS_USBPHY_ENABLE, | 305 | .devphy_en_mask = EXYNOS_USBPHY_ENABLE, |
306 | .rate_to_clksel = samsung_usbphy_rate_to_clksel_4x12, | ||
303 | }; | 307 | }; |
304 | 308 | ||
305 | #ifdef CONFIG_OF | 309 | #ifdef CONFIG_OF |