Skip to content

Commit a76c22e

Browse files
committed
Merge branch 'mdio-platform-remove-void'
Uwe Kleine-König says: ==================== net: mdio: Convert to platform remove callback returning void this series convert all platform drivers below drivers/net/mdio to use remove_new. The motivation is to get rid of an integer return code that is (mostly) ignored by the platform driver core and error prone on the driver side. See commit 5c5a768 ("platform: Provide a remove callback that returns no value") for an extended explanation and the eventual goal. There are no interdependencies between the patches. As there are still quite a few drivers to convert, I'm happy about every patch that makes it in. So even if there is a merge conflict with one patch until you apply, please apply the remainder of this series anyhow. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents ad1e15d + 032ca4f commit a76c22e

19 files changed

Lines changed: 38 additions & 75 deletions

drivers/net/mdio/mdio-aspeed.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,13 @@ static int aspeed_mdio_probe(struct platform_device *pdev)
177177
return 0;
178178
}
179179

180-
static int aspeed_mdio_remove(struct platform_device *pdev)
180+
static void aspeed_mdio_remove(struct platform_device *pdev)
181181
{
182182
struct mii_bus *bus = (struct mii_bus *)platform_get_drvdata(pdev);
183183
struct aspeed_mdio *ctx = bus->priv;
184184

185185
reset_control_assert(ctx->reset);
186186
mdiobus_unregister(bus);
187-
188-
return 0;
189187
}
190188

191189
static const struct of_device_id aspeed_mdio_of_match[] = {
@@ -200,7 +198,7 @@ static struct platform_driver aspeed_mdio_driver = {
200198
.of_match_table = aspeed_mdio_of_match,
201199
},
202200
.probe = aspeed_mdio_probe,
203-
.remove = aspeed_mdio_remove,
201+
.remove_new = aspeed_mdio_remove,
204202
};
205203

206204
module_platform_driver(aspeed_mdio_driver);

drivers/net/mdio/mdio-bcm-iproc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,12 @@ static int iproc_mdio_probe(struct platform_device *pdev)
168168
return rc;
169169
}
170170

171-
static int iproc_mdio_remove(struct platform_device *pdev)
171+
static void iproc_mdio_remove(struct platform_device *pdev)
172172
{
173173
struct iproc_mdio_priv *priv = platform_get_drvdata(pdev);
174174

175175
mdiobus_unregister(priv->mii_bus);
176176
mdiobus_free(priv->mii_bus);
177-
178-
return 0;
179177
}
180178

181179
#ifdef CONFIG_PM_SLEEP
@@ -210,7 +208,7 @@ static struct platform_driver iproc_mdio_driver = {
210208
#endif
211209
},
212210
.probe = iproc_mdio_probe,
213-
.remove = iproc_mdio_remove,
211+
.remove_new = iproc_mdio_remove,
214212
};
215213

216214
module_platform_driver(iproc_mdio_driver);

drivers/net/mdio/mdio-bcm-unimac.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,13 @@ static int unimac_mdio_probe(struct platform_device *pdev)
296296
return ret;
297297
}
298298

299-
static int unimac_mdio_remove(struct platform_device *pdev)
299+
static void unimac_mdio_remove(struct platform_device *pdev)
300300
{
301301
struct unimac_mdio_priv *priv = platform_get_drvdata(pdev);
302302

303303
mdiobus_unregister(priv->mii_bus);
304304
mdiobus_free(priv->mii_bus);
305305
clk_disable_unprepare(priv->clk);
306-
307-
return 0;
308306
}
309307

310308
static int __maybe_unused unimac_mdio_suspend(struct device *d)
@@ -353,7 +351,7 @@ static struct platform_driver unimac_mdio_driver = {
353351
.pm = &unimac_mdio_pm_ops,
354352
},
355353
.probe = unimac_mdio_probe,
356-
.remove = unimac_mdio_remove,
354+
.remove_new = unimac_mdio_remove,
357355
};
358356
module_platform_driver(unimac_mdio_driver);
359357

drivers/net/mdio/mdio-gpio.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,9 @@ static int mdio_gpio_probe(struct platform_device *pdev)
194194
return ret;
195195
}
196196

197-
static int mdio_gpio_remove(struct platform_device *pdev)
197+
static void mdio_gpio_remove(struct platform_device *pdev)
198198
{
199199
mdio_gpio_bus_destroy(&pdev->dev);
200-
201-
return 0;
202200
}
203201

204202
static const struct of_device_id mdio_gpio_of_match[] = {
@@ -210,7 +208,7 @@ MODULE_DEVICE_TABLE(of, mdio_gpio_of_match);
210208

211209
static struct platform_driver mdio_gpio_driver = {
212210
.probe = mdio_gpio_probe,
213-
.remove = mdio_gpio_remove,
211+
.remove_new = mdio_gpio_remove,
214212
.driver = {
215213
.name = "mdio-gpio",
216214
.of_match_table = mdio_gpio_of_match,

drivers/net/mdio/mdio-hisi-femac.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,14 @@ static int hisi_femac_mdio_probe(struct platform_device *pdev)
118118
return ret;
119119
}
120120

121-
static int hisi_femac_mdio_remove(struct platform_device *pdev)
121+
static void hisi_femac_mdio_remove(struct platform_device *pdev)
122122
{
123123
struct mii_bus *bus = platform_get_drvdata(pdev);
124124
struct hisi_femac_mdio_data *data = bus->priv;
125125

126126
mdiobus_unregister(bus);
127127
clk_disable_unprepare(data->clk);
128128
mdiobus_free(bus);
129-
130-
return 0;
131129
}
132130

133131
static const struct of_device_id hisi_femac_mdio_dt_ids[] = {
@@ -138,7 +136,7 @@ MODULE_DEVICE_TABLE(of, hisi_femac_mdio_dt_ids);
138136

139137
static struct platform_driver hisi_femac_mdio_driver = {
140138
.probe = hisi_femac_mdio_probe,
141-
.remove = hisi_femac_mdio_remove,
139+
.remove_new = hisi_femac_mdio_remove,
142140
.driver = {
143141
.name = "hisi-femac-mdio",
144142
.of_match_table = hisi_femac_mdio_dt_ids,

drivers/net/mdio/mdio-ipq4019.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,11 @@ static int ipq4019_mdio_probe(struct platform_device *pdev)
278278
return 0;
279279
}
280280

281-
static int ipq4019_mdio_remove(struct platform_device *pdev)
281+
static void ipq4019_mdio_remove(struct platform_device *pdev)
282282
{
283283
struct mii_bus *bus = platform_get_drvdata(pdev);
284284

285285
mdiobus_unregister(bus);
286-
287-
return 0;
288286
}
289287

290288
static const struct of_device_id ipq4019_mdio_dt_ids[] = {
@@ -296,7 +294,7 @@ MODULE_DEVICE_TABLE(of, ipq4019_mdio_dt_ids);
296294

297295
static struct platform_driver ipq4019_mdio_driver = {
298296
.probe = ipq4019_mdio_probe,
299-
.remove = ipq4019_mdio_remove,
297+
.remove_new = ipq4019_mdio_remove,
300298
.driver = {
301299
.name = "ipq4019-mdio",
302300
.of_match_table = ipq4019_mdio_dt_ids,

drivers/net/mdio/mdio-ipq8064.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,11 @@ ipq8064_mdio_probe(struct platform_device *pdev)
147147
return 0;
148148
}
149149

150-
static int
151-
ipq8064_mdio_remove(struct platform_device *pdev)
150+
static void ipq8064_mdio_remove(struct platform_device *pdev)
152151
{
153152
struct mii_bus *bus = platform_get_drvdata(pdev);
154153

155154
mdiobus_unregister(bus);
156-
157-
return 0;
158155
}
159156

160157
static const struct of_device_id ipq8064_mdio_dt_ids[] = {
@@ -165,7 +162,7 @@ MODULE_DEVICE_TABLE(of, ipq8064_mdio_dt_ids);
165162

166163
static struct platform_driver ipq8064_mdio_driver = {
167164
.probe = ipq8064_mdio_probe,
168-
.remove = ipq8064_mdio_remove,
165+
.remove_new = ipq8064_mdio_remove,
169166
.driver = {
170167
.name = "ipq8064-mdio",
171168
.of_match_table = ipq8064_mdio_dt_ids,

drivers/net/mdio/mdio-moxart.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,12 @@ static int moxart_mdio_probe(struct platform_device *pdev)
155155
return ret;
156156
}
157157

158-
static int moxart_mdio_remove(struct platform_device *pdev)
158+
static void moxart_mdio_remove(struct platform_device *pdev)
159159
{
160160
struct mii_bus *bus = platform_get_drvdata(pdev);
161161

162162
mdiobus_unregister(bus);
163163
mdiobus_free(bus);
164-
165-
return 0;
166164
}
167165

168166
static const struct of_device_id moxart_mdio_dt_ids[] = {
@@ -173,7 +171,7 @@ MODULE_DEVICE_TABLE(of, moxart_mdio_dt_ids);
173171

174172
static struct platform_driver moxart_mdio_driver = {
175173
.probe = moxart_mdio_probe,
176-
.remove = moxart_mdio_remove,
174+
.remove_new = moxart_mdio_remove,
177175
.driver = {
178176
.name = "moxart-mdio",
179177
.of_match_table = moxart_mdio_dt_ids,

drivers/net/mdio/mdio-mscc-miim.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,13 @@ static int mscc_miim_probe(struct platform_device *pdev)
335335
return ret;
336336
}
337337

338-
static int mscc_miim_remove(struct platform_device *pdev)
338+
static void mscc_miim_remove(struct platform_device *pdev)
339339
{
340340
struct mii_bus *bus = platform_get_drvdata(pdev);
341341
struct mscc_miim_dev *miim = bus->priv;
342342

343343
clk_disable_unprepare(miim->clk);
344344
mdiobus_unregister(bus);
345-
346-
return 0;
347345
}
348346

349347
static const struct mscc_miim_info mscc_ocelot_miim_info = {
@@ -371,7 +369,7 @@ MODULE_DEVICE_TABLE(of, mscc_miim_match);
371369

372370
static struct platform_driver mscc_miim_driver = {
373371
.probe = mscc_miim_probe,
374-
.remove = mscc_miim_remove,
372+
.remove_new = mscc_miim_remove,
375373
.driver = {
376374
.name = "mscc-miim",
377375
.of_match_table = mscc_miim_match,

drivers/net/mdio/mdio-mux-bcm-iproc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,13 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev)
287287
return rc;
288288
}
289289

290-
static int mdio_mux_iproc_remove(struct platform_device *pdev)
290+
static void mdio_mux_iproc_remove(struct platform_device *pdev)
291291
{
292292
struct iproc_mdiomux_desc *md = platform_get_drvdata(pdev);
293293

294294
mdio_mux_uninit(md->mux_handle);
295295
mdiobus_unregister(md->mii_bus);
296296
clk_disable_unprepare(md->core_clk);
297-
298-
return 0;
299297
}
300298

301299
#ifdef CONFIG_PM_SLEEP
@@ -342,7 +340,7 @@ static struct platform_driver mdiomux_iproc_driver = {
342340
.pm = &mdio_mux_iproc_pm_ops,
343341
},
344342
.probe = mdio_mux_iproc_probe,
345-
.remove = mdio_mux_iproc_remove,
343+
.remove_new = mdio_mux_iproc_remove,
346344
};
347345

348346
module_platform_driver(mdiomux_iproc_driver);

0 commit comments

Comments
 (0)