linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] libnvdimm: simplify nvdimm_remove()
@ 2021-02-12 17:10 Uwe Kleine-König
  2021-02-12 17:10 ` [PATCH 2/2] libnvdimm: Make remove callback return void Uwe Kleine-König
  2021-02-17  1:40 ` [PATCH 1/2] libnvdimm: simplify nvdimm_remove() Dan Williams
  0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2021-02-12 17:10 UTC (permalink / raw)
  To: Dan Williams, Vishal Verma, Dave Jiang, Ira Weiny
  Cc: Andrew Morton, Greg Kroah-Hartman, kernel, linux-nvdimm,
	linux-kernel

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>
---
 drivers/nvdimm/dimm.c | 3 ---
 1 file changed, 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);

base-commit: 5c8fe583cce542aa0b84adc939ce85293de36e5e
-- 
2.29.2
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-17  3:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-12 17:10 [PATCH 1/2] libnvdimm: simplify nvdimm_remove() Uwe Kleine-König
2021-02-12 17:10 ` [PATCH 2/2] libnvdimm: Make remove callback return void Uwe Kleine-König
2021-02-17  3:37   ` Dan Williams
2021-02-17  1:40 ` [PATCH 1/2] libnvdimm: simplify nvdimm_remove() Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).