Commit 2a3e1636 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde

Merge patch series "can: Convert to platform remove callback returning void"

Uwe Kleine-König <u.kleine-koenig@pengutronix.de> says:

this series converts the drivers below drivers/net/can to the
.remove_new() callback of struct platform_driver(). The motivation is to
make the remove callback less prone for errors and wrong assumptions.
See commit 5c5a7680 ("platform: Provide a remove callback that
returns no value") for a more detailed rationale.

All drivers already returned zero unconditionally in their
.remove() callback, so converting them to .remove_new() is trivial.

Link: https://lore.kernel.org/r/20230512212725.143824-1-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parents 6882011e 0816e1dd
...@@ -1346,7 +1346,7 @@ static int at91_can_probe(struct platform_device *pdev) ...@@ -1346,7 +1346,7 @@ static int at91_can_probe(struct platform_device *pdev)
return err; return err;
} }
static int at91_can_remove(struct platform_device *pdev) static void at91_can_remove(struct platform_device *pdev)
{ {
struct net_device *dev = platform_get_drvdata(pdev); struct net_device *dev = platform_get_drvdata(pdev);
struct at91_priv *priv = netdev_priv(dev); struct at91_priv *priv = netdev_priv(dev);
...@@ -1362,8 +1362,6 @@ static int at91_can_remove(struct platform_device *pdev) ...@@ -1362,8 +1362,6 @@ static int at91_can_remove(struct platform_device *pdev)
clk_put(priv->clk); clk_put(priv->clk);
free_candev(dev); free_candev(dev);
return 0;
} }
static const struct platform_device_id at91_can_id_table[] = { static const struct platform_device_id at91_can_id_table[] = {
...@@ -1381,7 +1379,7 @@ MODULE_DEVICE_TABLE(platform, at91_can_id_table); ...@@ -1381,7 +1379,7 @@ MODULE_DEVICE_TABLE(platform, at91_can_id_table);
static struct platform_driver at91_can_driver = { static struct platform_driver at91_can_driver = {
.probe = at91_can_probe, .probe = at91_can_probe,
.remove = at91_can_remove, .remove_new = at91_can_remove,
.driver = { .driver = {
.name = KBUILD_MODNAME, .name = KBUILD_MODNAME,
.of_match_table = of_match_ptr(at91_can_dt_ids), .of_match_table = of_match_ptr(at91_can_dt_ids),
......
...@@ -1021,7 +1021,7 @@ static int bxcan_probe(struct platform_device *pdev) ...@@ -1021,7 +1021,7 @@ static int bxcan_probe(struct platform_device *pdev)
return err; return err;
} }
static int bxcan_remove(struct platform_device *pdev) static void bxcan_remove(struct platform_device *pdev)
{ {
struct net_device *ndev = platform_get_drvdata(pdev); struct net_device *ndev = platform_get_drvdata(pdev);
struct bxcan_priv *priv = netdev_priv(ndev); struct bxcan_priv *priv = netdev_priv(ndev);
...@@ -1030,7 +1030,6 @@ static int bxcan_remove(struct platform_device *pdev) ...@@ -1030,7 +1030,6 @@ static int bxcan_remove(struct platform_device *pdev)
clk_disable_unprepare(priv->clk); clk_disable_unprepare(priv->clk);
can_rx_offload_del(&priv->offload); can_rx_offload_del(&priv->offload);
free_candev(ndev); free_candev(ndev);
return 0;
} }
static int __maybe_unused bxcan_suspend(struct device *dev) static int __maybe_unused bxcan_suspend(struct device *dev)
...@@ -1082,7 +1081,7 @@ static struct platform_driver bxcan_driver = { ...@@ -1082,7 +1081,7 @@ static struct platform_driver bxcan_driver = {
.of_match_table = bxcan_of_match, .of_match_table = bxcan_of_match,
}, },
.probe = bxcan_probe, .probe = bxcan_probe,
.remove = bxcan_remove, .remove_new = bxcan_remove,
}; };
module_platform_driver(bxcan_driver); module_platform_driver(bxcan_driver);
......
...@@ -410,7 +410,7 @@ static int c_can_plat_probe(struct platform_device *pdev) ...@@ -410,7 +410,7 @@ static int c_can_plat_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int c_can_plat_remove(struct platform_device *pdev) static void c_can_plat_remove(struct platform_device *pdev)
{ {
struct net_device *dev = platform_get_drvdata(pdev); struct net_device *dev = platform_get_drvdata(pdev);
struct c_can_priv *priv = netdev_priv(dev); struct c_can_priv *priv = netdev_priv(dev);
...@@ -418,8 +418,6 @@ static int c_can_plat_remove(struct platform_device *pdev) ...@@ -418,8 +418,6 @@ static int c_can_plat_remove(struct platform_device *pdev)
unregister_c_can_dev(dev); unregister_c_can_dev(dev);
pm_runtime_disable(priv->device); pm_runtime_disable(priv->device);
free_c_can_dev(dev); free_c_can_dev(dev);
return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -487,7 +485,7 @@ static struct platform_driver c_can_plat_driver = { ...@@ -487,7 +485,7 @@ static struct platform_driver c_can_plat_driver = {
.of_match_table = c_can_of_table, .of_match_table = c_can_of_table,
}, },
.probe = c_can_plat_probe, .probe = c_can_plat_probe,
.remove = c_can_plat_remove, .remove_new = c_can_plat_remove,
.suspend = c_can_suspend, .suspend = c_can_suspend,
.resume = c_can_resume, .resume = c_can_resume,
.id_table = c_can_id_table, .id_table = c_can_id_table,
......
...@@ -285,7 +285,7 @@ static int cc770_isa_probe(struct platform_device *pdev) ...@@ -285,7 +285,7 @@ static int cc770_isa_probe(struct platform_device *pdev)
return err; return err;
} }
static int cc770_isa_remove(struct platform_device *pdev) static void cc770_isa_remove(struct platform_device *pdev)
{ {
struct net_device *dev = platform_get_drvdata(pdev); struct net_device *dev = platform_get_drvdata(pdev);
struct cc770_priv *priv = netdev_priv(dev); struct cc770_priv *priv = netdev_priv(dev);
...@@ -303,13 +303,11 @@ static int cc770_isa_remove(struct platform_device *pdev) ...@@ -303,13 +303,11 @@ static int cc770_isa_remove(struct platform_device *pdev)
release_region(port[idx], CC770_IOSIZE); release_region(port[idx], CC770_IOSIZE);
} }
free_cc770dev(dev); free_cc770dev(dev);
return 0;
} }
static struct platform_driver cc770_isa_driver = { static struct platform_driver cc770_isa_driver = {
.probe = cc770_isa_probe, .probe = cc770_isa_probe,
.remove = cc770_isa_remove, .remove_new = cc770_isa_remove,
.driver = { .driver = {
.name = KBUILD_MODNAME, .name = KBUILD_MODNAME,
}, },
......
...@@ -230,7 +230,7 @@ static int cc770_platform_probe(struct platform_device *pdev) ...@@ -230,7 +230,7 @@ static int cc770_platform_probe(struct platform_device *pdev)
return err; return err;
} }
static int cc770_platform_remove(struct platform_device *pdev) static void cc770_platform_remove(struct platform_device *pdev)
{ {
struct net_device *dev = platform_get_drvdata(pdev); struct net_device *dev = platform_get_drvdata(pdev);
struct cc770_priv *priv = netdev_priv(dev); struct cc770_priv *priv = netdev_priv(dev);
...@@ -242,8 +242,6 @@ static int cc770_platform_remove(struct platform_device *pdev) ...@@ -242,8 +242,6 @@ static int cc770_platform_remove(struct platform_device *pdev)
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(mem->start, resource_size(mem)); release_mem_region(mem->start, resource_size(mem));
return 0;
} }
static const struct of_device_id cc770_platform_table[] = { static const struct of_device_id cc770_platform_table[] = {
...@@ -259,7 +257,7 @@ static struct platform_driver cc770_platform_driver = { ...@@ -259,7 +257,7 @@ static struct platform_driver cc770_platform_driver = {
.of_match_table = cc770_platform_table, .of_match_table = cc770_platform_table,
}, },
.probe = cc770_platform_probe, .probe = cc770_platform_probe,
.remove = cc770_platform_remove, .remove_new = cc770_platform_remove,
}; };
module_platform_driver(cc770_platform_driver); module_platform_driver(cc770_platform_driver);
...@@ -86,7 +86,7 @@ static int ctucan_platform_probe(struct platform_device *pdev) ...@@ -86,7 +86,7 @@ static int ctucan_platform_probe(struct platform_device *pdev)
* This function frees all the resources allocated to the device. * This function frees all the resources allocated to the device.
* Return: 0 always * Return: 0 always
*/ */
static int ctucan_platform_remove(struct platform_device *pdev) static void ctucan_platform_remove(struct platform_device *pdev)
{ {
struct net_device *ndev = platform_get_drvdata(pdev); struct net_device *ndev = platform_get_drvdata(pdev);
struct ctucan_priv *priv = netdev_priv(ndev); struct ctucan_priv *priv = netdev_priv(ndev);
...@@ -97,8 +97,6 @@ static int ctucan_platform_remove(struct platform_device *pdev) ...@@ -97,8 +97,6 @@ static int ctucan_platform_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
netif_napi_del(&priv->napi); netif_napi_del(&priv->napi);
free_candev(ndev); free_candev(ndev);
return 0;
} }
static SIMPLE_DEV_PM_OPS(ctucan_platform_pm_ops, ctucan_suspend, ctucan_resume); static SIMPLE_DEV_PM_OPS(ctucan_platform_pm_ops, ctucan_suspend, ctucan_resume);
...@@ -113,7 +111,7 @@ MODULE_DEVICE_TABLE(of, ctucan_of_match); ...@@ -113,7 +111,7 @@ MODULE_DEVICE_TABLE(of, ctucan_of_match);
static struct platform_driver ctucanfd_driver = { static struct platform_driver ctucanfd_driver = {
.probe = ctucan_platform_probe, .probe = ctucan_platform_probe,
.remove = ctucan_platform_remove, .remove_new = ctucan_platform_remove,
.driver = { .driver = {
.name = DRV_NAME, .name = DRV_NAME,
.pm = &ctucan_platform_pm_ops, .pm = &ctucan_platform_pm_ops,
......
...@@ -2218,7 +2218,7 @@ static int flexcan_probe(struct platform_device *pdev) ...@@ -2218,7 +2218,7 @@ static int flexcan_probe(struct platform_device *pdev)
return err; return err;
} }
static int flexcan_remove(struct platform_device *pdev) static void flexcan_remove(struct platform_device *pdev)
{ {
struct net_device *dev = platform_get_drvdata(pdev); struct net_device *dev = platform_get_drvdata(pdev);
...@@ -2227,8 +2227,6 @@ static int flexcan_remove(struct platform_device *pdev) ...@@ -2227,8 +2227,6 @@ static int flexcan_remove(struct platform_device *pdev)
unregister_flexcandev(dev); unregister_flexcandev(dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
free_candev(dev); free_candev(dev);
return 0;
} }
static int __maybe_unused flexcan_suspend(struct device *device) static int __maybe_unused flexcan_suspend(struct device *device)
...@@ -2379,7 +2377,7 @@ static struct platform_driver flexcan_driver = { ...@@ -2379,7 +2377,7 @@ static struct platform_driver flexcan_driver = {
.of_match_table = flexcan_of_match, .of_match_table = flexcan_of_match,
}, },
.probe = flexcan_probe, .probe = flexcan_probe,
.remove = flexcan_remove, .remove_new = flexcan_remove,
.id_table = flexcan_id_table, .id_table = flexcan_id_table,
}; };
......
...@@ -1696,7 +1696,7 @@ static int grcan_probe(struct platform_device *ofdev) ...@@ -1696,7 +1696,7 @@ static int grcan_probe(struct platform_device *ofdev)
return err; return err;
} }
static int grcan_remove(struct platform_device *ofdev) static void grcan_remove(struct platform_device *ofdev)
{ {
struct net_device *dev = platform_get_drvdata(ofdev); struct net_device *dev = platform_get_drvdata(ofdev);
struct grcan_priv *priv = netdev_priv(dev); struct grcan_priv *priv = netdev_priv(dev);
...@@ -1706,8 +1706,6 @@ static int grcan_remove(struct platform_device *ofdev) ...@@ -1706,8 +1706,6 @@ static int grcan_remove(struct platform_device *ofdev)
irq_dispose_mapping(dev->irq); irq_dispose_mapping(dev->irq);
netif_napi_del(&priv->napi); netif_napi_del(&priv->napi);
free_candev(dev); free_candev(dev);
return 0;
} }
static const struct of_device_id grcan_match[] = { static const struct of_device_id grcan_match[] = {
...@@ -1726,7 +1724,7 @@ static struct platform_driver grcan_driver = { ...@@ -1726,7 +1724,7 @@ static struct platform_driver grcan_driver = {
.of_match_table = grcan_match, .of_match_table = grcan_match,
}, },
.probe = grcan_probe, .probe = grcan_probe,
.remove = grcan_remove, .remove_new = grcan_remove,
}; };
module_platform_driver(grcan_driver); module_platform_driver(grcan_driver);
......
...@@ -1013,15 +1013,13 @@ static int ifi_canfd_plat_probe(struct platform_device *pdev) ...@@ -1013,15 +1013,13 @@ static int ifi_canfd_plat_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int ifi_canfd_plat_remove(struct platform_device *pdev) static void ifi_canfd_plat_remove(struct platform_device *pdev)
{ {
struct net_device *ndev = platform_get_drvdata(pdev); struct net_device *ndev = platform_get_drvdata(pdev);
unregister_candev(ndev); unregister_candev(ndev);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
free_candev(ndev); free_candev(ndev);
return 0;
} }
static const struct of_device_id ifi_canfd_of_table[] = { static const struct of_device_id ifi_canfd_of_table[] = {
...@@ -1036,7 +1034,7 @@ static struct platform_driver ifi_canfd_plat_driver = { ...@@ -1036,7 +1034,7 @@ static struct platform_driver ifi_canfd_plat_driver = {
.of_match_table = ifi_canfd_of_table, .of_match_table = ifi_canfd_of_table,
}, },
.probe = ifi_canfd_plat_probe, .probe = ifi_canfd_plat_probe,
.remove = ifi_canfd_plat_remove, .remove_new = ifi_canfd_plat_remove,
}; };
module_platform_driver(ifi_canfd_plat_driver); module_platform_driver(ifi_canfd_plat_driver);
......
...@@ -2023,7 +2023,7 @@ static int ican3_probe(struct platform_device *pdev) ...@@ -2023,7 +2023,7 @@ static int ican3_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int ican3_remove(struct platform_device *pdev) static void ican3_remove(struct platform_device *pdev)
{ {
struct net_device *ndev = platform_get_drvdata(pdev); struct net_device *ndev = platform_get_drvdata(pdev);
struct ican3_dev *mod = netdev_priv(ndev); struct ican3_dev *mod = netdev_priv(ndev);
...@@ -2042,8 +2042,6 @@ static int ican3_remove(struct platform_device *pdev) ...@@ -2042,8 +2042,6 @@ static int ican3_remove(struct platform_device *pdev)
iounmap(mod->dpm); iounmap(mod->dpm);
free_candev(ndev); free_candev(ndev);
return 0;
} }
static struct platform_driver ican3_driver = { static struct platform_driver ican3_driver = {
...@@ -2051,7 +2049,7 @@ static struct platform_driver ican3_driver = { ...@@ -2051,7 +2049,7 @@ static struct platform_driver ican3_driver = {
.name = DRV_NAME, .name = DRV_NAME,
}, },
.probe = ican3_probe, .probe = ican3_probe,
.remove = ican3_remove, .remove_new = ican3_remove,
}; };
module_platform_driver(ican3_driver); module_platform_driver(ican3_driver);
......
...@@ -164,7 +164,7 @@ static __maybe_unused int m_can_resume(struct device *dev) ...@@ -164,7 +164,7 @@ static __maybe_unused int m_can_resume(struct device *dev)
return m_can_class_resume(dev); return m_can_class_resume(dev);
} }
static int m_can_plat_remove(struct platform_device *pdev) static void m_can_plat_remove(struct platform_device *pdev)
{ {
struct m_can_plat_priv *priv = platform_get_drvdata(pdev); struct m_can_plat_priv *priv = platform_get_drvdata(pdev);
struct m_can_classdev *mcan_class = &priv->cdev; struct m_can_classdev *mcan_class = &priv->cdev;
...@@ -172,8 +172,6 @@ static int m_can_plat_remove(struct platform_device *pdev) ...@@ -172,8 +172,6 @@ static int m_can_plat_remove(struct platform_device *pdev)
m_can_class_unregister(mcan_class); m_can_class_unregister(mcan_class);
m_can_class_free_dev(mcan_class->net); m_can_class_free_dev(mcan_class->net);
return 0;
} }
static int __maybe_unused m_can_runtime_suspend(struct device *dev) static int __maybe_unused m_can_runtime_suspend(struct device *dev)
...@@ -223,7 +221,7 @@ static struct platform_driver m_can_plat_driver = { ...@@ -223,7 +221,7 @@ static struct platform_driver m_can_plat_driver = {
.pm = &m_can_pmops, .pm = &m_can_pmops,
}, },
.probe = m_can_plat_probe, .probe = m_can_plat_probe,
.remove = m_can_plat_remove, .remove_new = m_can_plat_remove,
}; };
module_platform_driver(m_can_plat_driver); module_platform_driver(m_can_plat_driver);
......
...@@ -349,7 +349,7 @@ static int mpc5xxx_can_probe(struct platform_device *ofdev) ...@@ -349,7 +349,7 @@ static int mpc5xxx_can_probe(struct platform_device *ofdev)
return err; return err;
} }
static int mpc5xxx_can_remove(struct platform_device *ofdev) static void mpc5xxx_can_remove(struct platform_device *ofdev)
{ {
const struct of_device_id *match; const struct of_device_id *match;
const struct mpc5xxx_can_data *data; const struct mpc5xxx_can_data *data;
...@@ -365,8 +365,6 @@ static int mpc5xxx_can_remove(struct platform_device *ofdev) ...@@ -365,8 +365,6 @@ static int mpc5xxx_can_remove(struct platform_device *ofdev)
iounmap(priv->reg_base); iounmap(priv->reg_base);
irq_dispose_mapping(dev->irq); irq_dispose_mapping(dev->irq);
free_candev(dev); free_candev(dev);
return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -437,7 +435,7 @@ static struct platform_driver mpc5xxx_can_driver = { ...@@ -437,7 +435,7 @@ static struct platform_driver mpc5xxx_can_driver = {
.of_match_table = mpc5xxx_can_table, .of_match_table = mpc5xxx_can_table,
}, },
.probe = mpc5xxx_can_probe, .probe = mpc5xxx_can_probe,
.remove = mpc5xxx_can_remove, .remove_new = mpc5xxx_can_remove,
#ifdef CONFIG_PM #ifdef CONFIG_PM
.suspend = mpc5xxx_can_suspend, .suspend = mpc5xxx_can_suspend,
.resume = mpc5xxx_can_resume, .resume = mpc5xxx_can_resume,
......
...@@ -824,7 +824,7 @@ static int rcar_can_probe(struct platform_device *pdev) ...@@ -824,7 +824,7 @@ static int rcar_can_probe(struct platform_device *pdev)
return err; return err;
} }
static int rcar_can_remove(struct platform_device *pdev) static void rcar_can_remove(struct platform_device *pdev)
{ {
struct net_device *ndev = platform_get_drvdata(pdev); struct net_device *ndev = platform_get_drvdata(pdev);
struct rcar_can_priv *priv = netdev_priv(ndev); struct rcar_can_priv *priv = netdev_priv(ndev);
...@@ -832,7 +832,6 @@ static int rcar_can_remove(struct platform_device *pdev) ...@@ -832,7 +832,6 @@ static int rcar_can_remove(struct platform_device *pdev)
unregister_candev(ndev); unregister_candev(ndev);
netif_napi_del(&priv->napi); netif_napi_del(&priv->napi);
free_candev(ndev); free_candev(ndev);
return 0;
} }
static int __maybe_unused rcar_can_suspend(struct device *dev) static int __maybe_unused rcar_can_suspend(struct device *dev)
...@@ -908,7 +907,7 @@ static struct platform_driver rcar_can_driver = { ...@@ -908,7 +907,7 @@ static struct platform_driver rcar_can_driver = {
.pm = &rcar_can_pm_ops, .pm = &rcar_can_pm_ops,
}, },
.probe = rcar_can_probe, .probe = rcar_can_probe,
.remove = rcar_can_remove, .remove_new = rcar_can_remove,
}; };
module_platform_driver(rcar_can_driver); module_platform_driver(rcar_can_driver);
......
...@@ -2078,7 +2078,7 @@ static int rcar_canfd_probe(struct platform_device *pdev) ...@@ -2078,7 +2078,7 @@ static int rcar_canfd_probe(struct platform_device *pdev)
return err; return err;
} }
static int rcar_canfd_remove(struct platform_device *pdev) static void rcar_canfd_remove(struct platform_device *pdev)
{ {
struct rcar_canfd_global *gpriv = platform_get_drvdata(pdev); struct rcar_canfd_global *gpriv = platform_get_drvdata(pdev);
u32 ch; u32 ch;
...@@ -2096,8 +2096,6 @@ static int rcar_canfd_remove(struct platform_device *pdev) ...@@ -2096,8 +2096,6 @@ static int rcar_canfd_remove(struct platform_device *pdev)
clk_disable_unprepare(gpriv->clkp); clk_disable_unprepare(gpriv->clkp);
reset_control_assert(gpriv->rstc1); reset_control_assert(gpriv->rstc1);
reset_control_assert(gpriv->rstc2); reset_control_assert(gpriv->rstc2);
return 0;
} }
static int __maybe_unused rcar_canfd_suspend(struct device *dev) static int __maybe_unused rcar_canfd_suspend(struct device *dev)
...@@ -2130,7 +2128,7 @@ static struct platform_driver rcar_canfd_driver = { ...@@ -2130,7 +2128,7 @@ static struct platform_driver rcar_canfd_driver = {
.pm = &rcar_canfd_pm_ops, .pm = &rcar_canfd_pm_ops,
}, },
.probe = rcar_canfd_probe, .probe = rcar_canfd_probe,
.remove = rcar_canfd_remove, .remove_new = rcar_canfd_remove,
}; };
module_platform_driver(rcar_canfd_driver); module_platform_driver(rcar_canfd_driver);
......
...@@ -223,7 +223,7 @@ static int sja1000_isa_probe(struct platform_device *pdev) ...@@ -223,7 +223,7 @@ static int sja1000_isa_probe(struct platform_device *pdev)
return err; return err;
} }
static int sja1000_isa_remove(struct platform_device *pdev) static void sja1000_isa_remove(struct platform_device *pdev)
{ {
struct net_device *dev = platform_get_drvdata(pdev); struct net_device *dev = platform_get_drvdata(pdev);
struct sja1000_priv *priv = netdev_priv(dev); struct sja1000_priv *priv = netdev_priv(dev);
...@@ -241,13 +241,11 @@ static int sja1000_isa_remove(struct platform_device *pdev) ...@@ -241,13 +241,11 @@ static int sja1000_isa_remove(struct platform_device *pdev)
release_region(port[idx], SJA1000_IOSIZE); release_region(port[idx], SJA1000_IOSIZE);
} }
free_sja1000dev(dev); free_sja1000dev(dev);
return 0;
} }
static struct platform_driver sja1000_isa_driver = { static struct platform_driver sja1000_isa_driver = {
.probe = sja1000_isa_probe, .probe = sja1000_isa_probe,
.remove = sja1000_isa_remove, .remove_new = sja1000_isa_remove,
.driver = { .driver = {
.name = DRV_NAME, .name = DRV_NAME,
}, },
......
...@@ -317,19 +317,17 @@ static int sp_probe(struct platform_device *pdev) ...@@ -317,19 +317,17 @@ static int sp_probe(struct platform_device *pdev)
return err; return err;
} }
static int sp_remove(struct platform_device *pdev) static void sp_remove(struct platform_device *pdev)
{ {
struct net_device *dev = platform_get_drvdata(pdev); struct net_device *dev = platform_get_drvdata(pdev);
unregister_sja1000dev(dev); unregister_sja1000dev(dev);
free_sja1000dev(dev); free_sja1000dev(dev);
return 0;
} }
static struct platform_driver sp_driver = { static struct platform_driver sp_driver = {
.probe = sp_probe, .probe = sp_probe,
.remove = sp_remove, .remove_new = sp_remove,
.driver = { .driver = {
.name = DRV_NAME, .name = DRV_NAME,
.of_match_table = sp_of_table, .of_match_table = sp_of_table,
......
...@@ -729,7 +729,7 @@ static const struct attribute_group softing_pdev_group = { ...@@ -729,7 +729,7 @@ static const struct attribute_group softing_pdev_group = {
/* /*
* platform driver * platform driver
*/ */
static int softing_pdev_remove(struct platform_device *pdev) static void softing_pdev_remove(struct platform_device *pdev)
{ {
struct softing *card = platform_get_drvdata(pdev); struct softing *card = platform_get_drvdata(pdev);
int j; int j;
...@@ -747,7 +747,6 @@ static int softing_pdev_remove(struct platform_device *pdev) ...@@ -747,7 +747,6 @@ static int softing_pdev_remove(struct platform_device *pdev)
iounmap(card->dpram); iounmap(card->dpram);
kfree(card); kfree(card);
return 0;
} }
static int softing_pdev_probe(struct platform_device *pdev) static int softing_pdev_probe(struct platform_device *pdev)
...@@ -855,7 +854,7 @@ static struct platform_driver softing_driver = { ...@@ -855,7 +854,7 @@ static struct platform_driver softing_driver = {
.name = KBUILD_MODNAME, .name = KBUILD_MODNAME,
}, },
.probe = softing_pdev_probe, .probe = softing_pdev_probe,
.remove = softing_pdev_remove, .remove_new = softing_pdev_remove,
}; };
module_platform_driver(softing_driver); module_platform_driver(softing_driver);
......
...@@ -791,14 +791,12 @@ static const struct of_device_id sun4ican_of_match[] = { ...@@ -791,14 +791,12 @@ static const struct of_device_id sun4ican_of_match[] = {
MODULE_DEVICE_TABLE(of, sun4ican_of_match); MODULE_DEVICE_TABLE(of, sun4ican_of_match);
static int sun4ican_remove(struct platform_device *pdev) static void sun4ican_remove(struct platform_device *pdev)
{ {
struct net_device *dev = platform_get_drvdata(pdev); struct net_device *dev = platform_get_drvdata(pdev);
unregister_netdev(dev); unregister_netdev(dev);
free_candev(dev); free_candev(dev);
return 0;
} }
static int sun4ican_probe(struct platform_device *pdev) static int sun4ican_probe(struct platform_device *pdev)
...@@ -901,7 +899,7 @@ static struct platform_driver sun4i_can_driver = { ...@@ -901,7 +899,7 @@ static struct platform_driver sun4i_can_driver = {
.of_match_table = sun4ican_of_match, .of_match_table = sun4ican_of_match,
}, },
.probe = sun4ican_probe, .probe = sun4ican_probe,
.remove = sun4ican_remove, .remove_new = sun4ican_remove,
}; };
module_platform_driver(sun4i_can_driver); module_platform_driver(sun4i_can_driver);
......
...@@ -963,7 +963,7 @@ static int ti_hecc_probe(struct platform_device *pdev) ...@@ -963,7 +963,7 @@ static int ti_hecc_probe(struct platform_device *pdev)
return err; return err;
} }
static int ti_hecc_remove(struct platform_device *pdev) static void ti_hecc_remove(struct platform_device *pdev)
{ {
struct net_device *ndev = platform_get_drvdata(pdev); struct net_device *ndev = platform_get_drvdata(pdev);
struct ti_hecc_priv *priv = netdev_priv(ndev); struct ti_hecc_priv *priv = netdev_priv(ndev);
...@@ -973,8 +973,6 @@ static int ti_hecc_remove(struct platform_device *pdev) ...@@ -973,8 +973,6 @@ static int ti_hecc_remove(struct platform_device *pdev)
clk_put(priv->clk); clk_put(priv->clk);
can_rx_offload_del(&priv->offload); can_rx_offload_del(&priv->offload);
free_candev(ndev); free_candev(ndev);
return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -1028,7 +1026,7 @@ static struct platform_driver ti_hecc_driver = { ...@@ -1028,7 +1026,7 @@ static struct platform_driver ti_hecc_driver = {
.of_match_table = ti_hecc_dt_ids, .of_match_table = ti_hecc_dt_ids,
}, },
.probe = ti_hecc_probe, .probe = ti_hecc_probe,
.remove = ti_hecc_remove, .remove_new = ti_hecc_remove,
.suspend = ti_hecc_suspend, .suspend = ti_hecc_suspend,
.resume = ti_hecc_resume, .resume = ti_hecc_resume,
}; };
......
...@@ -1898,20 +1898,18 @@ static int xcan_probe(struct platform_device *pdev) ...@@ -1898,20 +1898,18 @@ static int xcan_probe(struct platform_device *pdev)
* This function frees all the resources allocated to the device. * This function frees all the resources allocated to the device.
* Return: 0 always * Return: 0 always
*/ */
static int xcan_remove(struct platform_device *pdev) static void xcan_remove(struct platform_device *pdev)
{ {
struct net_device *ndev = platform_get_drvdata(pdev); struct net_device *ndev = platform_get_drvdata(pdev);
unregister_candev(ndev); unregister_candev(ndev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
free_candev(ndev); free_candev(ndev);
return 0;
} }
static struct platform_driver xcan_driver = { static struct platform_driver xcan_driver = {
.probe = xcan_probe, .probe = xcan_probe,
.remove = xcan_remove, .remove_new = xcan_remove,
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.pm = &xcan_dev_pm_ops, .pm = &xcan_dev_pm_ops,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment