* [PATCH -next] staging: ks7010: remove unnecessary sdio_set_drvdata() function
@ 2023-08-11 9:17 Yang Yingliang
2023-08-11 20:38 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2023-08-11 9:17 UTC (permalink / raw)
To: linux-staging; +Cc: gregkh, yangyingliang
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@huawei.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] staging: ks7010: remove unnecessary sdio_set_drvdata() function
2023-08-11 9:17 [PATCH -next] staging: ks7010: remove unnecessary sdio_set_drvdata() function Yang Yingliang
@ 2023-08-11 20:38 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2023-08-11 20:38 UTC (permalink / raw)
To: Yang Yingliang; +Cc: linux-staging
On Fri, Aug 11, 2023 at 05:17:36PM +0800, Yang Yingliang wrote:
> 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.
Yes, but, many things happen after the remove function is called and the
driver core cleans up that field, so are you SURE that it is safe to
make these kinds of changes?
How have you tested all of these?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-11 20:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-11 9:17 [PATCH -next] staging: ks7010: remove unnecessary sdio_set_drvdata() function Yang Yingliang
2023-08-11 20:38 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox