aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-11-24 22:24:22 -0500
committerBrian Norris <computersforpeace@gmail.com>2014-01-03 14:22:20 -0500
commit1ba80c9e08a6d17ac495d8e6a1acd3d0f6a7971b (patch)
treed2f0c7d32b8c15d8ab445c2b2e3ab7d01ab253e7 /drivers/mtd/devices
parentafc62baf107355715beaf982513db3355867b29b (diff)
mtd: dataflash: remove unnecessary spi_set_drvdata()
The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/mtd_dataflash.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index 4a47b0266d4e..624069de4f28 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -669,7 +669,6 @@ static int add_dataflash_otp(struct spi_device *spi, char *name, int nr_pages,
669 if (!err) 669 if (!err)
670 return 0; 670 return 0;
671 671
672 spi_set_drvdata(spi, NULL);
673 kfree(priv); 672 kfree(priv);
674 return err; 673 return err;
675} 674}
@@ -899,10 +898,8 @@ static int dataflash_remove(struct spi_device *spi)
899 pr_debug("%s: remove\n", dev_name(&spi->dev)); 898 pr_debug("%s: remove\n", dev_name(&spi->dev));
900 899
901 status = mtd_device_unregister(&flash->mtd); 900 status = mtd_device_unregister(&flash->mtd);
902 if (status == 0) { 901 if (status == 0)
903 spi_set_drvdata(spi, NULL);
904 kfree(flash); 902 kfree(flash);
905 }
906 return status; 903 return status;
907} 904}
908 905