From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A36EC3A589 for ; Wed, 21 Aug 2019 01:56:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65B7122DD6 for ; Wed, 21 Aug 2019 01:56:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727101AbfHUB4S (ORCPT ); Tue, 20 Aug 2019 21:56:18 -0400 Received: from anchovy2.45ru.net.au ([203.30.46.146]:49321 "EHLO anchovy2.45ru.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbfHUB4S (ORCPT ); Tue, 20 Aug 2019 21:56:18 -0400 Received: (qmail 14515 invoked by uid 5089); 21 Aug 2019 01:56:15 -0000 Received: by simscan 1.2.0 ppid: 14414, pid: 14415, t: 0.0643s scanners: regex: 1.2.0 attach: 1.2.0 clamav: 0.88.3/m:40/d:1950 Received: from unknown (HELO ?192.168.0.128?) (preid@electromag.com.au@203.59.235.95) by anchovy3.45ru.net.au with ESMTPA; 21 Aug 2019 01:56:15 -0000 Subject: Re: [PATCH 1/4] iio: adc: ina2xx: Define *device_node only once To: Michal Simek , linux-kernel@vger.kernel.org, monstr@monstr.eu, linux@roeck-us.net Cc: Colin Ian King , linux-iio@vger.kernel.org, =?UTF-8?Q?Stefan_Br=c3=bcns?= , Lars-Peter Clausen , Jonathan Cameron , Peter Meerwald-Stadler , Hartmut Knaack References: From: Phil Reid Message-ID: Date: Wed, 21 Aug 2019 09:56:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-AU Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > > 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