Merge branch 'net-convert-to-platform-remove-callback-returning-void'
Uwe Kleine-König says: ==================== net*: Convert to platform remove callback returning void (implicit) v1 of this series can be found at https://lore.kernel.org/netdev/20231117095922.876489-1-u.kleine-koenig@pengutronix.de. Changes since then: - Dropped patch #1 as Alex objected. Patch #1 (was #2 before) now converts ipa to remove_new() and introduces an error message in the error path that failed before. ==================== Link: https://lore.kernel.org/r/cover.1701713943.git.u.kleine-koenig@pengutronix.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
bce4934397
@ -1438,7 +1438,7 @@ err_out:
|
||||
}
|
||||
|
||||
/* fjes_remove - Device Removal Routine */
|
||||
static int fjes_remove(struct platform_device *plat_dev)
|
||||
static void fjes_remove(struct platform_device *plat_dev)
|
||||
{
|
||||
struct net_device *netdev = dev_get_drvdata(&plat_dev->dev);
|
||||
struct fjes_adapter *adapter = netdev_priv(netdev);
|
||||
@ -1462,8 +1462,6 @@ static int fjes_remove(struct platform_device *plat_dev)
|
||||
netif_napi_del(&adapter->napi);
|
||||
|
||||
free_netdev(netdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver fjes_driver = {
|
||||
@ -1471,7 +1469,7 @@ static struct platform_driver fjes_driver = {
|
||||
.name = DRV_NAME,
|
||||
},
|
||||
.probe = fjes_probe,
|
||||
.remove = fjes_remove,
|
||||
.remove_new = fjes_remove,
|
||||
};
|
||||
|
||||
static acpi_status
|
||||
|
@ -943,7 +943,7 @@ err_power_exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ipa_remove(struct platform_device *pdev)
|
||||
static void ipa_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct ipa *ipa = dev_get_drvdata(&pdev->dev);
|
||||
struct ipa_power *power = ipa->power;
|
||||
@ -966,8 +966,16 @@ static int ipa_remove(struct platform_device *pdev)
|
||||
usleep_range(USEC_PER_MSEC, 2 * USEC_PER_MSEC);
|
||||
ret = ipa_modem_stop(ipa);
|
||||
}
|
||||
if (ret)
|
||||
return ret;
|
||||
if (ret) {
|
||||
/*
|
||||
* Not cleaning up here properly might also yield a
|
||||
* crash later on. As the device is still unregistered
|
||||
* in this case, this might even yield a crash later on.
|
||||
*/
|
||||
dev_err(dev, "Failed to stop modem (%pe), leaking resources\n",
|
||||
ERR_PTR(ret));
|
||||
return;
|
||||
}
|
||||
|
||||
ipa_teardown(ipa);
|
||||
}
|
||||
@ -985,17 +993,6 @@ out_power_put:
|
||||
ipa_power_exit(power);
|
||||
|
||||
dev_info(dev, "IPA driver removed");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ipa_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = ipa_remove(pdev);
|
||||
if (ret)
|
||||
dev_err(&pdev->dev, "shutdown: remove returned %d\n", ret);
|
||||
}
|
||||
|
||||
static const struct attribute_group *ipa_attribute_groups[] = {
|
||||
@ -1008,8 +1005,8 @@ static const struct attribute_group *ipa_attribute_groups[] = {
|
||||
|
||||
static struct platform_driver ipa_driver = {
|
||||
.probe = ipa_probe,
|
||||
.remove = ipa_remove,
|
||||
.shutdown = ipa_shutdown,
|
||||
.remove_new = ipa_remove,
|
||||
.shutdown = ipa_remove,
|
||||
.driver = {
|
||||
.name = "ipa",
|
||||
.pm = &ipa_pm_ops,
|
||||
|
@ -505,11 +505,9 @@ disable_runtime_pm:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int miic_remove(struct platform_device *pdev)
|
||||
static void miic_remove(struct platform_device *pdev)
|
||||
{
|
||||
pm_runtime_put(&pdev->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id miic_of_mtable[] = {
|
||||
@ -525,7 +523,7 @@ static struct platform_driver miic_driver = {
|
||||
.of_match_table = miic_of_mtable,
|
||||
},
|
||||
.probe = miic_probe,
|
||||
.remove = miic_remove,
|
||||
.remove_new = miic_remove,
|
||||
};
|
||||
module_platform_driver(miic_driver);
|
||||
|
||||
|
@ -3097,7 +3097,7 @@ static int sfp_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sfp_remove(struct platform_device *pdev)
|
||||
static void sfp_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct sfp *sfp = platform_get_drvdata(pdev);
|
||||
|
||||
@ -3107,8 +3107,6 @@ static int sfp_remove(struct platform_device *pdev)
|
||||
rtnl_lock();
|
||||
sfp_sm_event(sfp, SFP_E_REMOVE);
|
||||
rtnl_unlock();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sfp_shutdown(struct platform_device *pdev)
|
||||
@ -3129,7 +3127,7 @@ static void sfp_shutdown(struct platform_device *pdev)
|
||||
|
||||
static struct platform_driver sfp_driver = {
|
||||
.probe = sfp_probe,
|
||||
.remove = sfp_remove,
|
||||
.remove_new = sfp_remove,
|
||||
.shutdown = sfp_shutdown,
|
||||
.driver = {
|
||||
.name = "sfp",
|
||||
|
@ -1259,7 +1259,7 @@ free_uhdlc_priv:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ucc_hdlc_remove(struct platform_device *pdev)
|
||||
static void ucc_hdlc_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct ucc_hdlc_private *priv = dev_get_drvdata(&pdev->dev);
|
||||
|
||||
@ -1277,8 +1277,6 @@ static int ucc_hdlc_remove(struct platform_device *pdev)
|
||||
kfree(priv);
|
||||
|
||||
dev_info(&pdev->dev, "UCC based hdlc module removed\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id fsl_ucc_hdlc_of_match[] = {
|
||||
@ -1292,7 +1290,7 @@ MODULE_DEVICE_TABLE(of, fsl_ucc_hdlc_of_match);
|
||||
|
||||
static struct platform_driver ucc_hdlc_driver = {
|
||||
.probe = ucc_hdlc_probe,
|
||||
.remove = ucc_hdlc_remove,
|
||||
.remove_new = ucc_hdlc_remove,
|
||||
.driver = {
|
||||
.name = DRV_NAME,
|
||||
.pm = HDLC_PM_OPS,
|
||||
|
@ -1522,20 +1522,19 @@ err_plat:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int ixp4xx_hss_remove(struct platform_device *pdev)
|
||||
static void ixp4xx_hss_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct port *port = platform_get_drvdata(pdev);
|
||||
|
||||
unregister_hdlc_device(port->netdev);
|
||||
free_netdev(port->netdev);
|
||||
npe_release(port->npe);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver ixp4xx_hss_driver = {
|
||||
.driver.name = DRV_NAME,
|
||||
.probe = ixp4xx_hss_probe,
|
||||
.remove = ixp4xx_hss_remove,
|
||||
.remove_new = ixp4xx_hss_remove,
|
||||
};
|
||||
module_platform_driver(ixp4xx_hss_driver);
|
||||
|
||||
|
@ -846,7 +846,7 @@ static int bam_dmux_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bam_dmux_remove(struct platform_device *pdev)
|
||||
static void bam_dmux_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct bam_dmux *dmux = platform_get_drvdata(pdev);
|
||||
struct device *dev = dmux->dev;
|
||||
@ -877,8 +877,6 @@ static int bam_dmux_remove(struct platform_device *pdev)
|
||||
disable_irq(dmux->pc_irq);
|
||||
bam_dmux_power_off(dmux);
|
||||
bam_dmux_free_skbs(dmux->tx_skbs, DMA_TO_DEVICE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops bam_dmux_pm_ops = {
|
||||
@ -893,7 +891,7 @@ MODULE_DEVICE_TABLE(of, bam_dmux_of_match);
|
||||
|
||||
static struct platform_driver bam_dmux_driver = {
|
||||
.probe = bam_dmux_probe,
|
||||
.remove = bam_dmux_remove,
|
||||
.remove_new = bam_dmux_remove,
|
||||
.driver = {
|
||||
.name = "bam-dmux",
|
||||
.pm = &bam_dmux_pm_ops,
|
||||
|
Loading…
x
Reference in New Issue
Block a user