From: Lee Jones <lee@kernel.org>
To: Karel Balej <karelb@gimli.ms.mff.cuni.cz>
Cc: "Karel Balej" <balejk@matfyz.cz>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
"Duje Mihanović" <duje.mihanovic@skole.hr>,
~postmarketos/upstreaming@lists.sr.ht,
phone-devel@vger.kernel.org
Subject: Re: [RFC PATCH 1/5] mfd: 88pm88x: differences with respect to the PMIC RFC series
Date: Fri, 12 Jan 2024 07:58:28 +0000 [thread overview]
Message-ID: <20240112075828.GI1920897@google.com> (raw)
In-Reply-To: <CYBZKXR1F4QP.197Y9Y09Z1CLP@gimli.ms.mff.cuni.cz>
On Thu, 11 Jan 2024, Karel Balej wrote:
> On Thu Jan 11, 2024 at 4:25 PM CET, Lee Jones wrote:
>
> [...]
>
> > > > > diff --git a/include/linux/mfd/88pm88x.h b/include/linux/mfd/88pm88x.h
> > > > > index a34c57447827..9a335f6b9c07 100644
> > > > > --- a/include/linux/mfd/88pm88x.h
> > > > > +++ b/include/linux/mfd/88pm88x.h
> > > > > @@ -49,6 +49,8 @@ struct pm88x_data {
> > > > > unsigned int whoami;
> > > > > struct reg_sequence *presets;
> > > > > unsigned int num_presets;
> > > > > + struct mfd_cell *devs;
> > > > > + unsigned int num_devs;
> > > >
> > > > Why are you adding extra abstraction?
> > >
> > > Right, this is probably not necessary now since I'm only implementing
> > > support for one of the chips - it's just that I keep thinking about it
> > > as a driver for both of them and thus tend to write it a bit more
> > > abstractly. Shall I then drop this and also the `presets` member which
> > > is also chip-specific?
> >
> > Even if you were to support multiple devices, this strategy is unusual
> > and isn't likely to be accepted.
>
> May I please ask what the recommended strategy is then? `switch`ing on
> the chip ID? I have taken this approach because it seemed to produce a
> cleaner/more straightforward code in comparison to that. Or are you only
> talking about the chip cells/subdevices in particular?
I'd have to see the implementation, but the general exception I'm taking
here is storing the use-once MFD cell data inside a data structure. If
you were to match on device ID it's *sometimes* acceptable to store the
pointers in local variables.
--
Lee Jones [李琼斯]
next prev parent reply other threads:[~2024-01-12 7:58 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-28 9:39 [RFC PATCH 0/5] regulator: support for Marvell 88PM886 LDOs and bucks Karel Balej
2023-12-28 9:39 ` [RFC PATCH 1/5] mfd: 88pm88x: differences with respect to the PMIC RFC series Karel Balej
2024-01-11 10:54 ` Lee Jones
2024-01-11 15:06 ` Karel Balej
2024-01-11 15:25 ` Lee Jones
2024-01-11 15:36 ` Karel Balej
2024-01-12 7:58 ` Lee Jones [this message]
2023-12-28 9:39 ` [RFC PATCH 2/5] mfd: 88pm88x: initialize the regulators regmaps Karel Balej
2023-12-28 9:39 ` [RFC PATCH 3/5] dt-bindings: regulator: add documentation entry for 88pm88x-regulator Karel Balej
2024-01-04 9:25 ` Krzysztof Kozlowski
2024-01-04 9:26 ` Krzysztof Kozlowski
2023-12-28 9:39 ` [RFC PATCH 4/5] regulator: add 88pm88x regulators driver Karel Balej
2024-01-05 15:18 ` Mark Brown
2024-01-07 9:49 ` Karel Balej
2024-01-07 10:34 ` Krzysztof Kozlowski
2024-01-07 12:46 ` Karel Balej
2024-01-07 15:26 ` Mark Brown
2024-01-07 10:35 ` Krzysztof Kozlowski
2024-01-07 13:02 ` Karel Balej
2023-12-28 9:39 ` [RFC PATCH 5/5] MAINTAINERS: add entries for the " Karel Balej
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=20240112075828.GI1920897@google.com \
--to=lee@kernel.org \
--cc=balejk@matfyz.cz \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=duje.mihanovic@skole.hr \
--cc=karelb@gimli.ms.mff.cuni.cz \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=phone-devel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/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.