* [PATCH] staging: nvec: paz00: remove unneeded call to platform_set_drvdata()
@ 2023-08-09 15:42 Andrei Coardos
2023-08-10 4:59 ` Dan Carpenter
2023-10-10 16:13 ` Thierry Reding
0 siblings, 2 replies; 4+ messages in thread
From: Andrei Coardos @ 2023-08-09 15:42 UTC (permalink / raw)
To: linux-kernel, linux-staging, linux-tegra, ac100
Cc: gregkh, marvin24, alex, Andrei Coardos
This function call was found to be unnecessary as there is no equivalent
platform_get_drvdata() call to access the private data of the driver. Also,
the private data is defined in this driver, so there is no risk of it being
accessed outside of this driver file.
Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>
---
drivers/staging/nvec/nvec_paz00.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/nvec/nvec_paz00.c b/drivers/staging/nvec/nvec_paz00.c
index 55d59840fca4..9c01c51f0ab5 100644
--- a/drivers/staging/nvec/nvec_paz00.c
+++ b/drivers/staging/nvec/nvec_paz00.c
@@ -53,8 +53,6 @@ static int nvec_paz00_probe(struct platform_device *pdev)
led->cdev.flags |= LED_CORE_SUSPENDRESUME;
led->nvec = nvec;
- platform_set_drvdata(pdev, led);
-
ret = devm_led_classdev_register(&pdev->dev, &led->cdev);
if (ret < 0)
return ret;
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: nvec: paz00: remove unneeded call to platform_set_drvdata()
2023-08-09 15:42 [PATCH] staging: nvec: paz00: remove unneeded call to platform_set_drvdata() Andrei Coardos
@ 2023-08-10 4:59 ` Dan Carpenter
2023-08-20 20:47 ` Marc Dietrich
2023-10-10 16:13 ` Thierry Reding
1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2023-08-10 4:59 UTC (permalink / raw)
To: Andrei Coardos
Cc: linux-kernel, linux-staging, linux-tegra, ac100, gregkh, marvin24,
alex
On Wed, Aug 09, 2023 at 06:42:11PM +0300, Andrei Coardos wrote:
> This function call was found to be unnecessary as there is no equivalent
> platform_get_drvdata() call to access the private data of the driver. Also,
> the private data is defined in this driver, so there is no risk of it being
> accessed outside of this driver file.
>
> Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>
> ---
I think you are right, but why are we doing this? That one line is
hardly a huge eyesore. It's all risk and no reward.
Have you tested this change on real hardware?
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: nvec: paz00: remove unneeded call to platform_set_drvdata()
2023-08-10 4:59 ` Dan Carpenter
@ 2023-08-20 20:47 ` Marc Dietrich
0 siblings, 0 replies; 4+ messages in thread
From: Marc Dietrich @ 2023-08-20 20:47 UTC (permalink / raw)
To: Dan Carpenter
Cc: Andrei Coardos, linux-kernel, linux-staging, linux-tegra, ac100,
gregkh, marvin24, alex
Hi,
On Thu, 10 Aug 2023, Dan Carpenter wrote:
> On Wed, Aug 09, 2023 at 06:42:11PM +0300, Andrei Coardos wrote:
>> This function call was found to be unnecessary as there is no equivalent
>> platform_get_drvdata() call to access the private data of the driver. Also,
>> the private data is defined in this driver, so there is no risk of it being
>> accessed outside of this driver file.
>>
>> Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>
>> ---
>
> I think you are right, but why are we doing this? That one line is
> hardly a huge eyesore. It's all risk and no reward.
I guess this was placed in order to implement a module unload function,
but this was never done. The driver also seems to have found another
method to get its private data, so this can be safely removed.
> Have you tested this change on real hardware?
I just checked that it compiles and works on my AC100.
Thanks!
Marc
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: nvec: paz00: remove unneeded call to platform_set_drvdata()
2023-08-09 15:42 [PATCH] staging: nvec: paz00: remove unneeded call to platform_set_drvdata() Andrei Coardos
2023-08-10 4:59 ` Dan Carpenter
@ 2023-10-10 16:13 ` Thierry Reding
1 sibling, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2023-10-10 16:13 UTC (permalink / raw)
To: Andrei Coardos
Cc: linux-kernel, linux-staging, linux-tegra, ac100, gregkh, marvin24,
alex
[-- Attachment #1: Type: text/plain, Size: 607 bytes --]
On Wed, Aug 09, 2023 at 06:42:11PM +0300, Andrei Coardos wrote:
> This function call was found to be unnecessary as there is no equivalent
> platform_get_drvdata() call to access the private data of the driver. Also,
> the private data is defined in this driver, so there is no risk of it being
> accessed outside of this driver file.
>
> Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>
> ---
> drivers/staging/nvec/nvec_paz00.c | 2 --
> 1 file changed, 2 deletions(-)
Seems fine, and if Marc has tested it, that's good enough for me:
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-10-10 16:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-09 15:42 [PATCH] staging: nvec: paz00: remove unneeded call to platform_set_drvdata() Andrei Coardos
2023-08-10 4:59 ` Dan Carpenter
2023-08-20 20:47 ` Marc Dietrich
2023-10-10 16:13 ` Thierry Reding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).