[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200517003354.233373-7-marex@denx.de>
Date: Sun, 17 May 2020 02:33:40 +0200
From: Marek Vasut <marex@...x.de>
To: netdev@...r.kernel.org
Cc: Marek Vasut <marex@...x.de>, Andrew Lunn <andrew@...n.ch>,
"David S . Miller" <davem@...emloft.net>,
Lukas Wunner <lukas@...ner.de>, Petr Stetiar <ynezz@...e.cz>,
YueHaibing <yuehaibing@...wei.com>
Subject: [PATCH V6 06/20] net: ks8851: Use dev_{get,set}_drvdata()
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@...n.ch>
Signed-off-by: Marek Vasut <marex@...x.de>
Cc: David S. Miller <davem@...emloft.net>
Cc: Lukas Wunner <lukas@...ner.de>
Cc: Petr Stetiar <ynezz@...e.cz>
Cc: YueHaibing <yuehaibing@...wei.com>
---
V2: Reverse xmas tree.
V3: No change
V4: No change
V5: No change
V6: No change
---
drivers/net/ethernet/micrel/ks8851.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index 86bfe55f346d..fe2037e166dc 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);
netif_carrier_off(ks->netdev);
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");
--
2.25.1
Powered by blists - more mailing lists