Commit 8409f942 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Dan Williams
Browse files

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: default avatarUwe 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: default avatarDan Williams <dan.j.williams@intel.com>
parent 1048ba83
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -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);