[PATCH v4 8/8] reset: mchp: sparx5: set the dev member of the reset controller

Herve Codina posted 8 patches 1 year, 4 months ago
There is a newer version of this series
[PATCH v4 8/8] reset: mchp: sparx5: set the dev member of the reset controller
Posted by Herve Codina 1 year, 4 months ago
From: Clément Léger <clement.leger@bootlin.com>

In order to guarantee the device will not be deleted by the reset
controller consumer, set the dev member of the reset controller.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 drivers/reset/reset-microchip-sparx5.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/reset/reset-microchip-sparx5.c b/drivers/reset/reset-microchip-sparx5.c
index c4fe65291a43..1ef2aa1602e3 100644
--- a/drivers/reset/reset-microchip-sparx5.c
+++ b/drivers/reset/reset-microchip-sparx5.c
@@ -117,6 +117,7 @@ static int mchp_sparx5_reset_probe(struct platform_device *pdev)
 		return err;
 
 	ctx->rcdev.owner = THIS_MODULE;
+	ctx->rcdev.dev = &pdev->dev;
 	ctx->rcdev.nr_resets = 1;
 	ctx->rcdev.ops = &sparx5_reset_ops;
 	ctx->rcdev.of_node = dn;
-- 
2.45.0

Re: [PATCH v4 8/8] reset: mchp: sparx5: set the dev member of the reset controller
Posted by Steen Hegelund 1 year, 4 months ago
Hi Herve,

On Mon, 2024-08-05 at 12:17 +0200, Herve Codina wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
> 
> From: Clément Léger <clement.leger@bootlin.com>
> 
> In order to guarantee the device will not be deleted by the reset
> controller consumer, set the dev member of the reset controller.
> 
> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
> Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> ---
>  drivers/reset/reset-microchip-sparx5.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/reset/reset-microchip-sparx5.c
> b/drivers/reset/reset-microchip-sparx5.c
> index c4fe65291a43..1ef2aa1602e3 100644
> --- a/drivers/reset/reset-microchip-sparx5.c
> +++ b/drivers/reset/reset-microchip-sparx5.c
> @@ -117,6 +117,7 @@ static int mchp_sparx5_reset_probe(struct
> platform_device *pdev)
>                 return err;
> 
>         ctx->rcdev.owner = THIS_MODULE;
> +       ctx->rcdev.dev = &pdev->dev;
>         ctx->rcdev.nr_resets = 1;
>         ctx->rcdev.ops = &sparx5_reset_ops;
>         ctx->rcdev.of_node = dn;
> --
> 2.45.0
> 

Looks good to me.

Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>

BR
Steen