Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Uwe Kleine-König and committed by
Greg Kroah-Hartman
fe976c4a f52c9ccb

+1 -1
+1 -1
drivers/sh/superhyway/superhyway.c
··· 155 155 struct superhyway_device *shyway_dev = to_superhyway_device(dev); 156 156 struct superhyway_driver *shyway_drv = to_superhyway_driver(dev->driver); 157 157 158 - if (shyway_drv && shyway_drv->remove) 158 + if (shyway_drv->remove) 159 159 shyway_drv->remove(shyway_dev); 160 160 } 161 161