The driver data will be cleared in device_unbind_cleanup() in driver core code. So the dev_set_drvdata(..., NULL) called in remove and error path in probe can be removed. Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx> --- drivers/staging/axis-fifo/axis-fifo.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c index 727b956aa231..b9dc3c01a5f3 100644 --- a/drivers/staging/axis-fifo/axis-fifo.c +++ b/drivers/staging/axis-fifo/axis-fifo.c @@ -899,7 +899,6 @@ static int axis_fifo_probe(struct platform_device *pdev) return 0; err_initial: - dev_set_drvdata(dev, NULL); return rc; } @@ -909,7 +908,6 @@ static void axis_fifo_remove(struct platform_device *pdev) struct axis_fifo *fifo = dev_get_drvdata(dev); misc_deregister(&fifo->miscdev); - dev_set_drvdata(dev, NULL); } static const struct of_device_id axis_fifo_of_match[] = { -- 2.25.1