char: xilinx_hwicap: Drop if block with always false condition
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 5 Jun 2023 09:20:46 +0000 (11:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Jun 2023 11:43:21 +0000 (13:43 +0200)
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>
drivers/char/xilinx_hwicap/xilinx_hwicap.c

index c4d75e6..87ece30 100644 (file)
@@ -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);