From patchwork Thu Apr 14 19:02:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12813920 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2FB48C433EF for ; Thu, 14 Apr 2022 19:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=B9ANs/wd9AwCS+yhw9EaB73NkqAe3VD737dR5VQnM2M=; b=EWDIYFHOLFDy9/ TSHmgiTrFR4GRM1nEJZMnv5I4SsVoBooRPKbFhwn3P4XNh0XXqG+y5K1dbVj9yDxKwet336J/rq9d jWuCk1lz3/s4uKUmcYhfXzi0N1cCSyuX/IM7Nz/Anvyd90wjHw4bEWcfOxbtlvMct5JaIEIWpaor7 MzWfdNLPBHG10cP42DzdLpTykWHrGoaoPwB5tDdojDBF3refqlvG5Qou1gYJQk7E5r7ZeBej5Tlpr RtUzXTxovfDhDfnKxmXivA0h2j+iJfghPQER1IdM7tN2hcwMJJ/xSootXCRljJi2M/TyvreOUPC2s nN3XPoLSfMUXWEn/vY0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nf4kD-006xiX-W1; Thu, 14 Apr 2022 19:03:06 +0000 Received: from mga02.intel.com ([134.134.136.20]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nf4k0-006xZl-9t; Thu, 14 Apr 2022 19:02:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649962972; x=1681498972; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TdE1RKZsiTimWQo56IAW2eBaZpgN2e/gySOlkjZQK7w=; b=Sg+yvhztZ0ggPt1Vd1YuXRET65jMtI9pgdohUAoxcXLQEGQ7HEcrPv6P x0LuP+Blbw0HxiX6I+pTQTer7VbKnYYvAWM3ewJL7MxFyOeq/xGQH94fG cVQJCWpLIEmkuhb9Ktj8zCgo/6wPI/w3nUhmGPYDOFPDtAu2MKUvj/3up M85Fz9IX2abQCfuP/OEyvulR/g/HBHWKkOaTC6hBJb6fgvZoGV1mLjv9C x0K4NJGE+fJrAJreyKXai8JhemONGgBI892+Ct0It7DrSOOukw/+3jib9 t5zR6N5T+wl+QzwxHz73V4U+/nRk2fzrPlRcHQwu0Nw3ggKZlCUH4nkD1 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10317"; a="250308378" X-IronPort-AV: E=Sophos;i="5.90,260,1643702400"; d="scan'208";a="250308378" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2022 12:02:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,260,1643702400"; d="scan'208";a="645735755" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 14 Apr 2022 12:02:43 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 755FF144; Thu, 14 Apr 2022 22:02:43 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Neil Armstrong , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Bartosz Golaszewski , Marek Szyprowski Subject: [PATCH v5 2/6] pinctrl: armada-37xx: Switch to use fwnode instead of of_node Date: Thu, 14 Apr 2022 22:02:38 +0300 Message-Id: <20220414190242.22178-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220414190242.22178-1-andriy.shevchenko@linux.intel.com> References: <20220414190242.22178-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220414_120252_424804_C2BCC742 X-CRM114-Status: GOOD ( 15.60 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org GPIO library now accepts fwnode as a firmware node, so switch the driver to use it. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c index 08cad14042e2..110f70bce3fe 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -787,18 +788,13 @@ static int armada_37xx_gpiochip_register(struct platform_device *pdev, struct armada_37xx_pinctrl *info) { struct device *dev = &pdev->dev; - struct device_node *np; + struct fwnode_handle *fwnode; struct gpio_chip *gc; - int ret = -ENODEV; + int ret; - for_each_child_of_node(dev->of_node, np) { - if (of_find_property(np, "gpio-controller", NULL)) { - ret = 0; - break; - } - } - if (ret) - return ret; + fwnode = gpiochip_node_get_first(dev); + if (!fwnode) + return -ENODEV; info->gpio_chip = armada_37xx_gpiolib_chip; @@ -806,7 +802,7 @@ static int armada_37xx_gpiochip_register(struct platform_device *pdev, gc->ngpio = info->data->nr_pins; gc->parent = dev; gc->base = -1; - gc->of_node = np; + gc->fwnode = fwnode; gc->label = info->data->name; ret = armada_37xx_irqchip_register(pdev, info);