Commit bce49343 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

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: default avatarJakub Kicinski <kuba@kernel.org>
parents 2ff46b9e a06041e2
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1438,7 +1438,7 @@ static int fjes_probe(struct platform_device *plat_dev)
}

/* 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
+13 −16
Original line number Diff line number Diff line
@@ -943,7 +943,7 @@ static int ipa_probe(struct platform_device *pdev)
	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 @@ static int ipa_remove(struct platform_device *pdev)
	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,
+2 −4
Original line number Diff line number Diff line
@@ -505,11 +505,9 @@ static int miic_probe(struct platform_device *pdev)
	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);

+2 −4
Original line number Diff line number Diff line
@@ -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",
+2 −4
Original line number Diff line number Diff line
@@ -1259,7 +1259,7 @@ static int ucc_hdlc_probe(struct platform_device *pdev)
	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,
Loading