Thread (19 messages) flat view 19 messages, 6 authors, 2021-09-14

Re: [RFC PATCH net 2/5] net: dsa: be compatible with masters which unregister on shutdown

From: Vladimir Oltean <olteanv@gmail.com>
Date: 2021-09-12 13:18:45
Also in: linux-arm-kernel, linux-mediatek, lkml

On Sun, Sep 12, 2021 at 03:09:29PM +0300, Vladimir Oltean wrote:
quoted hunk ↗ jump to hunk
+static int b53_mmap_shutdown(struct platform_device *pdev)
+{
+	struct b53_device *dev = platform_get_drvdata(pdev);
+
+	if (dev)
+		b53_switch_shutdown(dev);
+
+	platform_set_drvdata(pdev, NULL);
+}
+
 static const struct of_device_id b53_mmap_of_table[] = {
 	{ .compatible = "brcm,bcm3384-switch" },
 	{ .compatible = "brcm,bcm6328-switch" },
@@ -331,6 +343,7 @@ MODULE_DEVICE_TABLE(of, b53_mmap_of_table);
 static struct platform_driver b53_mmap_driver = {
 	.probe = b53_mmap_probe,
 	.remove = b53_mmap_remove,
+	.shutdown = b53_mmap_shutdown,
 	.driver = {
 		.name = "b53-switch",
 		.of_match_table = b53_mmap_of_table,
I forgot to enable all variants of the b53 driver, and as such, the mmap
version fails to build (the shutdown function should return void, not int).

I will fix this when I send the v2 patch, but I will not send that now,
as I would like to get some feedback on the approach first.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help