Skip to content

Commit

Permalink
libnvdimm/dimm: Simplify nvdimm_remove()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dan Williams <[email protected]>
  • Loading branch information
Uwe Kleine-König authored and djbw committed Feb 17, 2021
1 parent 1048ba8 commit 8409f94
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/nvdimm/dimm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8409f94

Please sign in to comment.