From patchwork Tue Jul 18 21:43:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 108228 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp6489717qge; Tue, 18 Jul 2017 14:56:28 -0700 (PDT) X-Received: by 10.84.129.103 with SMTP id 94mr3820534plb.63.1500414988416; Tue, 18 Jul 2017 14:56:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500414988; cv=none; d=google.com; s=arc-20160816; b=lDudV85MEokBkjfZjt49qfdF/VhERbq3ziqkvIpr61UrXzmw5WwWLBaGS3256KLpU0 Eg6XqJVQfH/Y1e6F0jlyUvtRKiWp7zuqPSuxH1YAqD7QaGPinJGRFx2U1igYefyNgLEI QUBBhdONb65tmHTL9sjn88F+N2yGA7BG6TfdGGeqfQ6vp9l7E9mc+sp93/dFv1VegMUI P9yyW/TSiWl5b06rAk6fF5NK9oDdJ84hEIOqLr6kklpUO1pvjRx0jGgfHXBqSdV9aRPP bXmfRvpm0yLmhE3S8dIeBtXJVM1Y5BWIgh9gsxWXzGG3C5tElOkbLLRRCSt9Kfjat6P0 5ruA== 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 :message-id:date:subject:cc:to:from:arc-authentication-results; bh=u4+9jMzbaKiQtFtKJCmHGC1i9vOuba0IdMzoBmyTJKs=; b=Zao5xs/c97VIH9Y9hi6IHgiT6JV9bi+RvEUonzbR5vdrnORn5IksHdjYqVbg/Fkp8D J6krQkEn8ww3y5m2GVq9mQmP/puboLz6H2G9fYmdzmVjOTqHovTThY5u+6EIh4w7z+kC 9B6wTcBPaYQ7L/Rdpy8FD9biImdDYMkAaiaNDszvEcIENh8wwKfYdG78LvP+ziGHMSnY yQfaXxeenDhCVRhaDxNaShcUVLqymHQ3tI1XPtG5kIl3W5gySxWMButTK3euKtjyzrAB zlINDX28s9QVR/qxhFkEev9F5k5Qp7xENEBme0LALdXNNKErxLfapvWu77nO1nu0FJcL NoAQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3si2652087pld.385.2017.07.18.14.56.28; Tue, 18 Jul 2017 14:56:28 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752903AbdGRV40 (ORCPT + 25 others); Tue, 18 Jul 2017 17:56:26 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35051 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752544AbdGRVoT (ORCPT ); Tue, 18 Jul 2017 17:44:19 -0400 Received: by mail-pg0-f66.google.com with SMTP id d193so4331866pgc.2; Tue, 18 Jul 2017 14:44:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=u4+9jMzbaKiQtFtKJCmHGC1i9vOuba0IdMzoBmyTJKs=; b=K8wAogMWhviyPdtm713NXrRUUxQIlaP91Ik1fafwvNDCTu985paW3+q+SBiXAzjhML 87ftaF5xbm421M3inheFzvSbvjs7iUYUifKfM6phCTnI0NPuIfvIRpSvWKD2bvPOk2FD LtR9CqcntCgXgSL9LDXAAX5WZoKgZpTlf2nJKWnu3oZguEVLNwjuK8uUwXAQW0ICUg2T ZFQW9WHFlXk0hq2pz5dFlUZaX+RJJzdfX0ovmTRhbkdQlOc/ok/zVryDXbrCleM+HQxM ejQHANtu8FMq4sIGI/PN3narij4H8qyrNfvmcdLqdTHMBbekZP2ENG6+1rXMWzxJ8xwL B7VQ== X-Gm-Message-State: AIVw112AUR8Oz5Zn+DUkjWryD2PVPztXJlFp7QnZm67vpM/tsOqQS3P7 A9Lfc3BZEnDeUw== X-Received: by 10.99.163.111 with SMTP id v47mr3768163pgn.74.1500414258279; Tue, 18 Jul 2017 14:44:18 -0700 (PDT) Received: from localhost.localdomain (24-223-123-72.static.usa-companies.net. [24.223.123.72]) by smtp.googlemail.com with ESMTPSA id r207sm7186560pfr.106.2017.07.18.14.44.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jul 2017 14:44:17 -0700 (PDT) From: Rob Herring To: Linus Walleij Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Tien Hock Loh , Alexandre Courbot , Gregory Fong , Brian Norris , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Michal Simek , =?utf-8?q?S=C3=B6ren_Brinkmann?= , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] gpio: Convert to using %pOF instead of full_name Date: Tue, 18 Jul 2017 16:43:03 -0500 Message-Id: <20170718214339.7774-23-robh@kernel.org> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: Rob Herring Cc: Tien Hock Loh Cc: Linus Walleij Cc: Alexandre Courbot Cc: Gregory Fong Cc: Brian Norris Cc: Florian Fainelli Cc: bcm-kernel-feedback-list@broadcom.com Cc: Michal Simek Cc: "Sören Brinkmann" Cc: linux-gpio@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org --- drivers/gpio/gpio-altera.c | 4 ++-- drivers/gpio/gpio-brcmstb.c | 2 +- drivers/gpio/gpio-ge.c | 6 ++---- drivers/gpio/gpio-grgpio.c | 2 +- drivers/gpio/gpio-mpc8xxx.c | 4 ++-- drivers/gpio/gpio-tb10x.c | 3 ++- drivers/gpio/gpio-tz1090.c | 10 ++++------ drivers/gpio/gpio-xilinx.c | 4 ++-- drivers/gpio/gpiolib-of.c | 29 ++++++++++++++--------------- drivers/gpio/gpiolib.c | 2 +- 10 files changed, 31 insertions(+), 35 deletions(-) -- 2.11.0 diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c index 17485dc20384..ccc02ed65b3c 100644 --- a/drivers/gpio/gpio-altera.c +++ b/drivers/gpio/gpio-altera.c @@ -324,8 +324,8 @@ static int altera_gpio_probe(struct platform_device *pdev) return 0; teardown: of_mm_gpiochip_remove(&altera_gc->mmchip); - pr_err("%s: registration failed with status %d\n", - node->full_name, ret); + pr_err("%pOF: registration failed with status %d\n", + node, ret); return ret; } diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c index e6489143721a..73f2c3be4657 100644 --- a/drivers/gpio/gpio-brcmstb.c +++ b/drivers/gpio/gpio-brcmstb.c @@ -483,7 +483,7 @@ static int brcmstb_gpio_probe(struct platform_device *pdev) gc->of_node = np; gc->owner = THIS_MODULE; - gc->label = np->full_name; + gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node); gc->base = gpio_base; gc->of_gpio_n_cells = 2; gc->of_xlate = brcmstb_gpio_of_xlate; diff --git a/drivers/gpio/gpio-ge.c b/drivers/gpio/gpio-ge.c index 8650b2916f87..6f5a7fe9787d 100644 --- a/drivers/gpio/gpio-ge.c +++ b/drivers/gpio/gpio-ge.c @@ -76,8 +76,7 @@ static int __init gef_gpio_probe(struct platform_device *pdev) } /* Setup pointers to chip functions */ - gc->label = devm_kstrdup(&pdev->dev, pdev->dev.of_node->full_name, - GFP_KERNEL); + gc->label = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%pOF", pdev->dev.of_node); if (!gc->label) { ret = -ENOMEM; goto err0; @@ -96,8 +95,7 @@ static int __init gef_gpio_probe(struct platform_device *pdev) return 0; err0: iounmap(regs); - pr_err("%s: GPIO chip registration failed\n", - pdev->dev.of_node->full_name); + pr_err("%pOF: GPIO chip registration failed\n", pdev->dev.of_node); return ret; }; diff --git a/drivers/gpio/gpio-grgpio.c b/drivers/gpio/gpio-grgpio.c index 7847dd34f86f..6544a16ab02e 100644 --- a/drivers/gpio/gpio-grgpio.c +++ b/drivers/gpio/gpio-grgpio.c @@ -367,7 +367,7 @@ static int grgpio_probe(struct platform_device *ofdev) gc->of_node = np; gc->owner = THIS_MODULE; gc->to_irq = grgpio_to_irq; - gc->label = np->full_name; + gc->label = devm_kasprintf(&ofdev->dev, GFP_KERNEL, "%pOF", np); gc->base = -1; err = of_property_read_u32(np, "nbits", &prop); diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c index 793518a30afe..8c93dec498fa 100644 --- a/drivers/gpio/gpio-mpc8xxx.c +++ b/drivers/gpio/gpio-mpc8xxx.c @@ -348,8 +348,8 @@ static int mpc8xxx_probe(struct platform_device *pdev) ret = gpiochip_add_data(gc, mpc8xxx_gc); if (ret) { - pr_err("%s: GPIO chip registration failed with status %d\n", - np->full_name, ret); + pr_err("%pOF: GPIO chip registration failed with status %d\n", + np, ret); goto err; } diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c index 80b6959ae995..091ffaaec635 100644 --- a/drivers/gpio/gpio-tb10x.c +++ b/drivers/gpio/gpio-tb10x.c @@ -191,7 +191,8 @@ static int tb10x_gpio_probe(struct platform_device *pdev) if (IS_ERR(tb10x_gpio->base)) return PTR_ERR(tb10x_gpio->base); - tb10x_gpio->gc.label = of_node_full_name(dn); + tb10x_gpio->gc.label = + devm_kasprintf(&pdev->dev, GFP_KERNEL, "%pOF", pdev->dev.of_node); tb10x_gpio->gc.parent = &pdev->dev; tb10x_gpio->gc.owner = THIS_MODULE; tb10x_gpio->gc.direction_input = tb10x_gpio_direction_in; diff --git a/drivers/gpio/gpio-tz1090.c b/drivers/gpio/gpio-tz1090.c index ca958e0f6909..22c5be65051f 100644 --- a/drivers/gpio/gpio-tz1090.c +++ b/drivers/gpio/gpio-tz1090.c @@ -527,13 +527,12 @@ static void tz1090_gpio_register_banks(struct tz1090_gpio *priv) ret = of_property_read_u32(node, "reg", &addr); if (ret) { - dev_err(priv->dev, "invalid reg on %s\n", - node->full_name); + dev_err(priv->dev, "invalid reg on %pOF\n", node); continue; } if (addr >= 3) { - dev_err(priv->dev, "index %u in %s out of range\n", - addr, node->full_name); + dev_err(priv->dev, "index %u in %pOF out of range\n", + addr, node); continue; } @@ -543,8 +542,7 @@ static void tz1090_gpio_register_banks(struct tz1090_gpio *priv) ret = tz1090_gpio_bank_probe(&info); if (ret) { - dev_err(priv->dev, "failure registering %s\n", - node->full_name); + dev_err(priv->dev, "failure registering %pOF\n", node); of_node_put(node); continue; } diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c index 14b2a62338ea..e8ec0e33a0a9 100644 --- a/drivers/gpio/gpio-xilinx.c +++ b/drivers/gpio/gpio-xilinx.c @@ -360,8 +360,8 @@ static int xgpio_probe(struct platform_device *pdev) /* Call the OF gpio helper to setup and register the GPIO device */ status = of_mm_gpiochip_add_data(np, &chip->mmchip, chip); if (status) { - pr_err("%s: error in probe function with status %d\n", - np->full_name, status); + pr_err("%pOF: error in probe function with status %d\n", + np, status); return status; } diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 54ce8dc58ad0..8cde02ed5fd5 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -78,8 +78,8 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np, ret = of_parse_phandle_with_args(np, propname, "#gpio-cells", index, &gpiospec); if (ret) { - pr_debug("%s: can't parse '%s' property of node '%s[%d]'\n", - __func__, propname, np->full_name, index); + pr_debug("%s: can't parse '%s' property of node '%pOF[%d]'\n", + __func__, propname, np, index); return ERR_PTR(ret); } @@ -93,8 +93,8 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np, if (IS_ERR(desc)) goto out; - pr_debug("%s: parsed '%s' property of node '%s[%d]' - status (%d)\n", - __func__, propname, np->full_name, index, + pr_debug("%s: parsed '%s' property of node '%pOF[%d]' - status (%d)\n", + __func__, propname, np, index, PTR_ERR_OR_ZERO(desc)); out: @@ -337,7 +337,7 @@ int of_mm_gpiochip_add_data(struct device_node *np, int ret = -ENOMEM; struct gpio_chip *gc = &mm_gc->gc; - gc->label = kstrdup(np->full_name, GFP_KERNEL); + gc->label = kasprintf(GFP_KERNEL, "%pOF", np); if (!gc->label) goto err0; @@ -362,8 +362,7 @@ int of_mm_gpiochip_add_data(struct device_node *np, err1: kfree(gc->label); err0: - pr_err("%s: GPIO chip registration failed with status %d\n", - np->full_name, ret); + pr_err("%pOF: GPIO chip registration failed with status %d\n", np, ret); return ret; } EXPORT_SYMBOL(of_mm_gpiochip_add_data); @@ -418,8 +417,8 @@ static int of_gpiochip_add_pin_range(struct gpio_chip *chip) group_names_propname, index, &name); if (strlen(name)) { - pr_err("%s: Group name of numeric GPIO ranges must be the empty string.\n", - np->full_name); + pr_err("%pOF: Group name of numeric GPIO ranges must be the empty string.\n", + np); break; } } @@ -434,14 +433,14 @@ static int of_gpiochip_add_pin_range(struct gpio_chip *chip) } else { /* npins == 0: special range */ if (pinspec.args[1]) { - pr_err("%s: Illegal gpio-range format.\n", - np->full_name); + pr_err("%pOF: Illegal gpio-range format.\n", + np); break; } if (!group_names) { - pr_err("%s: GPIO group range requested but no %s property.\n", - np->full_name, group_names_propname); + pr_err("%pOF: GPIO group range requested but no %s property.\n", + np, group_names_propname); break; } @@ -452,8 +451,8 @@ static int of_gpiochip_add_pin_range(struct gpio_chip *chip) break; if (!strlen(name)) { - pr_err("%s: Group name of GPIO group range cannot be the empty string.\n", - np->full_name); + pr_err("%pOF: Group name of GPIO group range cannot be the empty string.\n", + np); break; } diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 9568708a550b..4d911a5eea3e 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1775,7 +1775,7 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip, * conflicting triggers. Tell the user, and reset to NONE. */ if (WARN(of_node && type != IRQ_TYPE_NONE, - "%s: Ignoring %d default trigger\n", of_node->full_name, type)) + "%pOF: Ignoring %d default trigger\n", of_node, type)) type = IRQ_TYPE_NONE; if (has_acpi_companion(gpiochip->parent) && type != IRQ_TYPE_NONE) { acpi_handle_warn(ACPI_HANDLE(gpiochip->parent),