Commit 4fa0a0ef authored by Jingoo Han's avatar Jingoo Han Committed by David S. Miller

net: ieee802154: mrf24j40: use spi_get_drvdata() and spi_set_drvdata()

Use the wrapper functions for getting and setting the driver data using
spi_device instead of using dev_{get|set}_drvdata with &spi->dev, so we
can directly pass a struct spi_device.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 58152cd4
...@@ -648,7 +648,7 @@ static int mrf24j40_probe(struct spi_device *spi) ...@@ -648,7 +648,7 @@ static int mrf24j40_probe(struct spi_device *spi)
init_completion(&devrec->tx_complete); init_completion(&devrec->tx_complete);
INIT_WORK(&devrec->irqwork, mrf24j40_isrwork); INIT_WORK(&devrec->irqwork, mrf24j40_isrwork);
devrec->spi = spi; devrec->spi = spi;
dev_set_drvdata(&spi->dev, devrec); spi_set_drvdata(spi, devrec);
/* Register with the 802154 subsystem */ /* Register with the 802154 subsystem */
...@@ -720,7 +720,7 @@ static int mrf24j40_probe(struct spi_device *spi) ...@@ -720,7 +720,7 @@ static int mrf24j40_probe(struct spi_device *spi)
static int mrf24j40_remove(struct spi_device *spi) static int mrf24j40_remove(struct spi_device *spi)
{ {
struct mrf24j40 *devrec = dev_get_drvdata(&spi->dev); struct mrf24j40 *devrec = spi_get_drvdata(spi);
dev_dbg(printdev(devrec), "remove\n"); dev_dbg(printdev(devrec), "remove\n");
...@@ -732,7 +732,7 @@ static int mrf24j40_remove(struct spi_device *spi) ...@@ -732,7 +732,7 @@ static int mrf24j40_remove(struct spi_device *spi)
* complete? */ * complete? */
/* Clean up the SPI stuff. */ /* Clean up the SPI stuff. */
dev_set_drvdata(&spi->dev, NULL); spi_set_drvdata(spi, NULL);
kfree(devrec->buf); kfree(devrec->buf);
kfree(devrec); kfree(devrec);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment