mtd: dataflash: remove unnecessary spi_set_drvdata()
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Tue Jan 28 00:59:03 EST 2014
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=1ba80c9e08a6d17ac495d8e6a1acd3d0f6a7971b
Commit: 1ba80c9e08a6d17ac495d8e6a1acd3d0f6a7971b
Parent: afc62baf107355715beaf982513db3355867b29b
Author: Jingoo Han <jg1.han at samsung.com>
AuthorDate: Mon Nov 25 12:24:22 2013 +0900
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Fri Jan 3 11:22:20 2014 -0800
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 at samsung.com>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
drivers/mtd/devices/mtd_dataflash.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index 4a47b02..624069d 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,
if (!err)
return 0;
- spi_set_drvdata(spi, NULL);
kfree(priv);
return err;
}
@@ -899,10 +898,8 @@ static int dataflash_remove(struct spi_device *spi)
pr_debug("%s: remove\n", dev_name(&spi->dev));
status = mtd_device_unregister(&flash->mtd);
- if (status == 0) {
- spi_set_drvdata(spi, NULL);
+ if (status == 0)
kfree(flash);
- }
return status;
}
More information about the linux-mtd-cvs
mailing list