All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: "Cedric Encarnacion" <cedricjustine.encarnacion@analog.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-i2c@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-hwmon@vger.kernel.org, "Jean Delvare" <jdelvare@suse.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Delphine CC Chiu" <Delphine_CC_Chiu@wiwynn.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Radu Sabau" <radu.sabau@analog.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Alexis Czezar Torreno" <alexisczezar.torreno@analog.com>
Subject: Re: [PATCH 2/2] hwmon: (pmbus/adp1050): add support for adp1051, adp1055 and ltp8800
Date: Wed, 20 Nov 2024 18:29:00 +0200	[thread overview]
Message-ID: <Zz4OTBF66WfvnP2P@smile.fi.intel.com> (raw)
In-Reply-To: <4cfb8bd8-4ce7-4474-b7c0-0fd2693ce34f@roeck-us.net>

On Wed, Nov 20, 2024 at 06:53:58AM -0800, Guenter Roeck wrote:
> On 11/20/24 05:52, Andy Shevchenko wrote:
> > On Wed, Nov 20, 2024 at 11:58:26AM +0800, Cedric Encarnacion wrote:

...

> > > +#if IS_ENABLED(CONFIG_SENSORS_ADP1050_REGULATOR)
> > 
> > Why? Is the data type undefined without this?
> 
> Look into other drivers. That is how it is implemented there,
> and not really the point. One has to know about an alternative to use it.
> 
> > > +static const struct regulator_desc adp1050_reg_desc[] = {
> > > +	PMBUS_REGULATOR_ONE("vout"),
> > > +};
> > > +#endif /* CONFIG_SENSORS_ADP1050_REGULATOR */
> > 
> > Note, this can be dropped anyway in order to use PTR_IF() below, if required.
> 
> FWIW, PTR_IF() isn't widely used, and I for my part was not aware that
> it exists.

Yeah, it's a relatively new one...

...

> > > +#if IS_ENABLED(CONFIG_SENSORS_ADP1050_REGULATOR)
> > > +	.num_regulators = 1,
> > > +	.reg_desc = adp1050_reg_desc,
> > > +#endif
> > 
> > Ditto, are the fields not defined without the symbol?
> 
> They are, but they must be 0/NULL. PTR_IF() would be an alternative.
> It is a bit odd to use it for a non-pointer, but it is type-agnostic,
> so using it should be ok to avoid the #ifdefs. We should maybe adopt
> that mechanism for other PMBus drivers.

I see, thanks for elaboration on all of this.

...

> > Please, split this patch to at least two:
> > 1) Introduce chip_info;
> 
> That would really be "Use driver data to point to chip info".

I agree on the title, what I meant is the rough description of what
should be done in the change.

> > 2) add new devices.
> 
> I don't really care much about separating those two (after all, they are
> related), but adding regulator support to the driver is a major change
> and should be a separate patch. On top of that, it isn't even mentioned
> in the patch description.

Indeed, that's why I mentioned "at least" in the reply.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-11-20 16:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20  3:58 [PATCH 0/2] Add support for ADP1051/ADP1055 and LTP8800-1A/-2/-4A Cedric Encarnacion
2024-11-20  3:58 ` [PATCH 1/2] dt-bindings: hwmon: (pmbus/adp1050): Add bindings for adp1051, adp1055 and ltp8800 Cedric Encarnacion
2024-11-20 17:11   ` Conor Dooley
2024-11-20 17:35     ` Krzysztof Kozlowski
2024-11-20 18:07       ` Guenter Roeck
2024-11-20 18:39         ` Krzysztof Kozlowski
2024-11-25  2:44           ` Encarnacion, Cedric justine
2024-11-29  9:12             ` Nuno Sá
2024-11-20 18:00     ` Guenter Roeck
2024-11-23 19:56       ` Conor Dooley
2024-11-23 19:58         ` Conor Dooley
2024-11-25  2:44           ` Encarnacion, Cedric justine
2024-11-25 18:48             ` Conor Dooley
2024-11-20  3:58 ` [PATCH 2/2] hwmon: (pmbus/adp1050): add support " Cedric Encarnacion
2024-11-20  5:00   ` Randy Dunlap
2024-11-20 13:45     ` Andy Shevchenko
2024-11-20 13:52   ` Andy Shevchenko
2024-11-20 14:53     ` Guenter Roeck
2024-11-20 16:29       ` Andy Shevchenko [this message]
2024-11-25  3:07         ` Encarnacion, Cedric justine
2024-11-20 14:39   ` Guenter Roeck
2024-11-21 21:54   ` kernel test robot
2024-11-22 13:46   ` kernel test robot
2024-11-23  3:11   ` kernel test robot
2024-11-27  0:56   ` kernel test robot

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=Zz4OTBF66WfvnP2P@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=Delphine_CC_Chiu@wiwynn.com \
    --cc=alexisczezar.torreno@analog.com \
    --cc=cedricjustine.encarnacion@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=radu.sabau@analog.com \
    --cc=robh@kernel.org \
    --cc=u.kleine-koenig@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.