[V2,06/14] net: ks8851: Use dev_{get,set}_drvdata()
diff mbox series

Message ID 20200325150543.78569-7-marex@denx.de
State Superseded
Delegated to: David Miller
Headers show
  • net: ks8851: Unify KS8851 SPI and MLL drivers
Related show

Commit Message

Marek Vasut March 25, 2020, 3:05 p.m. UTC
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.

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>
V2: Reverse xmas tree.
 drivers/net/ethernet/micrel/ks8851.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff mbox series

diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index f0b70b79e7ed..c2f381a7b3f3 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -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);
 	netdev->if_port = IF_PORT_100BASET;
@@ -1567,8 +1567,10 @@  static int ks8851_probe(struct spi_device *spi)
 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");