OSDN Git Service

net: dsa: realtek: remove unnecessary set_drvdata()
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 21 Sep 2022 14:05:20 +0000 (22:05 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 23 Sep 2022 02:30:39 +0000 (19:30 -0700)
Remove unnecessary set_drvdata(NULL) function in ->remove(),
the driver_data will be set to NULL in device_unbind_cleanup()
after calling ->remove().

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Alvin Šipraga <alsi@bang-olufsen.dk>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/realtek/realtek-mdio.c
drivers/net/dsa/realtek/realtek-smi.c

index c58f49d..3e54fac 100644 (file)
@@ -245,8 +245,6 @@ static void realtek_mdio_remove(struct mdio_device *mdiodev)
        /* leave the device reset asserted */
        if (priv->reset)
                gpiod_set_value(priv->reset, 1);
-
-       dev_set_drvdata(&mdiodev->dev, NULL);
 }
 
 static void realtek_mdio_shutdown(struct mdio_device *mdiodev)
index 45992f7..1b447d9 100644 (file)
@@ -522,8 +522,6 @@ static int realtek_smi_remove(struct platform_device *pdev)
        if (priv->reset)
                gpiod_set_value(priv->reset, 1);
 
-       platform_set_drvdata(pdev, NULL);
-
        return 0;
 }