2021-12-27 09:46:32

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH v2 02/23] counter: ftm-quaddec: Drop unused platform_set_drvdata()

The driver doesn't ever use platform_get_drvdata, so drop this unused
call.

Signed-off-by: Uwe Kleine-König <[email protected]>
---
drivers/counter/ftm-quaddec.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/counter/ftm-quaddec.c b/drivers/counter/ftm-quaddec.c
index 5ef0478709cd..9272f7b58beb 100644
--- a/drivers/counter/ftm-quaddec.c
+++ b/drivers/counter/ftm-quaddec.c
@@ -269,8 +269,6 @@ static int ftm_quaddec_probe(struct platform_device *pdev)
if (!ftm)
return -ENOMEM;

- platform_set_drvdata(pdev, ftm);
-
io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!io) {
dev_err(&pdev->dev, "Failed to get memory region\n");
--
2.33.0



2021-12-28 17:31:33

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH v2 02/23] counter: ftm-quaddec: Drop unused platform_set_drvdata()

On Mon, 27 Dec 2021 10:45:05 +0100
Uwe Kleine-König <[email protected]> wrote:

> The driver doesn't ever use platform_get_drvdata, so drop this unused
> call.
>
> Signed-off-by: Uwe Kleine-König <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>

> ---
> drivers/counter/ftm-quaddec.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/counter/ftm-quaddec.c b/drivers/counter/ftm-quaddec.c
> index 5ef0478709cd..9272f7b58beb 100644
> --- a/drivers/counter/ftm-quaddec.c
> +++ b/drivers/counter/ftm-quaddec.c
> @@ -269,8 +269,6 @@ static int ftm_quaddec_probe(struct platform_device *pdev)
> if (!ftm)
> return -ENOMEM;
>
> - platform_set_drvdata(pdev, ftm);
> -
> io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> if (!io) {
> dev_err(&pdev->dev, "Failed to get memory region\n");


2021-12-29 06:42:47

by William Breathitt Gray

[permalink] [raw]
Subject: Re: [PATCH v2 02/23] counter: ftm-quaddec: Drop unused platform_set_drvdata()

On Mon, Dec 27, 2021 at 10:45:05AM +0100, Uwe Kleine-König wrote:
> The driver doesn't ever use platform_get_drvdata, so drop this unused
> call.
>
> Signed-off-by: Uwe Kleine-König <[email protected]>

Acked-by: William Breathitt Gray <[email protected]>

By the way, it should be possible to remove pdev from struct ftm_quaddec
because &ftm->pdev->dev is stored to ftm->counter.parent and can be
accessed from there if needed.

> ---
> drivers/counter/ftm-quaddec.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/counter/ftm-quaddec.c b/drivers/counter/ftm-quaddec.c
> index 5ef0478709cd..9272f7b58beb 100644
> --- a/drivers/counter/ftm-quaddec.c
> +++ b/drivers/counter/ftm-quaddec.c
> @@ -269,8 +269,6 @@ static int ftm_quaddec_probe(struct platform_device *pdev)
> if (!ftm)
> return -ENOMEM;
>
> - platform_set_drvdata(pdev, ftm);
> -
> io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> if (!io) {
> dev_err(&pdev->dev, "Failed to get memory region\n");
> --
> 2.33.0
>


Attachments:
(No filename) (1.01 kB)
signature.asc (833.00 B)
Download all attachments