Re: [PATCH v2] clock, reset: microchip: move all mpfs reset code to the reset subsystem

From: Stephen Boyd
Date: Wed Apr 24 2024 - 14:33:44 EST


Quoting Conor Dooley (2024-04-24 01:42:08)
> diff --git a/drivers/reset/reset-mpfs.c b/drivers/reset/reset-mpfs.c
> index 7f3fb2d472f4..710f9c1676f9 100644
> --- a/drivers/reset/reset-mpfs.c
> +++ b/drivers/reset/reset-mpfs.c
> @@ -121,11 +135,15 @@ static int mpfs_reset_probe(struct auxiliary_device *adev,
> {
> struct device *dev = &adev->dev;
> struct reset_controller_dev *rcdev;
> + struct mpfs_reset *rst;
>
> - rcdev = devm_kzalloc(dev, sizeof(*rcdev), GFP_KERNEL);
> - if (!rcdev)
> + rst = devm_kzalloc(dev, sizeof(*rst), GFP_KERNEL);
> + if (!rst)
> return -ENOMEM;
>
> + rst->base = (void __iomem *)adev->dev.platform_data;

Can use dev_get_platdata() here?

rst->base = (void __iomem *)dev_get_platdata(dev);

That's sad that a cast is necessary. Does it need __force as well? An
alternative would be to make a container struct for auxiliary_device and
put the pointer there.