diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-06 02:41:03 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2013-08-05 14:05:42 -0400 |
commit | 5cacbfa9fe263b7f65a8efdf68bf14754c3d250a (patch) | |
tree | 483205e57a883cc0e3ea05e03bda2a36da492a61 /drivers/mtd/devices | |
parent | 1594908ac06509bf0768d78e66f4138617fd7314 (diff) |
mtd: dataflash: 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: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r-- | drivers/mtd/devices/mtd_dataflash.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 28779b6dfcd9..4a4366437e17 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c | |||
@@ -661,7 +661,7 @@ static int add_dataflash_otp(struct spi_device *spi, char *name, int nr_pages, | |||
661 | dev_info(&spi->dev, "%s (%lld KBytes) pagesize %d bytes%s\n", | 661 | dev_info(&spi->dev, "%s (%lld KBytes) pagesize %d bytes%s\n", |
662 | name, (long long)((device->size + 1023) >> 10), | 662 | name, (long long)((device->size + 1023) >> 10), |
663 | pagesize, otp_tag); | 663 | pagesize, otp_tag); |
664 | dev_set_drvdata(&spi->dev, priv); | 664 | spi_set_drvdata(spi, priv); |
665 | 665 | ||
666 | ppdata.of_node = spi->dev.of_node; | 666 | ppdata.of_node = spi->dev.of_node; |
667 | err = mtd_device_parse_register(device, NULL, &ppdata, | 667 | err = mtd_device_parse_register(device, NULL, &ppdata, |
@@ -671,7 +671,7 @@ static int add_dataflash_otp(struct spi_device *spi, char *name, int nr_pages, | |||
671 | if (!err) | 671 | if (!err) |
672 | return 0; | 672 | return 0; |
673 | 673 | ||
674 | dev_set_drvdata(&spi->dev, NULL); | 674 | spi_set_drvdata(spi, NULL); |
675 | kfree(priv); | 675 | kfree(priv); |
676 | return err; | 676 | return err; |
677 | } | 677 | } |
@@ -895,14 +895,14 @@ static int dataflash_probe(struct spi_device *spi) | |||
895 | 895 | ||
896 | static int dataflash_remove(struct spi_device *spi) | 896 | static int dataflash_remove(struct spi_device *spi) |
897 | { | 897 | { |
898 | struct dataflash *flash = dev_get_drvdata(&spi->dev); | 898 | struct dataflash *flash = spi_get_drvdata(spi); |
899 | int status; | 899 | int status; |
900 | 900 | ||
901 | pr_debug("%s: remove\n", dev_name(&spi->dev)); | 901 | pr_debug("%s: remove\n", dev_name(&spi->dev)); |
902 | 902 | ||
903 | status = mtd_device_unregister(&flash->mtd); | 903 | status = mtd_device_unregister(&flash->mtd); |
904 | if (status == 0) { | 904 | if (status == 0) { |
905 | dev_set_drvdata(&spi->dev, NULL); | 905 | spi_set_drvdata(spi, NULL); |
906 | kfree(flash); | 906 | kfree(flash); |
907 | } | 907 | } |
908 | return status; | 908 | return status; |