From: Uwe Kleine-König Date: Fri, 30 Jul 2021 19:10:33 +0000 (+0200) Subject: sh: superhyway: Simplify check in remove callback X-Git-Tag: howlett/maple/20220722_2~2447^2~13 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fe976c4aadae80e4a5a3f665de685ce4f0b0426c;p=users%2Fjedix%2Flinux-maple.git 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 Link: https://lore.kernel.org/r/20210730191035.1455248-3-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman --- 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); }