The driver core already unsets driver data after .remove() completes. So there is no reason to do this explicitly in the driver itself. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> --- drivers/of/unittest.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index b5a7a31d8bd2..2504092e8302 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -1639,7 +1639,6 @@ static int unittest_gpio_remove(struct platform_device *pdev) if (devptr->chip.base != -1) gpiochip_remove(&devptr->chip); - platform_set_drvdata(pdev, NULL); kfree(devptr); return 0; -- 2.39.2