Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp571072ybh; Sat, 7 Mar 2020 05:11:42 -0800 (PST) X-Google-Smtp-Source: ADFU+vs1AyHq9KXDS0VFpAUcAtkCG9EC6DWF31APtrMfrA8plAmtKD2MqJoB2u2n0QqWOiJ53mQ/ X-Received: by 2002:a9d:3f5:: with SMTP id f108mr6671937otf.131.1583586702077; Sat, 07 Mar 2020 05:11:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583586702; cv=none; d=google.com; s=arc-20160816; b=Gs6Faz3NXZBNSfpHdhdeEKWSZHMnXUfL6RM3GSASS6iWU2WlswwB8J5IGPYfN3ECVf PwmCP3vEZQAjvofDSF6hhusOwKdkjwnCzEv7RzsDm/FnvJqufQWk/prWwPsi3Gi+IhMG sN/StoOUozldaSQr+7+rXu2s+Av2+X2Alt9B8D3gfN76DpB+unHEA6wjgfAG9eRe7qH1 AbF7dKBedXpfygAO5IFQarTZf25Fd8wj+gwp5ffmmMDggrfyDOTmver9yr7f5SNzTu62 5RLLvHeSNT6FTxDQlrsS/oNVqasMa3/dzCMxsVXFO2jGqST7gH7IrbU9b30AgDCWLOum Aexw== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=iIUAqG7FY/nAkfwtDFoTqobtjKRmFRCI4Sz0cGQ7AWA=; b=Wbswv+lZ8WE/nAu52ZCk6M7uuMFliRD9aUhiOlIbpWyoRrZIHmsb0DVT2ADuBUoyqg MRlXkfLjIchYe8pBN+HTEypbdPqVKm0LCf6CMZehQ8ejIyW+Wvtx7bskkf6INwxQi/5W kk9DW21mfXeTsxS+UUO5toYLPKFEVuiQSNKZie9O6SH+7pQZzUXMSYD3xZ3wRp4gKfFS gQ1GRPgZfm2IIwuz8WtvA/TA0s/9KkknbB4L6GAZFQg+MN+Auq90yCZXLXwhN9iaJ8V0 kbePo303Fw5l8+ZQ78K6qOF5au6ljFOZEhP8MJAOODCh4AjG4A6pUj2JQ73jgLSlA/xz GXfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JI8gn2W8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v81si1390860oia.114.2020.03.07.05.11.29; Sat, 07 Mar 2020 05:11:42 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=JI8gn2W8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726368AbgCGNKc (ORCPT + 99 others); Sat, 7 Mar 2020 08:10:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:42516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726105AbgCGNKc (ORCPT ); Sat, 7 Mar 2020 08:10:32 -0500 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E60F5206D5; Sat, 7 Mar 2020 13:10:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583586631; bh=nhycwUYvLcc1jqIwGlYnopw0ZrxYCKb/b2OY7Uj4FwY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JI8gn2W84y0ALPhrFDElK2x4Ln3mf7EtetJJZVMFop7mTZj3wlqzfklEL3NRHOxJE DSq6hSoMo1sH3hdbmwQeD5VGqkXjd8fRiBKxoNmz1Riw6uT2Z56oxSyKPOlWbryTw0 xL7Mc2eCYl8CoWIzEDkxJiLX/LkqVu9WcbJ4ly1w= Date: Sat, 7 Mar 2020 13:10:26 +0000 From: Jonathan Cameron To: "Ardelean, Alexandru" Cc: "stefan.popa@analog.com" , "Jonathan.Cameron@huawei.com" , "pmeerw@pmeerw.net" , "knaack.h@gmx.de" , "Hennerich, Michael" , "yuehaibing@huawei.com" , "lars@metafoo.de" , "linux-kernel@vger.kernel.org" , "linux-iio@vger.kernel.org" Subject: Re: [PATCH -next] iio:ad7797: Use correct attribute_group Message-ID: <20200307131026.39f55a61@archlinux> In-Reply-To: <8d7a7062af94a3531dd519bd60fe26c8530c6a43.camel@analog.com> References: <20200302133249.23152-1-yuehaibing@huawei.com> <8d7a7062af94a3531dd519bd60fe26c8530c6a43.camel@analog.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Mar 2020 06:35:28 +0000 "Ardelean, Alexandru" wrote: > On Mon, 2020-03-02 at 21:32 +0800, YueHaibing wrote: > > [External] > > > > It seems ad7797_attribute_group should be used in ad7797_info, > > according to commit ("iio:ad7793: Add support for the ad7796 and ad7797"). > > While the change looks good at first, I am thinking that this might introduce > another issue while fixing this one. > > It looks like the ad7797_attributes[] array may also require the > &iio_dev_attr_in_m_in_scale_available.dev_attr.attr attribute as well. > It looks like the available scales should be printed for AD7997 as well. > > That being said, this patch is fine as-is. > But it would require a patch [before-this-patch] to fix the ad7797_attributes > array. > > Something like this: > > static struct attribute *ad7797_attributes[] = { > &iio_const_attr_sampling_frequency_available_ad7797.dev_attr.attr, > + &iio_dev_attr_in_m_in_scale_available.dev_attr.attr, > NULL > }; > > I'm hoping I'm right about this one. I sometimes don't notice things too well. Agreed. Should have that addition as well. If not we'll successfully fix one issue but drop a valid interface at the same time... Thanks, Jonathan > > > > > Fixes: fd1a8b912841 ("iio:ad7793: Add support for the ad7796 and ad7797") > > Signed-off-by: YueHaibing > > --- > > drivers/iio/adc/ad7793.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/iio/adc/ad7793.c b/drivers/iio/adc/ad7793.c > > index b747db9..e5691e3 100644 > > --- a/drivers/iio/adc/ad7793.c > > +++ b/drivers/iio/adc/ad7793.c > > @@ -542,7 +542,7 @@ static const struct iio_info ad7797_info = { > > .read_raw = &ad7793_read_raw, > > .write_raw = &ad7793_write_raw, > > .write_raw_get_fmt = &ad7793_write_raw_get_fmt, > > - .attrs = &ad7793_attribute_group, > > + .attrs = &ad7797_attribute_group, > > .validate_trigger = ad_sd_validate_trigger, > > }; > >