summaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy-samsung-usb3.c
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2013-05-16 11:57:08 +0200
committerFelipe Balbi <balbi@ti.com>2013-05-28 20:06:39 +0300
commit0aa823a2ca02cd21c587713e8195a2ffb8bd7872 (patch)
tree74f6e7bdbc4a60f899d0bb504593fe1dab7cc8a3 /drivers/usb/phy/phy-samsung-usb3.c
parent87331b069761a292c7d832fc3bb34cde56418982 (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.c6
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 5a9efcbcb53..ec44b35fb24 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)
sphy->phy.init = samsung_usb3phy_init;
sphy->phy.shutdown = samsung_usb3phy_shutdown;
sphy->drv_data = samsung_usbphy_get_driver_data(pdev);
- sphy->ref_clk_freq = samsung_usbphy_get_refclk_freq(sphy);
+
+ sphy->ref_clk_freq = samsung_usbphy_get_refclk_freq(sphy);
+ if (sphy->ref_clk_freq < 0)
+ return -EINVAL;
spin_lock_init(&sphy->lock);
@@ -300,6 +303,7 @@ static int samsung_usb3phy_remove(struct platform_device *pdev)
static struct samsung_usbphy_drvdata usb3phy_exynos5 = {
.cpu_type = TYPE_EXYNOS5250,
.devphy_en_mask = EXYNOS_USBPHY_ENABLE,
+ .rate_to_clksel = samsung_usbphy_rate_to_clksel_4x12,
};
#ifdef CONFIG_OF