The driver data will be cleared in device_unbind_cleanup() in driver core code. So the sdio_set_drvdata(..., NULL) called in remove and error path in probe can be removed. Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx> --- drivers/staging/ks7010/ks7010_sdio.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index 9fb118e77a1f..74a0ad787f4a 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -1044,7 +1044,6 @@ static int ks7010_sdio_probe(struct sdio_func *func, sdio_disable_func(func); err_free_card: sdio_release_host(func); - sdio_set_drvdata(func, NULL); kfree(card); return -ENODEV; @@ -1118,7 +1117,6 @@ static void ks7010_sdio_remove(struct sdio_func *func) sdio_disable_func(func); sdio_release_host(func); err_free_card: - sdio_set_drvdata(func, NULL); kfree(card); } -- 2.25.1