diff options
27 files changed, 34 insertions, 110 deletions
diff --git a/drivers/phy/phy-bcm-kona-usb2.c b/drivers/phy/phy-bcm-kona-usb2.c index c1e0ca335c0e..ef2dc1aab2b9 100644 --- a/drivers/phy/phy-bcm-kona-usb2.c +++ b/drivers/phy/phy-bcm-kona-usb2.c | |||
@@ -117,7 +117,7 @@ static int bcm_kona_usb2_probe(struct platform_device *pdev) | |||
117 | 117 | ||
118 | platform_set_drvdata(pdev, phy); | 118 | platform_set_drvdata(pdev, phy); |
119 | 119 | ||
120 | gphy = devm_phy_create(dev, NULL, &ops, NULL); | 120 | gphy = devm_phy_create(dev, NULL, &ops); |
121 | if (IS_ERR(gphy)) | 121 | if (IS_ERR(gphy)) |
122 | return PTR_ERR(gphy); | 122 | return PTR_ERR(gphy); |
123 | 123 | ||
diff --git a/drivers/phy/phy-berlin-sata.c b/drivers/phy/phy-berlin-sata.c index 873e7a890fee..3e599dc96164 100644 --- a/drivers/phy/phy-berlin-sata.c +++ b/drivers/phy/phy-berlin-sata.c | |||
@@ -249,7 +249,7 @@ static int phy_berlin_sata_probe(struct platform_device *pdev) | |||
249 | if (!phy_desc) | 249 | if (!phy_desc) |
250 | return -ENOMEM; | 250 | return -ENOMEM; |
251 | 251 | ||
252 | phy = devm_phy_create(dev, NULL, &phy_berlin_sata_ops, NULL); | 252 | phy = devm_phy_create(dev, NULL, &phy_berlin_sata_ops); |
253 | if (IS_ERR(phy)) { | 253 | if (IS_ERR(phy)) { |
254 | dev_err(dev, "failed to create PHY %d\n", phy_id); | 254 | dev_err(dev, "failed to create PHY %d\n", phy_id); |
255 | return PTR_ERR(phy); | 255 | return PTR_ERR(phy); |
diff --git a/drivers/phy/phy-berlin-usb.c b/drivers/phy/phy-berlin-usb.c index f9f13067f50f..c8a8d53a6ece 100644 --- a/drivers/phy/phy-berlin-usb.c +++ b/drivers/phy/phy-berlin-usb.c | |||
@@ -192,8 +192,7 @@ static int phy_berlin_usb_probe(struct platform_device *pdev) | |||
192 | 192 | ||
193 | priv->pll_divider = *((u32 *)match->data); | 193 | priv->pll_divider = *((u32 *)match->data); |
194 | 194 | ||
195 | priv->phy = devm_phy_create(&pdev->dev, NULL, &phy_berlin_usb_ops, | 195 | priv->phy = devm_phy_create(&pdev->dev, NULL, &phy_berlin_usb_ops); |
196 | NULL); | ||
197 | if (IS_ERR(priv->phy)) { | 196 | if (IS_ERR(priv->phy)) { |
198 | dev_err(&pdev->dev, "failed to create PHY\n"); | 197 | dev_err(&pdev->dev, "failed to create PHY\n"); |
199 | return PTR_ERR(priv->phy); | 198 | return PTR_ERR(priv->phy); |
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index bc830773fe05..a12d35338313 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c | |||
@@ -55,36 +55,6 @@ static int devm_phy_match(struct device *dev, void *res, void *match_data) | |||
55 | return res == match_data; | 55 | return res == match_data; |
56 | } | 56 | } |
57 | 57 | ||
58 | static struct phy *phy_lookup(struct device *device, const char *port) | ||
59 | { | ||
60 | unsigned int count; | ||
61 | struct phy *phy; | ||
62 | struct device *dev; | ||
63 | struct phy_consumer *consumers; | ||
64 | struct class_dev_iter iter; | ||
65 | |||
66 | class_dev_iter_init(&iter, phy_class, NULL, NULL); | ||
67 | while ((dev = class_dev_iter_next(&iter))) { | ||
68 | phy = to_phy(dev); | ||
69 | |||
70 | if (!phy->init_data) | ||
71 | continue; | ||
72 | count = phy->init_data->num_consumers; | ||
73 | consumers = phy->init_data->consumers; | ||
74 | while (count--) { | ||
75 | if (!strcmp(consumers->dev_name, dev_name(device)) && | ||
76 | !strcmp(consumers->port, port)) { | ||
77 | class_dev_iter_exit(&iter); | ||
78 | return phy; | ||
79 | } | ||
80 | consumers++; | ||
81 | } | ||
82 | } | ||
83 | |||
84 | class_dev_iter_exit(&iter); | ||
85 | return ERR_PTR(-ENODEV); | ||
86 | } | ||
87 | |||
88 | /** | 58 | /** |
89 | * phy_create_lookup() - allocate and register PHY/device association | 59 | * phy_create_lookup() - allocate and register PHY/device association |
90 | * @phy: the phy of the association | 60 | * @phy: the phy of the association |
@@ -148,7 +118,6 @@ static struct phy *phy_find(struct device *dev, const char *con_id) | |||
148 | { | 118 | { |
149 | const char *dev_id = dev_name(dev); | 119 | const char *dev_id = dev_name(dev); |
150 | struct phy_lookup *p, *pl = NULL; | 120 | struct phy_lookup *p, *pl = NULL; |
151 | struct phy *phy; | ||
152 | 121 | ||
153 | mutex_lock(&phy_provider_mutex); | 122 | mutex_lock(&phy_provider_mutex); |
154 | list_for_each_entry(p, &phys, node) | 123 | list_for_each_entry(p, &phys, node) |
@@ -158,12 +127,7 @@ static struct phy *phy_find(struct device *dev, const char *con_id) | |||
158 | } | 127 | } |
159 | mutex_unlock(&phy_provider_mutex); | 128 | mutex_unlock(&phy_provider_mutex); |
160 | 129 | ||
161 | phy = pl ? pl->phy : ERR_PTR(-ENODEV); | 130 | return pl ? pl->phy : ERR_PTR(-ENODEV); |
162 | |||
163 | /* fall-back to the old lookup method for now */ | ||
164 | if (IS_ERR(phy)) | ||
165 | phy = phy_lookup(dev, con_id); | ||
166 | return phy; | ||
167 | } | 131 | } |
168 | 132 | ||
169 | static struct phy_provider *of_phy_provider_lookup(struct device_node *node) | 133 | static struct phy_provider *of_phy_provider_lookup(struct device_node *node) |
@@ -662,13 +626,11 @@ EXPORT_SYMBOL_GPL(devm_of_phy_get); | |||
662 | * @dev: device that is creating the new phy | 626 | * @dev: device that is creating the new phy |
663 | * @node: device node of the phy | 627 | * @node: device node of the phy |
664 | * @ops: function pointers for performing phy operations | 628 | * @ops: function pointers for performing phy operations |
665 | * @init_data: contains the list of PHY consumers or NULL | ||
666 | * | 629 | * |
667 | * Called to create a phy using phy framework. | 630 | * Called to create a phy using phy framework. |
668 | */ | 631 | */ |
669 | struct phy *phy_create(struct device *dev, struct device_node *node, | 632 | struct phy *phy_create(struct device *dev, struct device_node *node, |
670 | const struct phy_ops *ops, | 633 | const struct phy_ops *ops) |
671 | struct phy_init_data *init_data) | ||
672 | { | 634 | { |
673 | int ret; | 635 | int ret; |
674 | int id; | 636 | int id; |
@@ -706,7 +668,6 @@ struct phy *phy_create(struct device *dev, struct device_node *node, | |||
706 | phy->dev.of_node = node ?: dev->of_node; | 668 | phy->dev.of_node = node ?: dev->of_node; |
707 | phy->id = id; | 669 | phy->id = id; |
708 | phy->ops = ops; | 670 | phy->ops = ops; |
709 | phy->init_data = init_data; | ||
710 | 671 | ||
711 | ret = dev_set_name(&phy->dev, "phy-%s.%d", dev_name(dev), id); | 672 | ret = dev_set_name(&phy->dev, "phy-%s.%d", dev_name(dev), id); |
712 | if (ret) | 673 | if (ret) |
@@ -741,7 +702,6 @@ EXPORT_SYMBOL_GPL(phy_create); | |||
741 | * @dev: device that is creating the new phy | 702 | * @dev: device that is creating the new phy |
742 | * @node: device node of the phy | 703 | * @node: device node of the phy |
743 | * @ops: function pointers for performing phy operations | 704 | * @ops: function pointers for performing phy operations |
744 | * @init_data: contains the list of PHY consumers or NULL | ||
745 | * | 705 | * |
746 | * Creates a new PHY device adding it to the PHY class. | 706 | * Creates a new PHY device adding it to the PHY class. |
747 | * While at that, it also associates the device with the phy using devres. | 707 | * While at that, it also associates the device with the phy using devres. |
@@ -749,8 +709,7 @@ EXPORT_SYMBOL_GPL(phy_create); | |||
749 | * then, devres data is freed. | 709 | * then, devres data is freed. |
750 | */ | 710 | */ |
751 | struct phy *devm_phy_create(struct device *dev, struct device_node *node, | 711 | struct phy *devm_phy_create(struct device *dev, struct device_node *node, |
752 | const struct phy_ops *ops, | 712 | const struct phy_ops *ops) |
753 | struct phy_init_data *init_data) | ||
754 | { | 713 | { |
755 | struct phy **ptr, *phy; | 714 | struct phy **ptr, *phy; |
756 | 715 | ||
@@ -758,7 +717,7 @@ struct phy *devm_phy_create(struct device *dev, struct device_node *node, | |||
758 | if (!ptr) | 717 | if (!ptr) |
759 | return ERR_PTR(-ENOMEM); | 718 | return ERR_PTR(-ENOMEM); |
760 | 719 | ||
761 | phy = phy_create(dev, node, ops, init_data); | 720 | phy = phy_create(dev, node, ops); |
762 | if (!IS_ERR(phy)) { | 721 | if (!IS_ERR(phy)) { |
763 | *ptr = phy; | 722 | *ptr = phy; |
764 | devres_add(dev, ptr); | 723 | devres_add(dev, ptr); |
diff --git a/drivers/phy/phy-exynos-dp-video.c b/drivers/phy/phy-exynos-dp-video.c index 84f49e5a3f24..f86cbe68ddaf 100644 --- a/drivers/phy/phy-exynos-dp-video.c +++ b/drivers/phy/phy-exynos-dp-video.c | |||
@@ -112,7 +112,7 @@ static int exynos_dp_video_phy_probe(struct platform_device *pdev) | |||
112 | match = of_match_node(exynos_dp_video_phy_of_match, dev->of_node); | 112 | match = of_match_node(exynos_dp_video_phy_of_match, dev->of_node); |
113 | state->drvdata = match->data; | 113 | state->drvdata = match->data; |
114 | 114 | ||
115 | phy = devm_phy_create(dev, NULL, &exynos_dp_video_phy_ops, NULL); | 115 | phy = devm_phy_create(dev, NULL, &exynos_dp_video_phy_ops); |
116 | if (IS_ERR(phy)) { | 116 | if (IS_ERR(phy)) { |
117 | dev_err(dev, "failed to create Display Port PHY\n"); | 117 | dev_err(dev, "failed to create Display Port PHY\n"); |
118 | return PTR_ERR(phy); | 118 | return PTR_ERR(phy); |
diff --git a/drivers/phy/phy-exynos-mipi-video.c b/drivers/phy/phy-exynos-mipi-video.c index 6a9bef138617..943e0f88a120 100644 --- a/drivers/phy/phy-exynos-mipi-video.c +++ b/drivers/phy/phy-exynos-mipi-video.c | |||
@@ -137,7 +137,7 @@ static int exynos_mipi_video_phy_probe(struct platform_device *pdev) | |||
137 | 137 | ||
138 | for (i = 0; i < EXYNOS_MIPI_PHYS_NUM; i++) { | 138 | for (i = 0; i < EXYNOS_MIPI_PHYS_NUM; i++) { |
139 | struct phy *phy = devm_phy_create(dev, NULL, | 139 | struct phy *phy = devm_phy_create(dev, NULL, |
140 | &exynos_mipi_video_phy_ops, NULL); | 140 | &exynos_mipi_video_phy_ops); |
141 | if (IS_ERR(phy)) { | 141 | if (IS_ERR(phy)) { |
142 | dev_err(dev, "failed to create PHY %d\n", i); | 142 | dev_err(dev, "failed to create PHY %d\n", i); |
143 | return PTR_ERR(phy); | 143 | return PTR_ERR(phy); |
diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5-usbdrd.c index f756aca871db..b3ca3bc2314f 100644 --- a/drivers/phy/phy-exynos5-usbdrd.c +++ b/drivers/phy/phy-exynos5-usbdrd.c | |||
@@ -637,8 +637,7 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev) | |||
637 | 637 | ||
638 | for (i = 0; i < EXYNOS5_DRDPHYS_NUM; i++) { | 638 | for (i = 0; i < EXYNOS5_DRDPHYS_NUM; i++) { |
639 | struct phy *phy = devm_phy_create(dev, NULL, | 639 | struct phy *phy = devm_phy_create(dev, NULL, |
640 | &exynos5_usbdrd_phy_ops, | 640 | &exynos5_usbdrd_phy_ops); |
641 | NULL); | ||
642 | if (IS_ERR(phy)) { | 641 | if (IS_ERR(phy)) { |
643 | dev_err(dev, "Failed to create usbdrd_phy phy\n"); | 642 | dev_err(dev, "Failed to create usbdrd_phy phy\n"); |
644 | return PTR_ERR(phy); | 643 | return PTR_ERR(phy); |
diff --git a/drivers/phy/phy-exynos5250-sata.c b/drivers/phy/phy-exynos5250-sata.c index 54cf4ae60d29..bc858cc800a1 100644 --- a/drivers/phy/phy-exynos5250-sata.c +++ b/drivers/phy/phy-exynos5250-sata.c | |||
@@ -210,7 +210,7 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) | |||
210 | return ret; | 210 | return ret; |
211 | } | 211 | } |
212 | 212 | ||
213 | sata_phy->phy = devm_phy_create(dev, NULL, &exynos_sata_phy_ops, NULL); | 213 | sata_phy->phy = devm_phy_create(dev, NULL, &exynos_sata_phy_ops); |
214 | if (IS_ERR(sata_phy->phy)) { | 214 | if (IS_ERR(sata_phy->phy)) { |
215 | clk_disable_unprepare(sata_phy->phyclk); | 215 | clk_disable_unprepare(sata_phy->phyclk); |
216 | dev_err(dev, "failed to create PHY\n"); | 216 | dev_err(dev, "failed to create PHY\n"); |
diff --git a/drivers/phy/phy-hix5hd2-sata.c b/drivers/phy/phy-hix5hd2-sata.c index d5d978085c6d..a80ff9d7fe15 100644 --- a/drivers/phy/phy-hix5hd2-sata.c +++ b/drivers/phy/phy-hix5hd2-sata.c | |||
@@ -156,7 +156,7 @@ static int hix5hd2_sata_phy_probe(struct platform_device *pdev) | |||
156 | if (IS_ERR(priv->peri_ctrl)) | 156 | if (IS_ERR(priv->peri_ctrl)) |
157 | priv->peri_ctrl = NULL; | 157 | priv->peri_ctrl = NULL; |
158 | 158 | ||
159 | phy = devm_phy_create(dev, NULL, &hix5hd2_sata_phy_ops, NULL); | 159 | phy = devm_phy_create(dev, NULL, &hix5hd2_sata_phy_ops); |
160 | if (IS_ERR(phy)) { | 160 | if (IS_ERR(phy)) { |
161 | dev_err(dev, "failed to create PHY\n"); | 161 | dev_err(dev, "failed to create PHY\n"); |
162 | return PTR_ERR(phy); | 162 | return PTR_ERR(phy); |
diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c index 87dcc9ab7f23..e34da13885e8 100644 --- a/drivers/phy/phy-miphy28lp.c +++ b/drivers/phy/phy-miphy28lp.c | |||
@@ -1231,7 +1231,7 @@ static int miphy28lp_probe(struct platform_device *pdev) | |||
1231 | 1231 | ||
1232 | miphy_dev->phys[port] = miphy_phy; | 1232 | miphy_dev->phys[port] = miphy_phy; |
1233 | 1233 | ||
1234 | phy = devm_phy_create(&pdev->dev, child, &miphy28lp_ops, NULL); | 1234 | phy = devm_phy_create(&pdev->dev, child, &miphy28lp_ops); |
1235 | if (IS_ERR(phy)) { | 1235 | if (IS_ERR(phy)) { |
1236 | dev_err(&pdev->dev, "failed to create PHY\n"); | 1236 | dev_err(&pdev->dev, "failed to create PHY\n"); |
1237 | return PTR_ERR(phy); | 1237 | return PTR_ERR(phy); |
diff --git a/drivers/phy/phy-miphy365x.c b/drivers/phy/phy-miphy365x.c index 801afaf2d449..239930edfe1d 100644 --- a/drivers/phy/phy-miphy365x.c +++ b/drivers/phy/phy-miphy365x.c | |||
@@ -593,7 +593,7 @@ static int miphy365x_probe(struct platform_device *pdev) | |||
593 | 593 | ||
594 | miphy_dev->phys[port] = miphy_phy; | 594 | miphy_dev->phys[port] = miphy_phy; |
595 | 595 | ||
596 | phy = devm_phy_create(&pdev->dev, child, &miphy365x_ops, NULL); | 596 | phy = devm_phy_create(&pdev->dev, child, &miphy365x_ops); |
597 | if (IS_ERR(phy)) { | 597 | if (IS_ERR(phy)) { |
598 | dev_err(&pdev->dev, "failed to create PHY\n"); | 598 | dev_err(&pdev->dev, "failed to create PHY\n"); |
599 | return PTR_ERR(phy); | 599 | return PTR_ERR(phy); |
diff --git a/drivers/phy/phy-mvebu-sata.c b/drivers/phy/phy-mvebu-sata.c index d395558cb12e..03b94f92e6f1 100644 --- a/drivers/phy/phy-mvebu-sata.c +++ b/drivers/phy/phy-mvebu-sata.c | |||
@@ -101,7 +101,7 @@ static int phy_mvebu_sata_probe(struct platform_device *pdev) | |||
101 | if (IS_ERR(priv->clk)) | 101 | if (IS_ERR(priv->clk)) |
102 | return PTR_ERR(priv->clk); | 102 | return PTR_ERR(priv->clk); |
103 | 103 | ||
104 | phy = devm_phy_create(&pdev->dev, NULL, &phy_mvebu_sata_ops, NULL); | 104 | phy = devm_phy_create(&pdev->dev, NULL, &phy_mvebu_sata_ops); |
105 | if (IS_ERR(phy)) | 105 | if (IS_ERR(phy)) |
106 | return PTR_ERR(phy); | 106 | return PTR_ERR(phy); |
107 | 107 | ||
diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c index f091576b6449..5dab3ec71a19 100644 --- a/drivers/phy/phy-omap-usb2.c +++ b/drivers/phy/phy-omap-usb2.c | |||
@@ -260,7 +260,7 @@ static int omap_usb2_probe(struct platform_device *pdev) | |||
260 | platform_set_drvdata(pdev, phy); | 260 | platform_set_drvdata(pdev, phy); |
261 | pm_runtime_enable(phy->dev); | 261 | pm_runtime_enable(phy->dev); |
262 | 262 | ||
263 | generic_phy = devm_phy_create(phy->dev, NULL, &ops, NULL); | 263 | generic_phy = devm_phy_create(phy->dev, NULL, &ops); |
264 | if (IS_ERR(generic_phy)) { | 264 | if (IS_ERR(generic_phy)) { |
265 | pm_runtime_disable(phy->dev); | 265 | pm_runtime_disable(phy->dev); |
266 | return PTR_ERR(generic_phy); | 266 | return PTR_ERR(generic_phy); |
diff --git a/drivers/phy/phy-qcom-apq8064-sata.c b/drivers/phy/phy-qcom-apq8064-sata.c index 7b3ddfb65898..4b243f7a10e4 100644 --- a/drivers/phy/phy-qcom-apq8064-sata.c +++ b/drivers/phy/phy-qcom-apq8064-sata.c | |||
@@ -228,8 +228,7 @@ static int qcom_apq8064_sata_phy_probe(struct platform_device *pdev) | |||
228 | if (IS_ERR(phy->mmio)) | 228 | if (IS_ERR(phy->mmio)) |
229 | return PTR_ERR(phy->mmio); | 229 | return PTR_ERR(phy->mmio); |
230 | 230 | ||
231 | generic_phy = devm_phy_create(dev, NULL, &qcom_apq8064_sata_phy_ops, | 231 | generic_phy = devm_phy_create(dev, NULL, &qcom_apq8064_sata_phy_ops); |
232 | NULL); | ||
233 | if (IS_ERR(generic_phy)) { | 232 | if (IS_ERR(generic_phy)) { |
234 | dev_err(dev, "%s: failed to create phy\n", __func__); | 233 | dev_err(dev, "%s: failed to create phy\n", __func__); |
235 | return PTR_ERR(generic_phy); | 234 | return PTR_ERR(generic_phy); |
diff --git a/drivers/phy/phy-qcom-ipq806x-sata.c b/drivers/phy/phy-qcom-ipq806x-sata.c index 759b0bf5b6b3..6f2fe2627916 100644 --- a/drivers/phy/phy-qcom-ipq806x-sata.c +++ b/drivers/phy/phy-qcom-ipq806x-sata.c | |||
@@ -150,8 +150,7 @@ static int qcom_ipq806x_sata_phy_probe(struct platform_device *pdev) | |||
150 | if (IS_ERR(phy->mmio)) | 150 | if (IS_ERR(phy->mmio)) |
151 | return PTR_ERR(phy->mmio); | 151 | return PTR_ERR(phy->mmio); |
152 | 152 | ||
153 | generic_phy = devm_phy_create(dev, NULL, &qcom_ipq806x_sata_phy_ops, | 153 | generic_phy = devm_phy_create(dev, NULL, &qcom_ipq806x_sata_phy_ops); |
154 | NULL); | ||
155 | if (IS_ERR(generic_phy)) { | 154 | if (IS_ERR(generic_phy)) { |
156 | dev_err(dev, "%s: failed to create phy\n", __func__); | 155 | dev_err(dev, "%s: failed to create phy\n", __func__); |
157 | return PTR_ERR(generic_phy); | 156 | return PTR_ERR(generic_phy); |
diff --git a/drivers/phy/phy-rcar-gen2.c b/drivers/phy/phy-rcar-gen2.c index 2793af17799f..778276aba3aa 100644 --- a/drivers/phy/phy-rcar-gen2.c +++ b/drivers/phy/phy-rcar-gen2.c | |||
@@ -304,7 +304,7 @@ static int rcar_gen2_phy_probe(struct platform_device *pdev) | |||
304 | phy->select_value = select_value[channel_num][n]; | 304 | phy->select_value = select_value[channel_num][n]; |
305 | 305 | ||
306 | phy->phy = devm_phy_create(dev, NULL, | 306 | phy->phy = devm_phy_create(dev, NULL, |
307 | &rcar_gen2_phy_ops, NULL); | 307 | &rcar_gen2_phy_ops); |
308 | if (IS_ERR(phy->phy)) { | 308 | if (IS_ERR(phy->phy)) { |
309 | dev_err(dev, "Failed to create PHY\n"); | 309 | dev_err(dev, "Failed to create PHY\n"); |
310 | return PTR_ERR(phy->phy); | 310 | return PTR_ERR(phy->phy); |
diff --git a/drivers/phy/phy-samsung-usb2.c b/drivers/phy/phy-samsung-usb2.c index 908949dfb4db..4a12f66b7fb5 100644 --- a/drivers/phy/phy-samsung-usb2.c +++ b/drivers/phy/phy-samsung-usb2.c | |||
@@ -202,8 +202,7 @@ static int samsung_usb2_phy_probe(struct platform_device *pdev) | |||
202 | struct samsung_usb2_phy_instance *p = &drv->instances[i]; | 202 | struct samsung_usb2_phy_instance *p = &drv->instances[i]; |
203 | 203 | ||
204 | dev_dbg(dev, "Creating phy \"%s\"\n", label); | 204 | dev_dbg(dev, "Creating phy \"%s\"\n", label); |
205 | p->phy = devm_phy_create(dev, NULL, &samsung_usb2_phy_ops, | 205 | p->phy = devm_phy_create(dev, NULL, &samsung_usb2_phy_ops); |
206 | NULL); | ||
207 | if (IS_ERR(p->phy)) { | 206 | if (IS_ERR(p->phy)) { |
208 | dev_err(drv->dev, "Failed to create usb2_phy \"%s\"\n", | 207 | dev_err(drv->dev, "Failed to create usb2_phy \"%s\"\n", |
209 | label); | 208 | label); |
diff --git a/drivers/phy/phy-spear1310-miphy.c b/drivers/phy/phy-spear1310-miphy.c index 5f4c586ee951..9f47fae7eecb 100644 --- a/drivers/phy/phy-spear1310-miphy.c +++ b/drivers/phy/phy-spear1310-miphy.c | |||
@@ -227,7 +227,7 @@ static int spear1310_miphy_probe(struct platform_device *pdev) | |||
227 | return -EINVAL; | 227 | return -EINVAL; |
228 | } | 228 | } |
229 | 229 | ||
230 | priv->phy = devm_phy_create(dev, NULL, &spear1310_miphy_ops, NULL); | 230 | priv->phy = devm_phy_create(dev, NULL, &spear1310_miphy_ops); |
231 | if (IS_ERR(priv->phy)) { | 231 | if (IS_ERR(priv->phy)) { |
232 | dev_err(dev, "failed to create SATA PCIe PHY\n"); | 232 | dev_err(dev, "failed to create SATA PCIe PHY\n"); |
233 | return PTR_ERR(priv->phy); | 233 | return PTR_ERR(priv->phy); |
diff --git a/drivers/phy/phy-spear1340-miphy.c b/drivers/phy/phy-spear1340-miphy.c index 1ecd0945bad3..e42bc200275f 100644 --- a/drivers/phy/phy-spear1340-miphy.c +++ b/drivers/phy/phy-spear1340-miphy.c | |||
@@ -259,7 +259,7 @@ static int spear1340_miphy_probe(struct platform_device *pdev) | |||
259 | return PTR_ERR(priv->misc); | 259 | return PTR_ERR(priv->misc); |
260 | } | 260 | } |
261 | 261 | ||
262 | priv->phy = devm_phy_create(dev, NULL, &spear1340_miphy_ops, NULL); | 262 | priv->phy = devm_phy_create(dev, NULL, &spear1340_miphy_ops); |
263 | if (IS_ERR(priv->phy)) { | 263 | if (IS_ERR(priv->phy)) { |
264 | dev_err(dev, "failed to create SATA PCIe PHY\n"); | 264 | dev_err(dev, "failed to create SATA PCIe PHY\n"); |
265 | return PTR_ERR(priv->phy); | 265 | return PTR_ERR(priv->phy); |
diff --git a/drivers/phy/phy-stih407-usb.c b/drivers/phy/phy-stih407-usb.c index 42428d4181ea..74f0fab3cd8a 100644 --- a/drivers/phy/phy-stih407-usb.c +++ b/drivers/phy/phy-stih407-usb.c | |||
@@ -137,7 +137,7 @@ static int stih407_usb2_picophy_probe(struct platform_device *pdev) | |||
137 | } | 137 | } |
138 | phy_dev->param = res->start; | 138 | phy_dev->param = res->start; |
139 | 139 | ||
140 | phy = devm_phy_create(dev, NULL, &stih407_usb2_picophy_data, NULL); | 140 | phy = devm_phy_create(dev, NULL, &stih407_usb2_picophy_data); |
141 | if (IS_ERR(phy)) { | 141 | if (IS_ERR(phy)) { |
142 | dev_err(dev, "failed to create Display Port PHY\n"); | 142 | dev_err(dev, "failed to create Display Port PHY\n"); |
143 | return PTR_ERR(phy); | 143 | return PTR_ERR(phy); |
diff --git a/drivers/phy/phy-stih41x-usb.c b/drivers/phy/phy-stih41x-usb.c index 9f16cb8e01f4..4ab581eadacf 100644 --- a/drivers/phy/phy-stih41x-usb.c +++ b/drivers/phy/phy-stih41x-usb.c | |||
@@ -148,7 +148,7 @@ static int stih41x_usb_phy_probe(struct platform_device *pdev) | |||
148 | return PTR_ERR(phy_dev->clk); | 148 | return PTR_ERR(phy_dev->clk); |
149 | } | 149 | } |
150 | 150 | ||
151 | phy = devm_phy_create(dev, NULL, &stih41x_usb_phy_ops, NULL); | 151 | phy = devm_phy_create(dev, NULL, &stih41x_usb_phy_ops); |
152 | 152 | ||
153 | if (IS_ERR(phy)) { | 153 | if (IS_ERR(phy)) { |
154 | dev_err(dev, "failed to create phy\n"); | 154 | dev_err(dev, "failed to create phy\n"); |
diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c index 6bd2b0c972cc..fb02a67c9181 100644 --- a/drivers/phy/phy-sun4i-usb.c +++ b/drivers/phy/phy-sun4i-usb.c | |||
@@ -298,7 +298,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev) | |||
298 | return PTR_ERR(phy->pmu); | 298 | return PTR_ERR(phy->pmu); |
299 | } | 299 | } |
300 | 300 | ||
301 | phy->phy = devm_phy_create(dev, NULL, &sun4i_usb_phy_ops, NULL); | 301 | phy->phy = devm_phy_create(dev, NULL, &sun4i_usb_phy_ops); |
302 | if (IS_ERR(phy->phy)) { | 302 | if (IS_ERR(phy->phy)) { |
303 | dev_err(dev, "failed to create PHY %d\n", i); | 303 | dev_err(dev, "failed to create PHY %d\n", i); |
304 | return PTR_ERR(phy->phy); | 304 | return PTR_ERR(phy->phy); |
diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c index ab1e22d9a1e8..c297b7a10d30 100644 --- a/drivers/phy/phy-ti-pipe3.c +++ b/drivers/phy/phy-ti-pipe3.c | |||
@@ -399,7 +399,7 @@ static int ti_pipe3_probe(struct platform_device *pdev) | |||
399 | platform_set_drvdata(pdev, phy); | 399 | platform_set_drvdata(pdev, phy); |
400 | pm_runtime_enable(phy->dev); | 400 | pm_runtime_enable(phy->dev); |
401 | 401 | ||
402 | generic_phy = devm_phy_create(phy->dev, NULL, &ops, NULL); | 402 | generic_phy = devm_phy_create(phy->dev, NULL, &ops); |
403 | if (IS_ERR(generic_phy)) | 403 | if (IS_ERR(generic_phy)) |
404 | return PTR_ERR(generic_phy); | 404 | return PTR_ERR(generic_phy); |
405 | 405 | ||
diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c index c45a3aa4f2cc..d19e4a06b858 100644 --- a/drivers/phy/phy-twl4030-usb.c +++ b/drivers/phy/phy-twl4030-usb.c | |||
@@ -678,7 +678,7 @@ static int twl4030_usb_probe(struct platform_device *pdev) | |||
678 | otg->set_host = twl4030_set_host; | 678 | otg->set_host = twl4030_set_host; |
679 | otg->set_peripheral = twl4030_set_peripheral; | 679 | otg->set_peripheral = twl4030_set_peripheral; |
680 | 680 | ||
681 | phy = devm_phy_create(twl->dev, NULL, &ops, NULL); | 681 | phy = devm_phy_create(twl->dev, NULL, &ops); |
682 | if (IS_ERR(phy)) { | 682 | if (IS_ERR(phy)) { |
683 | dev_dbg(&pdev->dev, "Failed to create PHY\n"); | 683 | dev_dbg(&pdev->dev, "Failed to create PHY\n"); |
684 | return PTR_ERR(phy); | 684 | return PTR_ERR(phy); |
diff --git a/drivers/phy/phy-xgene.c b/drivers/phy/phy-xgene.c index f8a51b16ade8..29214a36ea28 100644 --- a/drivers/phy/phy-xgene.c +++ b/drivers/phy/phy-xgene.c | |||
@@ -1707,7 +1707,7 @@ static int xgene_phy_probe(struct platform_device *pdev) | |||
1707 | ctx->dev = &pdev->dev; | 1707 | ctx->dev = &pdev->dev; |
1708 | platform_set_drvdata(pdev, ctx); | 1708 | platform_set_drvdata(pdev, ctx); |
1709 | 1709 | ||
1710 | ctx->phy = devm_phy_create(ctx->dev, NULL, &xgene_phy_ops, NULL); | 1710 | ctx->phy = devm_phy_create(ctx->dev, NULL, &xgene_phy_ops); |
1711 | if (IS_ERR(ctx->phy)) { | 1711 | if (IS_ERR(ctx->phy)) { |
1712 | dev_dbg(&pdev->dev, "Failed to create PHY\n"); | 1712 | dev_dbg(&pdev->dev, "Failed to create PHY\n"); |
1713 | rc = PTR_ERR(ctx->phy); | 1713 | rc = PTR_ERR(ctx->phy); |
diff --git a/drivers/pinctrl/pinctrl-tegra-xusb.c b/drivers/pinctrl/pinctrl-tegra-xusb.c index 1631ec94fb02..a84299b922c8 100644 --- a/drivers/pinctrl/pinctrl-tegra-xusb.c +++ b/drivers/pinctrl/pinctrl-tegra-xusb.c | |||
@@ -910,7 +910,7 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev) | |||
910 | goto reset; | 910 | goto reset; |
911 | } | 911 | } |
912 | 912 | ||
913 | phy = devm_phy_create(&pdev->dev, NULL, &pcie_phy_ops, NULL); | 913 | phy = devm_phy_create(&pdev->dev, NULL, &pcie_phy_ops); |
914 | if (IS_ERR(phy)) { | 914 | if (IS_ERR(phy)) { |
915 | err = PTR_ERR(phy); | 915 | err = PTR_ERR(phy); |
916 | goto unregister; | 916 | goto unregister; |
@@ -919,7 +919,7 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev) | |||
919 | padctl->phys[TEGRA_XUSB_PADCTL_PCIE] = phy; | 919 | padctl->phys[TEGRA_XUSB_PADCTL_PCIE] = phy; |
920 | phy_set_drvdata(phy, padctl); | 920 | phy_set_drvdata(phy, padctl); |
921 | 921 | ||
922 | phy = devm_phy_create(&pdev->dev, NULL, &sata_phy_ops, NULL); | 922 | phy = devm_phy_create(&pdev->dev, NULL, &sata_phy_ops); |
923 | if (IS_ERR(phy)) { | 923 | if (IS_ERR(phy)) { |
924 | err = PTR_ERR(phy); | 924 | err = PTR_ERR(phy); |
925 | goto unregister; | 925 | goto unregister; |
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 849284e5873f..a0197fa1b116 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h | |||
@@ -61,7 +61,6 @@ struct phy { | |||
61 | struct device dev; | 61 | struct device dev; |
62 | int id; | 62 | int id; |
63 | const struct phy_ops *ops; | 63 | const struct phy_ops *ops; |
64 | struct phy_init_data *init_data; | ||
65 | struct mutex mutex; | 64 | struct mutex mutex; |
66 | int init_count; | 65 | int init_count; |
67 | int power_count; | 66 | int power_count; |
@@ -84,32 +83,6 @@ struct phy_provider { | |||
84 | struct of_phandle_args *args); | 83 | struct of_phandle_args *args); |
85 | }; | 84 | }; |
86 | 85 | ||
87 | /** | ||
88 | * struct phy_consumer - represents the phy consumer | ||
89 | * @dev_name: the device name of the controller that will use this PHY device | ||
90 | * @port: name given to the consumer port | ||
91 | */ | ||
92 | struct phy_consumer { | ||
93 | const char *dev_name; | ||
94 | const char *port; | ||
95 | }; | ||
96 | |||
97 | /** | ||
98 | * struct phy_init_data - contains the list of PHY consumers | ||
99 | * @num_consumers: number of consumers for this PHY device | ||
100 | * @consumers: list of PHY consumers | ||
101 | */ | ||
102 | struct phy_init_data { | ||
103 | unsigned int num_consumers; | ||
104 | struct phy_consumer *consumers; | ||
105 | }; | ||
106 | |||
107 | #define PHY_CONSUMER(_dev_name, _port) \ | ||
108 | { \ | ||
109 | .dev_name = _dev_name, \ | ||
110 | .port = _port, \ | ||
111 | } | ||
112 | |||
113 | struct phy_lookup { | 86 | struct phy_lookup { |
114 | struct list_head node; | 87 | struct list_head node; |
115 | const char *dev_id; | 88 | const char *dev_id; |
@@ -166,10 +139,9 @@ struct phy *of_phy_get(struct device_node *np, const char *con_id); | |||
166 | struct phy *of_phy_simple_xlate(struct device *dev, | 139 | struct phy *of_phy_simple_xlate(struct device *dev, |
167 | struct of_phandle_args *args); | 140 | struct of_phandle_args *args); |
168 | struct phy *phy_create(struct device *dev, struct device_node *node, | 141 | struct phy *phy_create(struct device *dev, struct device_node *node, |
169 | const struct phy_ops *ops, | 142 | const struct phy_ops *ops); |
170 | struct phy_init_data *init_data); | ||
171 | struct phy *devm_phy_create(struct device *dev, struct device_node *node, | 143 | struct phy *devm_phy_create(struct device *dev, struct device_node *node, |
172 | const struct phy_ops *ops, struct phy_init_data *init_data); | 144 | const struct phy_ops *ops); |
173 | void phy_destroy(struct phy *phy); | 145 | void phy_destroy(struct phy *phy); |
174 | void devm_phy_destroy(struct device *dev, struct phy *phy); | 146 | void devm_phy_destroy(struct device *dev, struct phy *phy); |
175 | struct phy_provider *__of_phy_provider_register(struct device *dev, | 147 | struct phy_provider *__of_phy_provider_register(struct device *dev, |
@@ -310,16 +282,14 @@ static inline struct phy *of_phy_simple_xlate(struct device *dev, | |||
310 | 282 | ||
311 | static inline struct phy *phy_create(struct device *dev, | 283 | static inline struct phy *phy_create(struct device *dev, |
312 | struct device_node *node, | 284 | struct device_node *node, |
313 | const struct phy_ops *ops, | 285 | const struct phy_ops *ops) |
314 | struct phy_init_data *init_data) | ||
315 | { | 286 | { |
316 | return ERR_PTR(-ENOSYS); | 287 | return ERR_PTR(-ENOSYS); |
317 | } | 288 | } |
318 | 289 | ||
319 | static inline struct phy *devm_phy_create(struct device *dev, | 290 | static inline struct phy *devm_phy_create(struct device *dev, |
320 | struct device_node *node, | 291 | struct device_node *node, |
321 | const struct phy_ops *ops, | 292 | const struct phy_ops *ops) |
322 | struct phy_init_data *init_data) | ||
323 | { | 293 | { |
324 | return ERR_PTR(-ENOSYS); | 294 | return ERR_PTR(-ENOSYS); |
325 | } | 295 | } |