linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Max Staudt <max@enpas.org>
Cc: linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Jean Delvare <jdelvare@suse.com>,
	linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org,
	glaubitz@physik.fu-berlin.de
Subject: Re: [PATCH v3 2/3] hwmon/ltc2990: Generalise DT to fwnode support
Date: Thu, 15 Aug 2019 15:43:41 -0700	[thread overview]
Message-ID: <20190815224341.GA12420@roeck-us.net> (raw)
In-Reply-To: <6920f2da-3139-6fc8-b02c-3678cc17912e@enpas.org>

On Fri, Aug 16, 2019 at 12:19:42AM +0200, Max Staudt wrote:
> On 08/15/2019 02:58 PM, Max Staudt wrote:
> > -	if (of_node) {
> > -		ret = of_property_read_u32_array(of_node, "lltc,meas-mode",
> > -						 data->mode, 2);
> > +	if (i2c->dev.of_node || i2c->dev.fwnode) {
> 
> One more idea, would it be better here to do the following?
> 
> 	if (device_property_present(i2c->dev, "lltc,meas-mode")) {
> 		ret = of_property_read_u32_array(of_node, "lltc,meas-mode",
> 						 data->mode, 2);
> 	}
> 
> I'm happy to prepare a patch if you wish to have this in - just let me know whether it should be on top of the last one, or instead of it.

That would be semantically different. The property is currently mandatory.
The above code would make it optional. This might work:

	if (dev_fwnode(&i2c->dev)) {
		ret = device_property_read_u32_array(...);
		...
	}

Feel free to send another version of your patch.

Thanks,
Guenter

  reply	other threads:[~2019-08-15 22:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-15 12:58 [PATCH v3 1/3] i2c/busses: Add i2c-icy for I2C on m68k/Amiga Max Staudt
2019-08-15 12:58 ` [PATCH v3 2/3] hwmon/ltc2990: Generalise DT to fwnode support Max Staudt
2019-08-15 18:33   ` Guenter Roeck
2019-08-15 21:34     ` Max Staudt
2019-08-15 22:19   ` Max Staudt
2019-08-15 22:43     ` Guenter Roeck [this message]
2019-08-16  7:32       ` Geert Uytterhoeven
2019-08-16  8:37       ` Max Staudt
2019-08-16  9:07         ` [PATCH] " Max Staudt
2019-08-16 11:07           ` Geert Uytterhoeven
2019-08-16 12:26             ` Max Staudt
2019-08-16 12:36               ` Geert Uytterhoeven
2019-08-16 12:43                 ` Max Staudt
2019-08-16 13:24                   ` Guenter Roeck
2019-08-15 12:58 ` [PATCH v3 3/3] i2c/busses/i2c-icy: Add LTC2990 present on 2019 board revision Max Staudt
2019-08-16 11:51   ` Wolfram Sang
2019-08-16 12:34     ` Max Staudt
2019-08-16 16:09       ` Wolfram Sang
2019-08-19 11:22         ` Max Staudt

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=20190815224341.GA12420@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=max@enpas.org \
    --cc=wsa+renesas@sang-engineering.com \
    /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;
as well as URLs for NNTP newsgroup(s).