diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2021-07-30 22:10:33 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-08-05 15:37:03 +0300 |
commit | fe976c4aadae80e4a5a3f665de685ce4f0b0426c (patch) | |
tree | eb8f7c4158459142d39e676e7f92978f168cb233 /drivers | |
parent | f52c9ccb86237378d354f7bd71b6fcc9f3ff7f67 (diff) | |
download | linux-fe976c4aadae80e4a5a3f665de685ce4f0b0426c.tar.xz |
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: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210730191035.1455248-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/sh/superhyway/superhyway.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/sh/superhyway/superhyway.c b/drivers/sh/superhyway/superhyway.c index c0ab904c76ec..44324abe21da 100644 --- a/drivers/sh/superhyway/superhyway.c +++ b/drivers/sh/superhyway/superhyway.c @@ -155,7 +155,7 @@ static void superhyway_device_remove(struct device *dev) struct superhyway_device *shyway_dev = to_superhyway_device(dev); 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); } |