diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-03-22 14:33:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-03-22 14:33:55 -0400 |
commit | cedd5f659eb9b51a6869806aa123fb10f8f83d86 (patch) | |
tree | 9f362597fb4c2b9d19546df5c64f47b8eaf19854 /drivers/phy | |
parent | f897522468fac92b8673151113d6d251b51e6b33 (diff) | |
parent | a886bd92267c9e3d5c912860c6fb5a68479a7643 (diff) |
Merge tag 'usb-4.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB / PHY driver fixes from Greg KH:
"Here's a number of USB and PHY driver fixes for 4.0-rc5.
The largest thing here is a revert of a gadget function driver patch
that removes 500 lines of code. Other than that, it's a number of
reported bugs fixes and new quirk/id entries.
All have been in linux-next for a while"
* tag 'usb-4.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (33 commits)
usb: common: otg-fsm: only signal connect after switching to peripheral
uas: Add US_FL_NO_ATA_1X for Initio Corporation controllers / devices
USB: ehci-atmel: rework clk handling
MAINTAINERS: add entry for USB OTG FSM
usb: chipidea: otg: add a_alt_hnp_support response for B device
phy: omap-usb2: Fix missing clk_prepare call when using old dt name
phy: ti/omap: Fix modalias
phy: core: Fixup return value of phy_exit when !pm_runtime_enabled
phy: miphy28lp: Convert to devm_kcalloc and fix wrong sizof
phy: miphy365x: Convert to devm_kcalloc and fix wrong sizeof
phy: twl4030-usb: Remove redundant assignment for twl->linkstat
phy: exynos5-usbdrd: Fix off-by-one valid value checking for args->args[0]
phy: Find the right match in devm_phy_destroy()
phy: rockchip-usb: Fixup rockchip_usb_phy_power_on failure path
phy: ti-pipe3: Simplify ti_pipe3_dpll_wait_lock implementation
phy: samsung-usb2: Remove NULL terminating entry from phys array
phy: hix5hd2-sata: Check return value of platform_get_resource
phy: exynos-dp-video: Kill exynos_dp_video_phy_pwr_isol function
Revert "usb: gadget: zero: Add support for interrupt EP"
Revert "xhci: Clear the host side toggle manually when endpoint is 'soft reset'"
...
Diffstat (limited to 'drivers/phy')
-rw-r--r-- | drivers/phy/phy-armada375-usb2.c | 3 | ||||
-rw-r--r-- | drivers/phy/phy-core.c | 11 | ||||
-rw-r--r-- | drivers/phy/phy-exynos-dp-video.c | 24 | ||||
-rw-r--r-- | drivers/phy/phy-exynos-mipi-video.c | 11 | ||||
-rw-r--r-- | drivers/phy/phy-exynos4210-usb2.c | 1 | ||||
-rw-r--r-- | drivers/phy/phy-exynos4x12-usb2.c | 1 | ||||
-rw-r--r-- | drivers/phy/phy-exynos5-usbdrd.c | 2 | ||||
-rw-r--r-- | drivers/phy/phy-exynos5250-usb2.c | 1 | ||||
-rw-r--r-- | drivers/phy/phy-hix5hd2-sata.c | 3 | ||||
-rw-r--r-- | drivers/phy/phy-miphy28lp.c | 13 | ||||
-rw-r--r-- | drivers/phy/phy-miphy365x.c | 12 | ||||
-rw-r--r-- | drivers/phy/phy-omap-control.c | 2 | ||||
-rw-r--r-- | drivers/phy/phy-omap-usb2.c | 7 | ||||
-rw-r--r-- | drivers/phy/phy-rockchip-usb.c | 6 | ||||
-rw-r--r-- | drivers/phy/phy-ti-pipe3.c | 12 | ||||
-rw-r--r-- | drivers/phy/phy-twl4030-usb.c | 1 | ||||
-rw-r--r-- | drivers/phy/phy-xgene.c | 1 |
17 files changed, 45 insertions, 66 deletions
diff --git a/drivers/phy/phy-armada375-usb2.c b/drivers/phy/phy-armada375-usb2.c index 7c99ca256f05..8ccc3952c13d 100644 --- a/drivers/phy/phy-armada375-usb2.c +++ b/drivers/phy/phy-armada375-usb2.c | |||
@@ -37,7 +37,7 @@ static int armada375_usb_phy_init(struct phy *phy) | |||
37 | struct armada375_cluster_phy *cluster_phy; | 37 | struct armada375_cluster_phy *cluster_phy; |
38 | u32 reg; | 38 | u32 reg; |
39 | 39 | ||
40 | cluster_phy = dev_get_drvdata(phy->dev.parent); | 40 | cluster_phy = phy_get_drvdata(phy); |
41 | if (!cluster_phy) | 41 | if (!cluster_phy) |
42 | return -ENODEV; | 42 | return -ENODEV; |
43 | 43 | ||
@@ -131,6 +131,7 @@ static int armada375_usb_phy_probe(struct platform_device *pdev) | |||
131 | cluster_phy->reg = usb_cluster_base; | 131 | cluster_phy->reg = usb_cluster_base; |
132 | 132 | ||
133 | dev_set_drvdata(dev, cluster_phy); | 133 | dev_set_drvdata(dev, cluster_phy); |
134 | phy_set_drvdata(phy, cluster_phy); | ||
134 | 135 | ||
135 | phy_provider = devm_of_phy_provider_register(&pdev->dev, | 136 | phy_provider = devm_of_phy_provider_register(&pdev->dev, |
136 | armada375_usb_phy_xlate); | 137 | armada375_usb_phy_xlate); |
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index a12d35338313..3791838f4bd4 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c | |||
@@ -52,7 +52,9 @@ static void devm_phy_consume(struct device *dev, void *res) | |||
52 | 52 | ||
53 | static int devm_phy_match(struct device *dev, void *res, void *match_data) | 53 | static int devm_phy_match(struct device *dev, void *res, void *match_data) |
54 | { | 54 | { |
55 | return res == match_data; | 55 | struct phy **phy = res; |
56 | |||
57 | return *phy == match_data; | ||
56 | } | 58 | } |
57 | 59 | ||
58 | /** | 60 | /** |
@@ -223,6 +225,7 @@ int phy_init(struct phy *phy) | |||
223 | ret = phy_pm_runtime_get_sync(phy); | 225 | ret = phy_pm_runtime_get_sync(phy); |
224 | if (ret < 0 && ret != -ENOTSUPP) | 226 | if (ret < 0 && ret != -ENOTSUPP) |
225 | return ret; | 227 | return ret; |
228 | ret = 0; /* Override possible ret == -ENOTSUPP */ | ||
226 | 229 | ||
227 | mutex_lock(&phy->mutex); | 230 | mutex_lock(&phy->mutex); |
228 | if (phy->init_count == 0 && phy->ops->init) { | 231 | if (phy->init_count == 0 && phy->ops->init) { |
@@ -231,8 +234,6 @@ int phy_init(struct phy *phy) | |||
231 | dev_err(&phy->dev, "phy init failed --> %d\n", ret); | 234 | dev_err(&phy->dev, "phy init failed --> %d\n", ret); |
232 | goto out; | 235 | goto out; |
233 | } | 236 | } |
234 | } else { | ||
235 | ret = 0; /* Override possible ret == -ENOTSUPP */ | ||
236 | } | 237 | } |
237 | ++phy->init_count; | 238 | ++phy->init_count; |
238 | 239 | ||
@@ -253,6 +254,7 @@ int phy_exit(struct phy *phy) | |||
253 | ret = phy_pm_runtime_get_sync(phy); | 254 | ret = phy_pm_runtime_get_sync(phy); |
254 | if (ret < 0 && ret != -ENOTSUPP) | 255 | if (ret < 0 && ret != -ENOTSUPP) |
255 | return ret; | 256 | return ret; |
257 | ret = 0; /* Override possible ret == -ENOTSUPP */ | ||
256 | 258 | ||
257 | mutex_lock(&phy->mutex); | 259 | mutex_lock(&phy->mutex); |
258 | if (phy->init_count == 1 && phy->ops->exit) { | 260 | if (phy->init_count == 1 && phy->ops->exit) { |
@@ -287,6 +289,7 @@ int phy_power_on(struct phy *phy) | |||
287 | ret = phy_pm_runtime_get_sync(phy); | 289 | ret = phy_pm_runtime_get_sync(phy); |
288 | if (ret < 0 && ret != -ENOTSUPP) | 290 | if (ret < 0 && ret != -ENOTSUPP) |
289 | return ret; | 291 | return ret; |
292 | ret = 0; /* Override possible ret == -ENOTSUPP */ | ||
290 | 293 | ||
291 | mutex_lock(&phy->mutex); | 294 | mutex_lock(&phy->mutex); |
292 | if (phy->power_count == 0 && phy->ops->power_on) { | 295 | if (phy->power_count == 0 && phy->ops->power_on) { |
@@ -295,8 +298,6 @@ int phy_power_on(struct phy *phy) | |||
295 | dev_err(&phy->dev, "phy poweron failed --> %d\n", ret); | 298 | dev_err(&phy->dev, "phy poweron failed --> %d\n", ret); |
296 | goto out; | 299 | goto out; |
297 | } | 300 | } |
298 | } else { | ||
299 | ret = 0; /* Override possible ret == -ENOTSUPP */ | ||
300 | } | 301 | } |
301 | ++phy->power_count; | 302 | ++phy->power_count; |
302 | mutex_unlock(&phy->mutex); | 303 | mutex_unlock(&phy->mutex); |
diff --git a/drivers/phy/phy-exynos-dp-video.c b/drivers/phy/phy-exynos-dp-video.c index f86cbe68ddaf..179cbf9451aa 100644 --- a/drivers/phy/phy-exynos-dp-video.c +++ b/drivers/phy/phy-exynos-dp-video.c | |||
@@ -30,28 +30,13 @@ struct exynos_dp_video_phy { | |||
30 | const struct exynos_dp_video_phy_drvdata *drvdata; | 30 | const struct exynos_dp_video_phy_drvdata *drvdata; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | static void exynos_dp_video_phy_pwr_isol(struct exynos_dp_video_phy *state, | ||
34 | unsigned int on) | ||
35 | { | ||
36 | unsigned int val; | ||
37 | |||
38 | if (IS_ERR(state->regs)) | ||
39 | return; | ||
40 | |||
41 | val = on ? 0 : EXYNOS5_PHY_ENABLE; | ||
42 | |||
43 | regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset, | ||
44 | EXYNOS5_PHY_ENABLE, val); | ||
45 | } | ||
46 | |||
47 | static int exynos_dp_video_phy_power_on(struct phy *phy) | 33 | static int exynos_dp_video_phy_power_on(struct phy *phy) |
48 | { | 34 | { |
49 | struct exynos_dp_video_phy *state = phy_get_drvdata(phy); | 35 | struct exynos_dp_video_phy *state = phy_get_drvdata(phy); |
50 | 36 | ||
51 | /* Disable power isolation on DP-PHY */ | 37 | /* Disable power isolation on DP-PHY */ |
52 | exynos_dp_video_phy_pwr_isol(state, 0); | 38 | return regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset, |
53 | 39 | EXYNOS5_PHY_ENABLE, EXYNOS5_PHY_ENABLE); | |
54 | return 0; | ||
55 | } | 40 | } |
56 | 41 | ||
57 | static int exynos_dp_video_phy_power_off(struct phy *phy) | 42 | static int exynos_dp_video_phy_power_off(struct phy *phy) |
@@ -59,9 +44,8 @@ static int exynos_dp_video_phy_power_off(struct phy *phy) | |||
59 | struct exynos_dp_video_phy *state = phy_get_drvdata(phy); | 44 | struct exynos_dp_video_phy *state = phy_get_drvdata(phy); |
60 | 45 | ||
61 | /* Enable power isolation on DP-PHY */ | 46 | /* Enable power isolation on DP-PHY */ |
62 | exynos_dp_video_phy_pwr_isol(state, 1); | 47 | return regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset, |
63 | 48 | EXYNOS5_PHY_ENABLE, 0); | |
64 | return 0; | ||
65 | } | 49 | } |
66 | 50 | ||
67 | static struct phy_ops exynos_dp_video_phy_ops = { | 51 | static struct phy_ops exynos_dp_video_phy_ops = { |
diff --git a/drivers/phy/phy-exynos-mipi-video.c b/drivers/phy/phy-exynos-mipi-video.c index f017b2f2a54e..df7519a39ba0 100644 --- a/drivers/phy/phy-exynos-mipi-video.c +++ b/drivers/phy/phy-exynos-mipi-video.c | |||
@@ -43,7 +43,6 @@ struct exynos_mipi_video_phy { | |||
43 | } phys[EXYNOS_MIPI_PHYS_NUM]; | 43 | } phys[EXYNOS_MIPI_PHYS_NUM]; |
44 | spinlock_t slock; | 44 | spinlock_t slock; |
45 | void __iomem *regs; | 45 | void __iomem *regs; |
46 | struct mutex mutex; | ||
47 | struct regmap *regmap; | 46 | struct regmap *regmap; |
48 | }; | 47 | }; |
49 | 48 | ||
@@ -59,8 +58,9 @@ static int __set_phy_state(struct exynos_mipi_video_phy *state, | |||
59 | else | 58 | else |
60 | reset = EXYNOS4_MIPI_PHY_SRESETN; | 59 | reset = EXYNOS4_MIPI_PHY_SRESETN; |
61 | 60 | ||
62 | if (state->regmap) { | 61 | spin_lock(&state->slock); |
63 | mutex_lock(&state->mutex); | 62 | |
63 | if (!IS_ERR(state->regmap)) { | ||
64 | regmap_read(state->regmap, offset, &val); | 64 | regmap_read(state->regmap, offset, &val); |
65 | if (on) | 65 | if (on) |
66 | val |= reset; | 66 | val |= reset; |
@@ -72,11 +72,9 @@ static int __set_phy_state(struct exynos_mipi_video_phy *state, | |||
72 | else if (!(val & EXYNOS4_MIPI_PHY_RESET_MASK)) | 72 | else if (!(val & EXYNOS4_MIPI_PHY_RESET_MASK)) |
73 | val &= ~EXYNOS4_MIPI_PHY_ENABLE; | 73 | val &= ~EXYNOS4_MIPI_PHY_ENABLE; |
74 | regmap_write(state->regmap, offset, val); | 74 | regmap_write(state->regmap, offset, val); |
75 | mutex_unlock(&state->mutex); | ||
76 | } else { | 75 | } else { |
77 | addr = state->regs + EXYNOS_MIPI_PHY_CONTROL(id / 2); | 76 | addr = state->regs + EXYNOS_MIPI_PHY_CONTROL(id / 2); |
78 | 77 | ||
79 | spin_lock(&state->slock); | ||
80 | val = readl(addr); | 78 | val = readl(addr); |
81 | if (on) | 79 | if (on) |
82 | val |= reset; | 80 | val |= reset; |
@@ -90,9 +88,9 @@ static int __set_phy_state(struct exynos_mipi_video_phy *state, | |||
90 | val &= ~EXYNOS4_MIPI_PHY_ENABLE; | 88 | val &= ~EXYNOS4_MIPI_PHY_ENABLE; |
91 | 89 | ||
92 | writel(val, addr); | 90 | writel(val, addr); |
93 | spin_unlock(&state->slock); | ||
94 | } | 91 | } |
95 | 92 | ||
93 | spin_unlock(&state->slock); | ||
96 | return 0; | 94 | return 0; |
97 | } | 95 | } |
98 | 96 | ||
@@ -158,7 +156,6 @@ static int exynos_mipi_video_phy_probe(struct platform_device *pdev) | |||
158 | 156 | ||
159 | dev_set_drvdata(dev, state); | 157 | dev_set_drvdata(dev, state); |
160 | spin_lock_init(&state->slock); | 158 | spin_lock_init(&state->slock); |
161 | mutex_init(&state->mutex); | ||
162 | 159 | ||
163 | for (i = 0; i < EXYNOS_MIPI_PHYS_NUM; i++) { | 160 | for (i = 0; i < EXYNOS_MIPI_PHYS_NUM; i++) { |
164 | struct phy *phy = devm_phy_create(dev, NULL, | 161 | struct phy *phy = devm_phy_create(dev, NULL, |
diff --git a/drivers/phy/phy-exynos4210-usb2.c b/drivers/phy/phy-exynos4210-usb2.c index 236a52ad94eb..f30bbb0fb3b2 100644 --- a/drivers/phy/phy-exynos4210-usb2.c +++ b/drivers/phy/phy-exynos4210-usb2.c | |||
@@ -250,7 +250,6 @@ static const struct samsung_usb2_common_phy exynos4210_phys[] = { | |||
250 | .power_on = exynos4210_power_on, | 250 | .power_on = exynos4210_power_on, |
251 | .power_off = exynos4210_power_off, | 251 | .power_off = exynos4210_power_off, |
252 | }, | 252 | }, |
253 | {}, | ||
254 | }; | 253 | }; |
255 | 254 | ||
256 | const struct samsung_usb2_phy_config exynos4210_usb2_phy_config = { | 255 | const struct samsung_usb2_phy_config exynos4210_usb2_phy_config = { |
diff --git a/drivers/phy/phy-exynos4x12-usb2.c b/drivers/phy/phy-exynos4x12-usb2.c index 0b9de88579b1..765da90a536f 100644 --- a/drivers/phy/phy-exynos4x12-usb2.c +++ b/drivers/phy/phy-exynos4x12-usb2.c | |||
@@ -361,7 +361,6 @@ static const struct samsung_usb2_common_phy exynos4x12_phys[] = { | |||
361 | .power_on = exynos4x12_power_on, | 361 | .power_on = exynos4x12_power_on, |
362 | .power_off = exynos4x12_power_off, | 362 | .power_off = exynos4x12_power_off, |
363 | }, | 363 | }, |
364 | {}, | ||
365 | }; | 364 | }; |
366 | 365 | ||
367 | const struct samsung_usb2_phy_config exynos3250_usb2_phy_config = { | 366 | const struct samsung_usb2_phy_config exynos3250_usb2_phy_config = { |
diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5-usbdrd.c index 04374018425f..e2a0be750ad9 100644 --- a/drivers/phy/phy-exynos5-usbdrd.c +++ b/drivers/phy/phy-exynos5-usbdrd.c | |||
@@ -531,7 +531,7 @@ static struct phy *exynos5_usbdrd_phy_xlate(struct device *dev, | |||
531 | { | 531 | { |
532 | struct exynos5_usbdrd_phy *phy_drd = dev_get_drvdata(dev); | 532 | struct exynos5_usbdrd_phy *phy_drd = dev_get_drvdata(dev); |
533 | 533 | ||
534 | if (WARN_ON(args->args[0] > EXYNOS5_DRDPHYS_NUM)) | 534 | if (WARN_ON(args->args[0] >= EXYNOS5_DRDPHYS_NUM)) |
535 | return ERR_PTR(-ENODEV); | 535 | return ERR_PTR(-ENODEV); |
536 | 536 | ||
537 | return phy_drd->phys[args->args[0]].phy; | 537 | return phy_drd->phys[args->args[0]].phy; |
diff --git a/drivers/phy/phy-exynos5250-usb2.c b/drivers/phy/phy-exynos5250-usb2.c index 1c139aa0d074..2ed1735a076a 100644 --- a/drivers/phy/phy-exynos5250-usb2.c +++ b/drivers/phy/phy-exynos5250-usb2.c | |||
@@ -391,7 +391,6 @@ static const struct samsung_usb2_common_phy exynos5250_phys[] = { | |||
391 | .power_on = exynos5250_power_on, | 391 | .power_on = exynos5250_power_on, |
392 | .power_off = exynos5250_power_off, | 392 | .power_off = exynos5250_power_off, |
393 | }, | 393 | }, |
394 | {}, | ||
395 | }; | 394 | }; |
396 | 395 | ||
397 | const struct samsung_usb2_phy_config exynos5250_usb2_phy_config = { | 396 | const struct samsung_usb2_phy_config exynos5250_usb2_phy_config = { |
diff --git a/drivers/phy/phy-hix5hd2-sata.c b/drivers/phy/phy-hix5hd2-sata.c index 34915b4202f1..d6b22659cac1 100644 --- a/drivers/phy/phy-hix5hd2-sata.c +++ b/drivers/phy/phy-hix5hd2-sata.c | |||
@@ -147,6 +147,9 @@ static int hix5hd2_sata_phy_probe(struct platform_device *pdev) | |||
147 | return -ENOMEM; | 147 | return -ENOMEM; |
148 | 148 | ||
149 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 149 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
150 | if (!res) | ||
151 | return -EINVAL; | ||
152 | |||
150 | priv->base = devm_ioremap(dev, res->start, resource_size(res)); | 153 | priv->base = devm_ioremap(dev, res->start, resource_size(res)); |
151 | if (!priv->base) | 154 | if (!priv->base) |
152 | return -ENOMEM; | 155 | return -ENOMEM; |
diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c index 9b2848e6115d..933435214acc 100644 --- a/drivers/phy/phy-miphy28lp.c +++ b/drivers/phy/phy-miphy28lp.c | |||
@@ -228,6 +228,7 @@ struct miphy28lp_dev { | |||
228 | struct regmap *regmap; | 228 | struct regmap *regmap; |
229 | struct mutex miphy_mutex; | 229 | struct mutex miphy_mutex; |
230 | struct miphy28lp_phy **phys; | 230 | struct miphy28lp_phy **phys; |
231 | int nphys; | ||
231 | }; | 232 | }; |
232 | 233 | ||
233 | struct miphy_initval { | 234 | struct miphy_initval { |
@@ -1116,7 +1117,7 @@ static struct phy *miphy28lp_xlate(struct device *dev, | |||
1116 | return ERR_PTR(-EINVAL); | 1117 | return ERR_PTR(-EINVAL); |
1117 | } | 1118 | } |
1118 | 1119 | ||
1119 | for (index = 0; index < of_get_child_count(dev->of_node); index++) | 1120 | for (index = 0; index < miphy_dev->nphys; index++) |
1120 | if (phynode == miphy_dev->phys[index]->phy->dev.of_node) { | 1121 | if (phynode == miphy_dev->phys[index]->phy->dev.of_node) { |
1121 | miphy_phy = miphy_dev->phys[index]; | 1122 | miphy_phy = miphy_dev->phys[index]; |
1122 | break; | 1123 | break; |
@@ -1138,6 +1139,7 @@ static struct phy *miphy28lp_xlate(struct device *dev, | |||
1138 | 1139 | ||
1139 | static struct phy_ops miphy28lp_ops = { | 1140 | static struct phy_ops miphy28lp_ops = { |
1140 | .init = miphy28lp_init, | 1141 | .init = miphy28lp_init, |
1142 | .owner = THIS_MODULE, | ||
1141 | }; | 1143 | }; |
1142 | 1144 | ||
1143 | static int miphy28lp_probe_resets(struct device_node *node, | 1145 | static int miphy28lp_probe_resets(struct device_node *node, |
@@ -1200,16 +1202,15 @@ static int miphy28lp_probe(struct platform_device *pdev) | |||
1200 | struct miphy28lp_dev *miphy_dev; | 1202 | struct miphy28lp_dev *miphy_dev; |
1201 | struct phy_provider *provider; | 1203 | struct phy_provider *provider; |
1202 | struct phy *phy; | 1204 | struct phy *phy; |
1203 | int chancount, port = 0; | 1205 | int ret, port = 0; |
1204 | int ret; | ||
1205 | 1206 | ||
1206 | miphy_dev = devm_kzalloc(&pdev->dev, sizeof(*miphy_dev), GFP_KERNEL); | 1207 | miphy_dev = devm_kzalloc(&pdev->dev, sizeof(*miphy_dev), GFP_KERNEL); |
1207 | if (!miphy_dev) | 1208 | if (!miphy_dev) |
1208 | return -ENOMEM; | 1209 | return -ENOMEM; |
1209 | 1210 | ||
1210 | chancount = of_get_child_count(np); | 1211 | miphy_dev->nphys = of_get_child_count(np); |
1211 | miphy_dev->phys = devm_kzalloc(&pdev->dev, sizeof(phy) * chancount, | 1212 | miphy_dev->phys = devm_kcalloc(&pdev->dev, miphy_dev->nphys, |
1212 | GFP_KERNEL); | 1213 | sizeof(*miphy_dev->phys), GFP_KERNEL); |
1213 | if (!miphy_dev->phys) | 1214 | if (!miphy_dev->phys) |
1214 | return -ENOMEM; | 1215 | return -ENOMEM; |
1215 | 1216 | ||
diff --git a/drivers/phy/phy-miphy365x.c b/drivers/phy/phy-miphy365x.c index 6c80154e8bff..51b459db9137 100644 --- a/drivers/phy/phy-miphy365x.c +++ b/drivers/phy/phy-miphy365x.c | |||
@@ -150,6 +150,7 @@ struct miphy365x_dev { | |||
150 | struct regmap *regmap; | 150 | struct regmap *regmap; |
151 | struct mutex miphy_mutex; | 151 | struct mutex miphy_mutex; |
152 | struct miphy365x_phy **phys; | 152 | struct miphy365x_phy **phys; |
153 | int nphys; | ||
153 | }; | 154 | }; |
154 | 155 | ||
155 | /* | 156 | /* |
@@ -485,7 +486,7 @@ static struct phy *miphy365x_xlate(struct device *dev, | |||
485 | return ERR_PTR(-EINVAL); | 486 | return ERR_PTR(-EINVAL); |
486 | } | 487 | } |
487 | 488 | ||
488 | for (index = 0; index < of_get_child_count(dev->of_node); index++) | 489 | for (index = 0; index < miphy_dev->nphys; index++) |
489 | if (phynode == miphy_dev->phys[index]->phy->dev.of_node) { | 490 | if (phynode == miphy_dev->phys[index]->phy->dev.of_node) { |
490 | miphy_phy = miphy_dev->phys[index]; | 491 | miphy_phy = miphy_dev->phys[index]; |
491 | break; | 492 | break; |
@@ -541,16 +542,15 @@ static int miphy365x_probe(struct platform_device *pdev) | |||
541 | struct miphy365x_dev *miphy_dev; | 542 | struct miphy365x_dev *miphy_dev; |
542 | struct phy_provider *provider; | 543 | struct phy_provider *provider; |
543 | struct phy *phy; | 544 | struct phy *phy; |
544 | int chancount, port = 0; | 545 | int ret, port = 0; |
545 | int ret; | ||
546 | 546 | ||
547 | miphy_dev = devm_kzalloc(&pdev->dev, sizeof(*miphy_dev), GFP_KERNEL); | 547 | miphy_dev = devm_kzalloc(&pdev->dev, sizeof(*miphy_dev), GFP_KERNEL); |
548 | if (!miphy_dev) | 548 | if (!miphy_dev) |
549 | return -ENOMEM; | 549 | return -ENOMEM; |
550 | 550 | ||
551 | chancount = of_get_child_count(np); | 551 | miphy_dev->nphys = of_get_child_count(np); |
552 | miphy_dev->phys = devm_kzalloc(&pdev->dev, sizeof(phy) * chancount, | 552 | miphy_dev->phys = devm_kcalloc(&pdev->dev, miphy_dev->nphys, |
553 | GFP_KERNEL); | 553 | sizeof(*miphy_dev->phys), GFP_KERNEL); |
554 | if (!miphy_dev->phys) | 554 | if (!miphy_dev->phys) |
555 | return -ENOMEM; | 555 | return -ENOMEM; |
556 | 556 | ||
diff --git a/drivers/phy/phy-omap-control.c b/drivers/phy/phy-omap-control.c index efe724f97e02..93252e053a31 100644 --- a/drivers/phy/phy-omap-control.c +++ b/drivers/phy/phy-omap-control.c | |||
@@ -360,7 +360,7 @@ static void __exit omap_control_phy_exit(void) | |||
360 | } | 360 | } |
361 | module_exit(omap_control_phy_exit); | 361 | module_exit(omap_control_phy_exit); |
362 | 362 | ||
363 | MODULE_ALIAS("platform: omap_control_phy"); | 363 | MODULE_ALIAS("platform:omap_control_phy"); |
364 | MODULE_AUTHOR("Texas Instruments Inc."); | 364 | MODULE_AUTHOR("Texas Instruments Inc."); |
365 | MODULE_DESCRIPTION("OMAP Control Module PHY Driver"); | 365 | MODULE_DESCRIPTION("OMAP Control Module PHY Driver"); |
366 | MODULE_LICENSE("GPL v2"); | 366 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c index 6f4aef3db248..4757e765696a 100644 --- a/drivers/phy/phy-omap-usb2.c +++ b/drivers/phy/phy-omap-usb2.c | |||
@@ -296,10 +296,11 @@ static int omap_usb2_probe(struct platform_device *pdev) | |||
296 | dev_warn(&pdev->dev, | 296 | dev_warn(&pdev->dev, |
297 | "found usb_otg_ss_refclk960m, please fix DTS\n"); | 297 | "found usb_otg_ss_refclk960m, please fix DTS\n"); |
298 | } | 298 | } |
299 | } else { | ||
300 | clk_prepare(phy->optclk); | ||
301 | } | 299 | } |
302 | 300 | ||
301 | if (!IS_ERR(phy->optclk)) | ||
302 | clk_prepare(phy->optclk); | ||
303 | |||
303 | usb_add_phy_dev(&phy->phy); | 304 | usb_add_phy_dev(&phy->phy); |
304 | 305 | ||
305 | return 0; | 306 | return 0; |
@@ -383,7 +384,7 @@ static struct platform_driver omap_usb2_driver = { | |||
383 | 384 | ||
384 | module_platform_driver(omap_usb2_driver); | 385 | module_platform_driver(omap_usb2_driver); |
385 | 386 | ||
386 | MODULE_ALIAS("platform: omap_usb2"); | 387 | MODULE_ALIAS("platform:omap_usb2"); |
387 | MODULE_AUTHOR("Texas Instruments Inc."); | 388 | MODULE_AUTHOR("Texas Instruments Inc."); |
388 | MODULE_DESCRIPTION("OMAP USB2 phy driver"); | 389 | MODULE_DESCRIPTION("OMAP USB2 phy driver"); |
389 | MODULE_LICENSE("GPL v2"); | 390 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/phy/phy-rockchip-usb.c b/drivers/phy/phy-rockchip-usb.c index 22011c3b6a4b..7d4c33643768 100644 --- a/drivers/phy/phy-rockchip-usb.c +++ b/drivers/phy/phy-rockchip-usb.c | |||
@@ -61,8 +61,6 @@ static int rockchip_usb_phy_power_off(struct phy *_phy) | |||
61 | return ret; | 61 | return ret; |
62 | 62 | ||
63 | clk_disable_unprepare(phy->clk); | 63 | clk_disable_unprepare(phy->clk); |
64 | if (ret) | ||
65 | return ret; | ||
66 | 64 | ||
67 | return 0; | 65 | return 0; |
68 | } | 66 | } |
@@ -78,8 +76,10 @@ static int rockchip_usb_phy_power_on(struct phy *_phy) | |||
78 | 76 | ||
79 | /* Power up usb phy analog blocks by set siddq 0 */ | 77 | /* Power up usb phy analog blocks by set siddq 0 */ |
80 | ret = rockchip_usb_phy_power(phy, 0); | 78 | ret = rockchip_usb_phy_power(phy, 0); |
81 | if (ret) | 79 | if (ret) { |
80 | clk_disable_unprepare(phy->clk); | ||
82 | return ret; | 81 | return ret; |
82 | } | ||
83 | 83 | ||
84 | return 0; | 84 | return 0; |
85 | } | 85 | } |
diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c index 95c88f929f27..2ba610b72ca2 100644 --- a/drivers/phy/phy-ti-pipe3.c +++ b/drivers/phy/phy-ti-pipe3.c | |||
@@ -165,15 +165,11 @@ static int ti_pipe3_dpll_wait_lock(struct ti_pipe3 *phy) | |||
165 | cpu_relax(); | 165 | cpu_relax(); |
166 | val = ti_pipe3_readl(phy->pll_ctrl_base, PLL_STATUS); | 166 | val = ti_pipe3_readl(phy->pll_ctrl_base, PLL_STATUS); |
167 | if (val & PLL_LOCK) | 167 | if (val & PLL_LOCK) |
168 | break; | 168 | return 0; |
169 | } while (!time_after(jiffies, timeout)); | 169 | } while (!time_after(jiffies, timeout)); |
170 | 170 | ||
171 | if (!(val & PLL_LOCK)) { | 171 | dev_err(phy->dev, "DPLL failed to lock\n"); |
172 | dev_err(phy->dev, "DPLL failed to lock\n"); | 172 | return -EBUSY; |
173 | return -EBUSY; | ||
174 | } | ||
175 | |||
176 | return 0; | ||
177 | } | 173 | } |
178 | 174 | ||
179 | static int ti_pipe3_dpll_program(struct ti_pipe3 *phy) | 175 | static int ti_pipe3_dpll_program(struct ti_pipe3 *phy) |
@@ -608,7 +604,7 @@ static struct platform_driver ti_pipe3_driver = { | |||
608 | 604 | ||
609 | module_platform_driver(ti_pipe3_driver); | 605 | module_platform_driver(ti_pipe3_driver); |
610 | 606 | ||
611 | MODULE_ALIAS("platform: ti_pipe3"); | 607 | MODULE_ALIAS("platform:ti_pipe3"); |
612 | MODULE_AUTHOR("Texas Instruments Inc."); | 608 | MODULE_AUTHOR("Texas Instruments Inc."); |
613 | MODULE_DESCRIPTION("TI PIPE3 phy driver"); | 609 | MODULE_DESCRIPTION("TI PIPE3 phy driver"); |
614 | MODULE_LICENSE("GPL v2"); | 610 | MODULE_LICENSE("GPL v2"); |
diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c index 8e87f54671f3..bc42d6a8939f 100644 --- a/drivers/phy/phy-twl4030-usb.c +++ b/drivers/phy/phy-twl4030-usb.c | |||
@@ -666,7 +666,6 @@ static int twl4030_usb_probe(struct platform_device *pdev) | |||
666 | twl->dev = &pdev->dev; | 666 | twl->dev = &pdev->dev; |
667 | twl->irq = platform_get_irq(pdev, 0); | 667 | twl->irq = platform_get_irq(pdev, 0); |
668 | twl->vbus_supplied = false; | 668 | twl->vbus_supplied = false; |
669 | twl->linkstat = -EINVAL; | ||
670 | twl->linkstat = OMAP_MUSB_UNKNOWN; | 669 | twl->linkstat = OMAP_MUSB_UNKNOWN; |
671 | 670 | ||
672 | twl->phy.dev = twl->dev; | 671 | twl->phy.dev = twl->dev; |
diff --git a/drivers/phy/phy-xgene.c b/drivers/phy/phy-xgene.c index 29214a36ea28..2263cd010032 100644 --- a/drivers/phy/phy-xgene.c +++ b/drivers/phy/phy-xgene.c | |||
@@ -1704,7 +1704,6 @@ static int xgene_phy_probe(struct platform_device *pdev) | |||
1704 | for (i = 0; i < MAX_LANE; i++) | 1704 | for (i = 0; i < MAX_LANE; i++) |
1705 | ctx->sata_param.speed[i] = 2; /* Default to Gen3 */ | 1705 | ctx->sata_param.speed[i] = 2; /* Default to Gen3 */ |
1706 | 1706 | ||
1707 | ctx->dev = &pdev->dev; | ||
1708 | platform_set_drvdata(pdev, ctx); | 1707 | platform_set_drvdata(pdev, ctx); |
1709 | 1708 | ||
1710 | ctx->phy = devm_phy_create(ctx->dev, NULL, &xgene_phy_ops); | 1709 | ctx->phy = devm_phy_create(ctx->dev, NULL, &xgene_phy_ops); |