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

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.de


Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parents 6882011e 0816e1dd
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1346,7 +1346,7 @@ static int at91_can_probe(struct platform_device *pdev)
	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 at91_priv *priv = netdev_priv(dev);
@@ -1362,8 +1362,6 @@ static int at91_can_remove(struct platform_device *pdev)
	clk_put(priv->clk);

	free_candev(dev);

	return 0;
}

static const struct platform_device_id at91_can_id_table[] = {
@@ -1381,7 +1379,7 @@ MODULE_DEVICE_TABLE(platform, at91_can_id_table);

static struct platform_driver at91_can_driver = {
	.probe = at91_can_probe,
	.remove = at91_can_remove,
	.remove_new = at91_can_remove,
	.driver = {
		.name = KBUILD_MODNAME,
		.of_match_table = of_match_ptr(at91_can_dt_ids),
+2 −3
Original line number Diff line number Diff line
@@ -1021,7 +1021,7 @@ static int bxcan_probe(struct platform_device *pdev)
	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 bxcan_priv *priv = netdev_priv(ndev);
@@ -1030,7 +1030,6 @@ static int bxcan_remove(struct platform_device *pdev)
	clk_disable_unprepare(priv->clk);
	can_rx_offload_del(&priv->offload);
	free_candev(ndev);
	return 0;
}

static int __maybe_unused bxcan_suspend(struct device *dev)
@@ -1082,7 +1081,7 @@ static struct platform_driver bxcan_driver = {
		.of_match_table = bxcan_of_match,
	},
	.probe = bxcan_probe,
	.remove = bxcan_remove,
	.remove_new = bxcan_remove,
};

module_platform_driver(bxcan_driver);
+2 −4
Original line number Diff line number Diff line
@@ -410,7 +410,7 @@ static int c_can_plat_probe(struct platform_device *pdev)
	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 c_can_priv *priv = netdev_priv(dev);
@@ -418,8 +418,6 @@ static int c_can_plat_remove(struct platform_device *pdev)
	unregister_c_can_dev(dev);
	pm_runtime_disable(priv->device);
	free_c_can_dev(dev);

	return 0;
}

#ifdef CONFIG_PM
@@ -487,7 +485,7 @@ static struct platform_driver c_can_plat_driver = {
		.of_match_table = c_can_of_table,
	},
	.probe = c_can_plat_probe,
	.remove = c_can_plat_remove,
	.remove_new = c_can_plat_remove,
	.suspend = c_can_suspend,
	.resume = c_can_resume,
	.id_table = c_can_id_table,
+2 −4
Original line number Diff line number Diff line
@@ -285,7 +285,7 @@ static int cc770_isa_probe(struct platform_device *pdev)
	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 cc770_priv *priv = netdev_priv(dev);
@@ -303,13 +303,11 @@ static int cc770_isa_remove(struct platform_device *pdev)
			release_region(port[idx], CC770_IOSIZE);
	}
	free_cc770dev(dev);

	return 0;
}

static struct platform_driver cc770_isa_driver = {
	.probe = cc770_isa_probe,
	.remove = cc770_isa_remove,
	.remove_new = cc770_isa_remove,
	.driver = {
		.name = KBUILD_MODNAME,
	},
+2 −4
Original line number Diff line number Diff line
@@ -230,7 +230,7 @@ static int cc770_platform_probe(struct platform_device *pdev)
	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 cc770_priv *priv = netdev_priv(dev);
@@ -242,8 +242,6 @@ static int cc770_platform_remove(struct platform_device *pdev)

	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	release_mem_region(mem->start, resource_size(mem));

	return 0;
}

static const struct of_device_id cc770_platform_table[] = {
@@ -259,7 +257,7 @@ static struct platform_driver cc770_platform_driver = {
		.of_match_table = cc770_platform_table,
	},
	.probe = cc770_platform_probe,
	.remove = cc770_platform_remove,
	.remove_new = cc770_platform_remove,
};

module_platform_driver(cc770_platform_driver);
Loading