mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
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>
This commit is contained in:
parent
afc62baf10
commit
1ba80c9e08
1 changed files with 1 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue