From: Conor Dooley <conor@kernel.org>
To: Stephen Boyd <sboyd@kernel.org>
Cc: linux-riscv@lists.infradead.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 21:19:04 +0100 [thread overview]
Message-ID: <20240424-glazing-handsaw-4c303fef4f7e@spud> (raw)
In-Reply-To: <722f31da34e5e1cfef05fb966f6c8c96.sboyd@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1555 bytes --]
On Wed, Apr 24, 2024 at 11:33:32AM -0700, Stephen Boyd wrote:
> 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.
Ye, I dunno if it was sparse that yelled at me, but either it or the
compiler didn't approve. I don't really like the casting in and out, but
the alternative I don't find elegant either, so I picked the one I deemed
simpler. I'm happy to go with whichever you prefer.
And re: __force, AFAIU that's only required while discarding the
__iomem, so the cast into the platform_data has one:
adev->dev.platform_data = (__force void *)base;
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2024-04-24 20:19 UTC|newest]
Thread overview: 7+ 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 18:33 ` Stephen Boyd
2024-04-24 20:19 ` Conor Dooley [this message]
2024-04-24 21:09 ` Stephen Boyd
2024-04-24 21:16 ` Conor Dooley
2024-04-25 5:15 ` claudiu beznea
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=20240424-glazing-handsaw-4c303fef4f7e@spud \
--to=conor@kernel.org \
--cc=conor.dooley@microchip.com \
--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 \
--cc=sboyd@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox