From: Phil Reid <preid@electromag.com.au>
To: Michal Simek <michal.simek@xilinx.com>,
linux-kernel@vger.kernel.org, monstr@monstr.eu,
linux@roeck-us.net
Cc: "Colin Ian King" <colin.king@canonical.com>,
linux-iio@vger.kernel.org,
"Stefan Brüns" <stefan.bruens@rwth-aachen.de>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Jonathan Cameron" <jic23@kernel.org>,
"Peter Meerwald-Stadler" <pmeerw@pmeerw.net>,
"Hartmut Knaack" <knaack.h@gmx.de>
Subject: Re: [PATCH 1/4] iio: adc: ina2xx: Define *device_node only once
Date: Wed, 21 Aug 2019 09:56:03 +0800 [thread overview]
Message-ID: <fef37bf8-3c08-3bb2-b8f9-79c6447c9fac@electromag.com.au> (raw)
In-Reply-To: <c13fb8284b68cf3dbe309941d767aa7701aa4c3a.1566310292.git.michal.simek@xilinx.com>
On 20/08/2019 22:11, Michal Simek wrote:
> There is no reason to c&p full client->dev.of_node link when simple
> variable can keep it.
One comment
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> drivers/iio/adc/ina2xx-adc.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c
> index bdd7cba6f6b0..37058d9c2054 100644
> --- a/drivers/iio/adc/ina2xx-adc.c
> +++ b/drivers/iio/adc/ina2xx-adc.c
> @@ -951,6 +951,7 @@ static int ina2xx_probe(struct i2c_client *client,
> struct ina2xx_chip_info *chip;
> struct iio_dev *indio_dev;
> struct iio_buffer *buffer;
> + struct device_node *np = client->dev.of_node;
> unsigned int val;
> enum ina2xx_ids type;
> int ret;
> @@ -970,7 +971,7 @@ static int ina2xx_probe(struct i2c_client *client,
> return PTR_ERR(chip->regmap);
> }
>
> - if (client->dev.of_node)
> + if (np)
> type = (enum ina2xx_ids)of_device_get_match_data(&client->dev);
> else
> type = id->driver_data;
> @@ -978,7 +979,7 @@ static int ina2xx_probe(struct i2c_client *client,
>
> mutex_init(&chip->state_lock);
>
> - if (of_property_read_u32(client->dev.of_node,
> + if (of_property_read_u32(np,
> "shunt-resistor", &val) < 0) {
This will fit on one line <80 now.
> struct ina2xx_platform_data *pdata =
> dev_get_platdata(&client->dev);
> @@ -1016,7 +1017,7 @@ static int ina2xx_probe(struct i2c_client *client,
>
> indio_dev->modes = INDIO_DIRECT_MODE | INDIO_BUFFER_SOFTWARE;
> indio_dev->dev.parent = &client->dev;
> - indio_dev->dev.of_node = client->dev.of_node;
> + indio_dev->dev.of_node = np;
> if (id->driver_data == ina226) {
> indio_dev->channels = ina226_channels;
> indio_dev->num_channels = ARRAY_SIZE(ina226_channels);
>
--
Regards
Phil Reid
ElectroMagnetic Imaging Technology Pty Ltd
Development of Geophysical Instrumentation & Software
www.electromag.com.au
3 The Avenue, Midland WA 6056, AUSTRALIA
Ph: +61 8 9250 8100
Fax: +61 8 9250 7100
Email: preid@electromag.com.au
next prev parent reply other threads:[~2019-08-21 1:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-20 14:11 [PATCH 0/4] iio: adc: ina2xx: Improve device identification Michal Simek
2019-08-20 14:11 ` [PATCH 1/4] iio: adc: ina2xx: Define *device_node only once Michal Simek
2019-08-21 1:56 ` Phil Reid [this message]
2019-08-20 14:11 ` [PATCH 2/4] iio: adc: ina2xx: Setup better name then simple ina2xx Michal Simek
2019-08-21 2:10 ` Phil Reid
2019-08-21 8:36 ` Michal Simek
2019-08-20 14:11 ` [PATCH 4/4] iio: adc: ina2xx: Use label proper for device identification Michal Simek
2019-08-21 2:11 ` Phil Reid
2019-08-21 9:12 ` Michal Simek
2019-08-25 18:07 ` Jonathan Cameron
2019-08-27 3:55 ` Phil Reid
2019-08-27 6:14 ` Michal Simek
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=fef37bf8-3c08-3bb2-b8f9-79c6447c9fac@electromag.com.au \
--to=preid@electromag.com.au \
--cc=colin.king@canonical.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=michal.simek@xilinx.com \
--cc=monstr@monstr.eu \
--cc=pmeerw@pmeerw.net \
--cc=stefan.bruens@rwth-aachen.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 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).