net: ks8851: Use dev_{get,set}_drvdata()
authorMarek Vasut <marex@denx.de>
Thu, 28 May 2020 22:21:33 +0000 (00:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 May 2020 23:30:04 +0000 (16:30 -0700)
Replace spi_{get,set}_drvdata() with dev_{get,set}_drvdata(), which
works for both SPI and platform drivers. This is done in preparation
for unifying the KS8851 SPI and parallel bus drivers.

There should be no functional change.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Petr Stetiar <ynezz@true.cz>
Cc: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/micrel/ks8851.c

index 86bfe55f346d90c030f718864a0def51be6f177a..fe2037e166dc04bf71b106415e81dca49a4b31a8 100644 (file)
@@ -1518,7 +1518,7 @@ static int ks8851_probe(struct spi_device *spi)
        netdev->ethtool_ops = &ks8851_ethtool_ops;
        SET_NETDEV_DEV(netdev, dev);
 
-       spi_set_drvdata(spi, ks);
+       dev_set_drvdata(dev, ks);
 
        netif_carrier_off(ks->netdev);
        netdev->if_port = IF_PORT_100BASET;
@@ -1567,8 +1567,10 @@ err_reg_io:
 
 static int ks8851_remove(struct spi_device *spi)
 {
-       struct ks8851_net *priv = spi_get_drvdata(spi);
        struct device *dev = &spi->dev;
+       struct ks8851_net *priv;
+
+       priv = dev_get_drvdata(dev);
 
        if (netif_msg_drv(priv))
                dev_info(dev, "remove\n");