[PATCH] pcmcia: ds: Remove if with always false condition

From: Uwe Kleine-König
Date: Mon Mar 01 2021 - 17:41:59 EST


pcmcia_device_remove() is only ever called by the driver core with
dev->driver pointing to a valid driver. (And even if dev->driver was
NULL, p_drv wouldn't be NULL as p_drv is assigned as follows:

p_drv = to_pcmcia_drv(dev->driver);

and to_pcmcia_drv is a container_of operation on struct
pcmcia_driver::drv which isn't the first member in struct
pcmcia_driver.)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
---
drivers/pcmcia/ds.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 72114907c0e4..bb096a3b76aa 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -371,9 +371,6 @@ static int pcmcia_device_remove(struct device *dev)
pcmcia_card_remove(p_dev->socket, p_dev);

/* detach the "instance" */
- if (!p_drv)
- return 0;
-
if (p_drv->remove)
p_drv->remove(p_dev);

--
2.30.0