Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1412520pxb; Sat, 16 Apr 2022 07:54:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9LTxDBys06dSt/hffFbsV2cWJI1u0yMApv2O6vWS6xv6/93G7LaG5WsRjJqJ7hSiRvgOj X-Received: by 2002:a17:907:9868:b0:6e8:7ae3:7f42 with SMTP id ko8-20020a170907986800b006e87ae37f42mr3008727ejc.224.1650120896136; Sat, 16 Apr 2022 07:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650120896; cv=none; d=google.com; s=arc-20160816; b=ajT4ELigZYiAQ2TxBAo72TZaNhG8Q0t/V08UxyNoII6SoHrKOSlSEKRGKwR1pyiG9B sUQ1F3oEbw/R1nLBwTmLxXndj1ZPldl2PG/rKxT8KQsciMDQ2JM3i/cgT8MAGmLel/OG 7/Qb2w3xwXQVYDScDgjvJBXoDyd3eFc1gZZZJtIb7AMVkzORk8aSbAeNqG3czrDVBrtz cTSRptKfIZ68YryPsNK720pJE8wCCKq35DnwOyRPRj7KFHsViln5R4VpCgzJoUjs0vG8 K2k6WzQr9J+YsFDdcRRD8sU7TjOtfm6UtCBbtKNrE6LO3m9dLUVAr/eCejX1ElBxpUzq NkCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=5n8c9DaFQiQ65RdxONM7R9sIw8iwaQeOFR7OoUDpF34=; b=aRQCRHXDeSUqV4ELfom3qRnkCDnuCdnLyM1I+zw301jueEqyIqSXBbFsyxc9fDZEjL iP6E+P3AGz1QT6gTTD+TSkiq5rAR/Ja2HylEw3A9BgXPuA12fqVjPi/srw9L3b/bAx3n y6+IMJ7U5k/TbT61HkglvCiZNRFMZHn9WCQaN5MibcysdSjdTxJ0b9G8FhI2mUJGYlLk JUSZGLITtI8WwHa18sXWI9mHhU1KeJk+WDDXTn/zC3/4X/Ch/5fQ1xQaL8/H4P2xE8dW ioe9tInVoHr/AV5Rxaqlp5U9q4FrXAnwVGXkjqPxU1UfMhecemam8m5DYIHRE56ggq57 uBdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eEq3+wV6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w14-20020a05640234ce00b0041cbe834f81si3299631edc.581.2022.04.16.07.54.31; Sat, 16 Apr 2022 07:54:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eEq3+wV6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231648AbiDPLLo (ORCPT + 99 others); Sat, 16 Apr 2022 07:11:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230149AbiDPLLn (ORCPT ); Sat, 16 Apr 2022 07:11:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD954A94F0; Sat, 16 Apr 2022 04:09:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6855560E73; Sat, 16 Apr 2022 11:09:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2194BC385A1; Sat, 16 Apr 2022 11:09:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650107350; bh=kh5r9cbB7fwoB+X+RIjkMvT5RGWxR4kbshMlqan9fhc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eEq3+wV6ZmtU1ECpF0H34v3j6A5kWRBtjOivkYZityg9O95Bf/gFIvPVCXM7M1sHN 64adcwBsroZiT5uD4Yjr0EE8W1/Xwr7mxQlvRgJANHlf3gbfiju3SjqlyPlTwCRWTA Vf+ldD7LL6s8nR0lpazmBhblR70biCs6j5PONRJDJYyw3WFjnCI2xtZ/061qdzODAI 10yfTS9j6P1oeC81nrCl8yDWgJ710bVrLj+FqZwAhAwN7V5lqZCdNQIiOCWx6fZZjz vHyV/fqKxIl/pJmuu5nkog0G21SN+AcR9wSKLxIe04tehBPOcHopy018K3Xp7ScS8l RQRtPzVo8iX5w== Date: Sat, 16 Apr 2022 12:17:08 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Lars-Peter Clausen Subject: Re: [PATCH v1 1/1] iio: core: Convert to use firmware node handle instead of OF node Message-ID: <20220416121708.37018ce9@jic23-huawei> In-Reply-To: <20220413180202.19220-1-andriy.shevchenko@linux.intel.com> References: <20220413180202.19220-1-andriy.shevchenko@linux.intel.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 Apr 2022 21:02:02 +0300 Andy Shevchenko wrote: > Switch the IIO core to use firmware node handle instead of OF node. > This will allow to get label from firmware on non-OF systems. > > Note, this doesn't change of_iio_*() APIs for now. > > Signed-off-by: Andy Shevchenko Applied to the togreg branch of iio.git and pushed out as testing for 0-day to poke at this and see if we missed anything. Thanks, Jonathan > --- > drivers/iio/industrialio-core.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c > index 2f48e9a97274..ffbe76806e07 100644 > --- a/drivers/iio/industrialio-core.c > +++ b/drivers/iio/industrialio-core.c > @@ -1893,20 +1893,22 @@ static const struct iio_buffer_setup_ops noop_ring_setup_ops; > int __iio_device_register(struct iio_dev *indio_dev, struct module *this_mod) > { > struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); > - const char *label; > + struct fwnode_handle *fwnode; > int ret; > > if (!indio_dev->info) > return -EINVAL; > > iio_dev_opaque->driver_module = this_mod; > - /* If the calling driver did not initialize of_node, do it here */ > - if (!indio_dev->dev.of_node && indio_dev->dev.parent) > - indio_dev->dev.of_node = indio_dev->dev.parent->of_node; > > - label = of_get_property(indio_dev->dev.of_node, "label", NULL); > - if (label) > - indio_dev->label = label; > + /* If the calling driver did not initialize firmware node, do it here */ > + if (dev_fwnode(&indio_dev->dev)) > + fwnode = dev_fwnode(&indio_dev->dev); > + else > + fwnode = dev_fwnode(indio_dev->dev.parent); > + device_set_node(&indio_dev->dev, fwnode); > + > + fwnode_property_read_string(fwnode, "label", &indio_dev->label); > > ret = iio_check_unique_scan_index(indio_dev); > if (ret < 0)