Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp244342ybl; Tue, 20 Aug 2019 19:13:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+UN5zwfFNN9mNJM8pnP6PR5QhJNGYibJhL/Nd9UXh493r343ResidFsZ1t/YCrKGoSfeN X-Received: by 2002:a17:902:bb0d:: with SMTP id l13mr656108pls.176.1566353601626; Tue, 20 Aug 2019 19:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566353601; cv=none; d=google.com; s=arc-20160816; b=fZ/taMUYffNIFjSWyPrXidZlYhwniuohDOrxWIqRVdXJepMd/F3eV/+9Qm1m3CiV3J LRmaqirz0IJW1PqPOTPnls4fR3eR0fYCCLsB60ZDJkCWxlGtmY48mx8uGUuKPiAw+kky PGELUbrKWj+3xPEbUMyqstktJyZ6FCZtnHCDa6qU1wXxBPsUP200vyVKz09urBKEwNhi BIMUnOiErQiZtcl69TyYa+75xgaYkY6kD4pk7otx7KvRQavAaoLOjpZqQh6vODImX465 tWDfNvwYdENLdu6Vqt+8nP0ZgoPQwJZR0vRtA0HiqbkcxbysJBc/0LfAtFlqAKgF1bhr kkgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ngozbUdaXADFYwZt/O03MapqIxl4UNoye3aa4xtUBws=; b=TisusqybJW2WIdGb2PDYtWaIJK6QxA6TkcT2vV+0+44VmJsabF7K7o/U3udj2XcJIo J1OjOye6IDcc1o51Mtzg3iOz/G3mG9HPuZMOVrGSwUaKSZr2XyD/o1vxdyPaXjI7rTYD TZ+8Dl9IbfyJX2BJNEVRZS1q0BVppsH/xWxWYipqREXDiWbbsdF9W2hzO957lgthRkps 0donl+t7zvy1QqTmbXebD+144jUj3k9n/PfPNgEkJpH6iyGqEcn0yi4EgtmuqX/ytAQj kE33hYGUUhw1PHYGKDQUyMJnSTbTvg4q++TjDxV6DpcAHK+ynV8zdX0XivUWMffMTDVu uVMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si13582136plg.31.2019.08.20.19.13.07; Tue, 20 Aug 2019 19:13:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726869AbfHUCLu (ORCPT + 99 others); Tue, 20 Aug 2019 22:11:50 -0400 Received: from anchovy2.45ru.net.au ([203.30.46.146]:55480 "EHLO anchovy2.45ru.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726546AbfHUCLu (ORCPT ); Tue, 20 Aug 2019 22:11:50 -0400 Received: (qmail 21683 invoked by uid 5089); 21 Aug 2019 02:11:48 -0000 Received: by simscan 1.2.0 ppid: 21579, pid: 21580, t: 0.0514s 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 02:11:47 -0000 Subject: Re: [PATCH 4/4] iio: adc: ina2xx: Use label proper for device identification 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: <0542b562a813c5c22c42484ac24bbb626ac3c022.1566310292.git.michal.simek@xilinx.com> From: Phil Reid Message-ID: <970c3988-24e4-26c2-9027-d8ff40c3a9bb@electromag.com.au> Date: Wed, 21 Aug 2019 10:11:43 +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: <0542b562a813c5c22c42484ac24bbb626ac3c022.1566310292.git.michal.simek@xilinx.com> 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: > Add support for using label property for easier device identification via > iio framework. > > Signed-off-by: Michal Simek > --- > > drivers/iio/adc/ina2xx-adc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c > index 7c7c63677bf4..077c54915f70 100644 > --- a/drivers/iio/adc/ina2xx-adc.c > +++ b/drivers/iio/adc/ina2xx-adc.c > @@ -1033,7 +1033,7 @@ static int ina2xx_probe(struct i2c_client *client, > snprintf(chip->name, sizeof(chip->name), "%s-%s", > client->name, dev_name(&client->dev)); > > - indio_dev->name = chip->name; > + indio_dev->name = of_get_property(np, "label", NULL) ? : chip->name; > indio_dev->setup_ops = &ina2xx_setup_ops; > > buffer = devm_iio_kfifo_allocate(&indio_dev->dev); > I like this personally. It'd be nice if it was a core function so it could be an opt in to any iio device. Don't know how well received that'd be thou. -- Regards Phil Reid