diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-06-05 12:20:46 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-06-15 14:43:21 +0300 |
commit | 3d82dca0f27ac5a0bfbbce439bba5c6452f3b7da (patch) | |
tree | 28ceae7708afc0739edb7e3abb9fa720c0af3731 /drivers | |
parent | e8989a48ca5111122b73fe905baf07ea29f1c197 (diff) | |
download | linux-3d82dca0f27ac5a0bfbbce439bba5c6452f3b7da.tar.xz |
char: xilinx_hwicap: Drop if block with always false condition
hwicap_drv_remove() is only called for a device after hwicap_drv_probe()
returned 0. In that case dev_set_drvdata() was called (by hwicap_setup())
with a non-NULL value and so dev_get_drvdata() won't return NULL.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Michal Simek <michal.simek@amd.com>
Message-ID: <20230605092047.50472-2-u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/xilinx_hwicap/xilinx_hwicap.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c index c4d75e684be6..87ece300b2ca 100644 --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c @@ -810,8 +810,6 @@ static int hwicap_drv_remove(struct platform_device *pdev) struct hwicap_drvdata *drvdata; drvdata = dev_get_drvdata(dev); - if (!drvdata) - return 0; device_destroy(icap_class, drvdata->devt); cdev_del(&drvdata->cdev); |