diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2021-02-12 18:10:42 +0100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2021-02-17 04:34:57 +0100 |
commit | 8409f942a1f8c28296910b7b1d60f27dd3e03162 (patch) | |
tree | edbd3a8a91db1d8fa4684ac93f28e01c76cdae6b /drivers/nvdimm/dimm.c | |
parent | Linux 5.11-rc6 (diff) | |
download | linux-8409f942a1f8c28296910b7b1d60f27dd3e03162.tar.xz linux-8409f942a1f8c28296910b7b1d60f27dd3e03162.zip |
libnvdimm/dimm: Simplify nvdimm_remove()
nvdimm_remove is only ever called after nvdimm_probe() returned
successfully. In this case driver data is always set to a non-NULL value
so the check for driver data being NULL can go away as it's always false.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210212171043.2136580-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/dimm.c')
-rw-r--r-- | drivers/nvdimm/dimm.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/nvdimm/dimm.c b/drivers/nvdimm/dimm.c index 7d4ddc4d9322..94be3ae1d29f 100644 --- a/drivers/nvdimm/dimm.c +++ b/drivers/nvdimm/dimm.c @@ -117,9 +117,6 @@ static int nvdimm_remove(struct device *dev) { struct nvdimm_drvdata *ndd = dev_get_drvdata(dev); - if (!ndd) - return 0; - nvdimm_bus_lock(dev); dev_set_drvdata(dev, NULL); nvdimm_bus_unlock(dev); |