Commit fe976c4a authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Greg Kroah-Hartman

sh: superhyway: Simplify check in remove callback

The driver core only calls a remove callback when the device was
successfully bound (aka probed) before. So dev->driver is never NULL.

(And even if it was NULL, to_superhyway_driver(NULL) isn't ...)
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210730191035.1455248-3-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f52c9ccb
...@@ -155,7 +155,7 @@ static void superhyway_device_remove(struct device *dev) ...@@ -155,7 +155,7 @@ static void superhyway_device_remove(struct device *dev)
struct superhyway_device *shyway_dev = to_superhyway_device(dev); struct superhyway_device *shyway_dev = to_superhyway_device(dev);
struct superhyway_driver *shyway_drv = to_superhyway_driver(dev->driver); struct superhyway_driver *shyway_drv = to_superhyway_driver(dev->driver);
if (shyway_drv && shyway_drv->remove) if (shyway_drv->remove)
shyway_drv->remove(shyway_dev); shyway_drv->remove(shyway_dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment