From patchwork Thu Aug 24 17:24:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 805583 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3xdWPM5Hzlz9s7m for ; Fri, 25 Aug 2017 03:24:23 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754031AbdHXRYW (ORCPT ); Thu, 24 Aug 2017 13:24:22 -0400 Received: from foss.arm.com ([217.140.101.70]:45000 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753968AbdHXRYW (ORCPT ); Thu, 24 Aug 2017 13:24:22 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 022F580D; Thu, 24 Aug 2017 10:24:22 -0700 (PDT) Received: from e110467-lin.cambridge.arm.com (e110467-lin.cambridge.arm.com [10.1.210.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C18153F3E1; Thu, 24 Aug 2017 10:24:20 -0700 (PDT) From: Robin Murphy To: linus.walleij@linaro.org Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, yvo@apm.com, qnguyen@apm.com Subject: [PATCH] gpio: xgene-sb: Tidy up fwnode usage Date: Thu, 24 Aug 2017 18:24:11 +0100 Message-Id: <2ccfa46003fb5cf5970dc5cd8771953d375fed77.1503594687.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.13.4.dirty Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Since f94277af03ea ("of/platform: Initialise dev->fwnode appropriately"), of_platform_device_create() already initialises dev->fwnode to that of the appropriate device_node, so within the driver we shouldn't need to care whether we probed via DT or ACPI. Signed-off-by: Robin Murphy --- Not tested, just an opportunity I happened to spot whilst looking at something else. drivers/gpio/gpio-xgene-sb.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c index 033258634b8c..82c3ee6da66a 100644 --- a/drivers/gpio/gpio-xgene-sb.c +++ b/drivers/gpio/gpio-xgene-sb.c @@ -130,10 +130,7 @@ static int xgene_gpio_sb_to_irq(struct gpio_chip *gc, u32 gpio) (gpio > HWIRQ_TO_GPIO(priv, priv->nirq))) return -ENXIO; - if (gc->parent->of_node) - fwspec.fwnode = of_node_to_fwnode(gc->parent->of_node); - else - fwspec.fwnode = gc->parent->fwnode; + fwspec.fwnode = gc->parent->fwnode; fwspec.param_count = 2; fwspec.param[0] = GPIO_TO_HWIRQ(priv, gpio); fwspec.param[1] = IRQ_TYPE_NONE; @@ -231,7 +228,6 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev) struct resource *res; void __iomem *regs; struct irq_domain *parent_domain = NULL; - struct fwnode_handle *fwnode; u32 val32; priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); @@ -285,13 +281,8 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); - if (pdev->dev.of_node) - fwnode = of_node_to_fwnode(pdev->dev.of_node); - else - fwnode = pdev->dev.fwnode; - priv->irq_domain = irq_domain_create_hierarchy(parent_domain, - 0, priv->nirq, fwnode, + 0, priv->nirq, pdev->dev.fwnode, &xgene_gpio_sb_domain_ops, priv); if (!priv->irq_domain) return -ENODEV;