Commit 5d5f1846 authored by Jingoo Han's avatar Jingoo Han Committed by David S. Miller

net: phy: spi_ks8995: 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 d60c5d20
...@@ -281,7 +281,7 @@ static int ks8995_probe(struct spi_device *spi) ...@@ -281,7 +281,7 @@ static int ks8995_probe(struct spi_device *spi)
mutex_init(&ks->lock); mutex_init(&ks->lock);
ks->pdata = pdata; ks->pdata = pdata;
ks->spi = spi_dev_get(spi); ks->spi = spi_dev_get(spi);
dev_set_drvdata(&spi->dev, ks); spi_set_drvdata(spi, ks);
spi->mode = SPI_MODE_0; spi->mode = SPI_MODE_0;
spi->bits_per_word = 8; spi->bits_per_word = 8;
...@@ -325,7 +325,7 @@ static int ks8995_probe(struct spi_device *spi) ...@@ -325,7 +325,7 @@ static int ks8995_probe(struct spi_device *spi)
return 0; return 0;
err_drvdata: err_drvdata:
dev_set_drvdata(&spi->dev, NULL); spi_set_drvdata(spi, NULL);
kfree(ks); kfree(ks);
return err; return err;
} }
...@@ -334,10 +334,10 @@ static int ks8995_remove(struct spi_device *spi) ...@@ -334,10 +334,10 @@ static int ks8995_remove(struct spi_device *spi)
{ {
struct ks8995_data *ks8995; struct ks8995_data *ks8995;
ks8995 = dev_get_drvdata(&spi->dev); ks8995 = spi_get_drvdata(spi);
sysfs_remove_bin_file(&spi->dev.kobj, &ks8995_registers_attr); sysfs_remove_bin_file(&spi->dev.kobj, &ks8995_registers_attr);
dev_set_drvdata(&spi->dev, NULL); spi_set_drvdata(spi, NULL);
kfree(ks8995); kfree(ks8995);
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