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=-15.5 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_2 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 B250FC433E9 for ; Sun, 21 Feb 2021 16:32:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8540F64DF0 for ; Sun, 21 Feb 2021 16:32:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230006AbhBUQcI (ORCPT ); Sun, 21 Feb 2021 11:32:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:55350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbhBUQcI (ORCPT ); Sun, 21 Feb 2021 11:32:08 -0500 Received: from archlinux (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (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 5874C60241; Sun, 21 Feb 2021 16:31:25 +0000 (UTC) Date: Sun, 21 Feb 2021 16:31:21 +0000 From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: robh+dt@kernel.org, Jonathan Cameron , Guenter Roeck , Lars-Peter Clausen Subject: Re: [RFC PATCH 9/9] iio: inkern: Drop io-channel-ranges dt property support Message-ID: <20210221163121.102e3edf@archlinux> In-Reply-To: <20201115192951.1073632-10-jic23@kernel.org> References: <20201115192951.1073632-1-jic23@kernel.org> <20201115192951.1073632-10-jic23@kernel.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Sun, 15 Nov 2020 19:29:51 +0000 Jonathan Cameron wrote: > From: Jonathan Cameron > > This property has been almost exclusively missused in mainline and > we don't actually have any instances of it being necessary. > > As such Rob Herring suggested we just drop it and I can't immediately > see any reason to disagree. > > If anyone has an out of tree dts file that makes use of this then let > me know. I'm not against keeping the code, but documenting it as a > deprecated property not to be used in new dts files. > > Note build tested only. If someone could give it a sanity check > on a platform that uses this interface that would be great. > If not I'll mock something up before applying this. > > Signed-off-by: Jonathan Cameron Hi all, I plan to apply this given no one has mentioned using it in out of tree dts files. If someone has time to sanity check I didn't actually mess up the patch below that would be great! Thanks, Jonathan > Cc: Guenter Roeck > Cc: Lars-Peter Clausen > --- > drivers/iio/inkern.c | 49 +++++++++++++++----------------------------- > 1 file changed, 17 insertions(+), 32 deletions(-) > > diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c > index ede99e0d5371..85a6f6103ee9 100644 > --- a/drivers/iio/inkern.c > +++ b/drivers/iio/inkern.c > @@ -184,40 +184,25 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np, > const char *name) > { > struct iio_channel *chan = NULL; > - > - /* Walk up the tree of devices looking for a matching iio channel */ > - while (np) { > - int index = 0; > - > - /* > - * For named iio channels, first look up the name in the > - * "io-channel-names" property. If it cannot be found, the > - * index will be an error code, and of_iio_channel_get() > - * will fail. > - */ > - if (name) > - index = of_property_match_string(np, "io-channel-names", > + int index = 0; > + > + /* > + * For named iio channels, first look up the name in the > + * "io-channel-names" property. If it cannot be found, the > + * index will be an error code, and of_iio_channel_get() > + * will fail. > + */ > + if (name) > + index = of_property_match_string(np, "io-channel-names", > name); > - chan = of_iio_channel_get(np, index); > - if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) > - break; > - else if (name && index >= 0) { > - pr_err("ERROR: could not get IIO channel %pOF:%s(%i)\n", > - np, name ? name : "", index); > - return NULL; > - } > + chan = of_iio_channel_get(np, index); > + if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) > + return chan; > + else if (name && index >= 0) > + pr_err("ERROR: could not get IIO channel %pOF:%s(%i)\n", > + np, name ? name : "", index); > > - /* > - * No matching IIO channel found on this node. > - * If the parent node has a "io-channel-ranges" property, > - * then we can try one of its channels. > - */ > - np = np->parent; > - if (np && !of_get_property(np, "io-channel-ranges", NULL)) > - return NULL; > - } > - > - return chan; > + return NULL; > } > > static struct iio_channel *of_iio_channel_get_all(struct device *dev) 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=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable 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 3943CC433DB for ; Sun, 21 Feb 2021 16:33:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EC80E60241 for ; Sun, 21 Feb 2021 16:33:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC80E60241 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=++az2lzI9a/h34vyua3Oys3AxJ9B2cVEaoWMEBRoR6o=; b=IEiD2f+wFyqgViyXqFDHg0T+9 xfFo0dZkH21P+xNRxrhxnYP79nO1L+dGjoZq3qPJlOnnaEQBA9PmJyzQ6DGXCKjfIdSKSAxij8Sj7 ESxYkPb9KsxzsjosfocL0UsH/jZrmo6btWQq/duumhsr4sGe0RWlZdchu1xUtTkQUh47V3eD4+o7f Y5AkDaZnq3NC2ZkNfgmWSQt7s0DGPDHLP+UdX4eboyWKi1w5hrW59t2aChxF1+QMeQEcdPY0pcHCT Z7frmWvMXyhqrbO2sB3C5G5y5No6WpLjUMiTTe+44W9V0unJviNf+f23G9W+NmzxpcnWj516S/uIr +oRxDewdg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lDrdq-0001in-F6; Sun, 21 Feb 2021 16:31:30 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lDrdn-0001iO-NS for linux-arm-kernel@lists.infradead.org; Sun, 21 Feb 2021 16:31:28 +0000 Received: from archlinux (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (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 5874C60241; Sun, 21 Feb 2021 16:31:25 +0000 (UTC) Date: Sun, 21 Feb 2021 16:31:21 +0000 From: Jonathan Cameron To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [RFC PATCH 9/9] iio: inkern: Drop io-channel-ranges dt property support Message-ID: <20210221163121.102e3edf@archlinux> In-Reply-To: <20201115192951.1073632-10-jic23@kernel.org> References: <20201115192951.1073632-1-jic23@kernel.org> <20201115192951.1073632-10-jic23@kernel.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210221_113127_955799_2660B304 X-CRM114-Status: GOOD ( 31.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robh+dt@kernel.org, Lars-Peter Clausen , Guenter Roeck , Jonathan Cameron Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, 15 Nov 2020 19:29:51 +0000 Jonathan Cameron wrote: > From: Jonathan Cameron > > This property has been almost exclusively missused in mainline and > we don't actually have any instances of it being necessary. > > As such Rob Herring suggested we just drop it and I can't immediately > see any reason to disagree. > > If anyone has an out of tree dts file that makes use of this then let > me know. I'm not against keeping the code, but documenting it as a > deprecated property not to be used in new dts files. > > Note build tested only. If someone could give it a sanity check > on a platform that uses this interface that would be great. > If not I'll mock something up before applying this. > > Signed-off-by: Jonathan Cameron Hi all, I plan to apply this given no one has mentioned using it in out of tree dts files. If someone has time to sanity check I didn't actually mess up the patch below that would be great! Thanks, Jonathan > Cc: Guenter Roeck > Cc: Lars-Peter Clausen > --- > drivers/iio/inkern.c | 49 +++++++++++++++----------------------------- > 1 file changed, 17 insertions(+), 32 deletions(-) > > diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c > index ede99e0d5371..85a6f6103ee9 100644 > --- a/drivers/iio/inkern.c > +++ b/drivers/iio/inkern.c > @@ -184,40 +184,25 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np, > const char *name) > { > struct iio_channel *chan = NULL; > - > - /* Walk up the tree of devices looking for a matching iio channel */ > - while (np) { > - int index = 0; > - > - /* > - * For named iio channels, first look up the name in the > - * "io-channel-names" property. If it cannot be found, the > - * index will be an error code, and of_iio_channel_get() > - * will fail. > - */ > - if (name) > - index = of_property_match_string(np, "io-channel-names", > + int index = 0; > + > + /* > + * For named iio channels, first look up the name in the > + * "io-channel-names" property. If it cannot be found, the > + * index will be an error code, and of_iio_channel_get() > + * will fail. > + */ > + if (name) > + index = of_property_match_string(np, "io-channel-names", > name); > - chan = of_iio_channel_get(np, index); > - if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) > - break; > - else if (name && index >= 0) { > - pr_err("ERROR: could not get IIO channel %pOF:%s(%i)\n", > - np, name ? name : "", index); > - return NULL; > - } > + chan = of_iio_channel_get(np, index); > + if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) > + return chan; > + else if (name && index >= 0) > + pr_err("ERROR: could not get IIO channel %pOF:%s(%i)\n", > + np, name ? name : "", index); > > - /* > - * No matching IIO channel found on this node. > - * If the parent node has a "io-channel-ranges" property, > - * then we can try one of its channels. > - */ > - np = np->parent; > - if (np && !of_get_property(np, "io-channel-ranges", NULL)) > - return NULL; > - } > - > - return chan; > + return NULL; > } > > static struct iio_channel *of_iio_channel_get_all(struct device *dev) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel