All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Conor Dooley <conor@kernel.org>, linux-riscv@lists.infradead.org
Cc: conor@kernel.org, Conor Dooley <conor.dooley@microchip.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Daire McNamara <daire.mcnamara@microchip.com>,
	Michael Turquette <mturquette@baylibre.com>,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] clock, reset: microchip: move all mpfs reset code to the reset subsystem
Date: Wed, 24 Apr 2024 11:33:32 -0700	[thread overview]
Message-ID: <722f31da34e5e1cfef05fb966f6c8c96.sboyd@kernel.org> (raw)
In-Reply-To: <20240424-strangle-sharpener-34755c5e6e3e@spud>

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.

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Boyd <sboyd@kernel.org>
To: Conor Dooley <conor@kernel.org>, linux-riscv@lists.infradead.org
Cc: conor@kernel.org, Conor Dooley <conor.dooley@microchip.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Daire McNamara <daire.mcnamara@microchip.com>,
	Michael Turquette <mturquette@baylibre.com>,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] clock, reset: microchip: move all mpfs reset code to the reset subsystem
Date: Wed, 24 Apr 2024 11:33:32 -0700	[thread overview]
Message-ID: <722f31da34e5e1cfef05fb966f6c8c96.sboyd@kernel.org> (raw)
In-Reply-To: <20240424-strangle-sharpener-34755c5e6e3e@spud>

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.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2024-04-24 18:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24  8:42 [PATCH v2] clock, reset: microchip: move all mpfs reset code to the reset subsystem Conor Dooley
2024-04-24  8:42 ` Conor Dooley
2024-04-24 18:33 ` Stephen Boyd [this message]
2024-04-24 18:33   ` Stephen Boyd
2024-04-24 20:19   ` Conor Dooley
2024-04-24 20:19     ` Conor Dooley
2024-04-24 21:09     ` Stephen Boyd
2024-04-24 21:09       ` Stephen Boyd
2024-04-24 21:16       ` Conor Dooley
2024-04-24 21:16         ` Conor Dooley
2024-04-25  5:15         ` claudiu beznea
2024-04-25  5:15           ` claudiu beznea
2024-05-07 21:58 ` Stephen Boyd
2024-05-07 21:58   ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=722f31da34e5e1cfef05fb966f6c8c96.sboyd@kernel.org \
    --to=sboyd@kernel.org \
    --cc=conor.dooley@microchip.com \
    --cc=conor@kernel.org \
    --cc=daire.mcnamara@microchip.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.