From patchwork Tue Jul 18 21:43:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 9849705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0B66660392 for ; Tue, 18 Jul 2017 21:49:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7CC9285F7 for ; Tue, 18 Jul 2017 21:49:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC6CA285FE; Tue, 18 Jul 2017 21:49:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E88DF285F7 for ; Tue, 18 Jul 2017 21:49:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753073AbdGRVtS (ORCPT ); Tue, 18 Jul 2017 17:49:18 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33291 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752871AbdGRVoz (ORCPT ); Tue, 18 Jul 2017 17:44:55 -0400 Received: by mail-pf0-f195.google.com with SMTP id e199so4072452pfh.0; Tue, 18 Jul 2017 14:44:54 -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; bh=SmAYXihT6kbzhEZDbcWyGTW+vhlq+1m+iiE+jnKnmVo=; b=ms8A22aDrT1IApnkLhMuRRDcYCkk1qiIutByxpbaJ3BS7+p+EQl1hcV0Kdjl1g+86r fBL7SQ8A9WaEwPa9AAjGiDwYnKLSRhjsxI7E6MjU4Bd5af8uQxwpWYQh0v5ev7bseoHW urpzyqQ0BidRlSfQKNVv2bz2D7ZnTWGYPkGDByY6zCuNoTEN1D28I75D/WPXXLKw6uMZ wwak1BtT3NmFOSnrbNikYt4cypvAwknVuaHdoLvq1EtpGL90lrXOcsFXL1mPDe6zF6jn tRYlV+KpefRfUq6us1SQKtAGEdrjNQyqRfAKcSIEaY40gAO7Dw/GjwGtMlCjG2gw+R0s b2Tw== X-Gm-Message-State: AIVw111a3gou+TPS/JokvZXSoe3yoKuF8a6H63IXVEjCjFKVHlPNUwNw Gm67ihJ1H28VBw== X-Received: by 10.101.69.203 with SMTP id m11mr3723462pgr.105.1500414294558; Tue, 18 Jul 2017 14:44:54 -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.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jul 2017 14:44:53 -0700 (PDT) From: Rob Herring To: Linus Walleij Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Lee Jones , Eric Anholt , Stefan Wahren , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Ludovic Desroches , Patrice Chotard , Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Laurent Pinchart , Geert Uytterhoeven , Barry Song , linux-gpio@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@stlinux.com, linux-samsung-soc@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH] pinctrl: Convert to using %pOF instead of full_name Date: Tue, 18 Jul 2017 16:43:23 -0500 Message-Id: <20170718214339.7774-43-robh@kernel.org> X-Mailer: git-send-email 2.11.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: Linus Walleij Cc: Lee Jones Cc: Eric Anholt Cc: Stefan Wahren Cc: Florian Fainelli Cc: Ray Jui Cc: Scott Branden Cc: bcm-kernel-feedback-list@broadcom.com Cc: Ludovic Desroches Cc: Patrice Chotard Cc: Tomasz Figa Cc: Krzysztof Kozlowski Cc: Sylwester Nawrocki Cc: Laurent Pinchart Cc: Geert Uytterhoeven Cc: Barry Song Cc: linux-gpio@vger.kernel.org Cc: linux-rpi-kernel@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: kernel@stlinux.com Cc: linux-samsung-soc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org Acked-by: Krzysztof Kozlowski Acked-by: Ludovic Desroches Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Acked-by: Eric Anholt --- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 25 +++++++++++-------------- drivers/pinctrl/devicetree.c | 4 ++-- drivers/pinctrl/freescale/pinctrl-imx.c | 8 +++----- drivers/pinctrl/pinconf-generic.c | 7 +++---- drivers/pinctrl/pinctrl-at91-pio4.c | 11 +++++------ drivers/pinctrl/pinctrl-st.c | 2 +- drivers/pinctrl/pinctrl-tb10x.c | 4 ++-- drivers/pinctrl/samsung/pinctrl-samsung.c | 6 +++--- drivers/pinctrl/sh-pfc/pinctrl.c | 2 +- drivers/pinctrl/sirf/pinctrl-sirf.c | 6 +++--- 10 files changed, 34 insertions(+), 41 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 230883168e99..3e71e5d782ee 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -692,8 +692,7 @@ static int bcm2835_pctl_dt_node_to_map_func(struct bcm2835_pinctrl *pc, struct pinctrl_map *map = *maps; if (fnum >= ARRAY_SIZE(bcm2835_functions)) { - dev_err(pc->dev, "%s: invalid brcm,function %d\n", - of_node_full_name(np), fnum); + dev_err(pc->dev, "%pOF: invalid brcm,function %d\n", np, fnum); return -EINVAL; } @@ -713,8 +712,7 @@ static int bcm2835_pctl_dt_node_to_map_pull(struct bcm2835_pinctrl *pc, unsigned long *configs; if (pull > 2) { - dev_err(pc->dev, "%s: invalid brcm,pull %d\n", - of_node_full_name(np), pull); + dev_err(pc->dev, "%pOF: invalid brcm,pull %d\n", np, pull); return -EINVAL; } @@ -745,8 +743,7 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, pins = of_find_property(np, "brcm,pins", NULL); if (!pins) { - dev_err(pc->dev, "%s: missing brcm,pins property\n", - of_node_full_name(np)); + dev_err(pc->dev, "%pOF: missing brcm,pins property\n", np); return -EINVAL; } @@ -755,8 +752,8 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, if (!funcs && !pulls) { dev_err(pc->dev, - "%s: neither brcm,function nor brcm,pull specified\n", - of_node_full_name(np)); + "%pOF: neither brcm,function nor brcm,pull specified\n", + np); return -EINVAL; } @@ -766,15 +763,15 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, if (num_funcs > 1 && num_funcs != num_pins) { dev_err(pc->dev, - "%s: brcm,function must have 1 or %d entries\n", - of_node_full_name(np), num_pins); + "%pOF: brcm,function must have 1 or %d entries\n", + np, num_pins); return -EINVAL; } if (num_pulls > 1 && num_pulls != num_pins) { dev_err(pc->dev, - "%s: brcm,pull must have 1 or %d entries\n", - of_node_full_name(np), num_pins); + "%pOF: brcm,pull must have 1 or %d entries\n", + np, num_pins); return -EINVAL; } @@ -793,8 +790,8 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, if (err) goto out; if (pin >= ARRAY_SIZE(bcm2835_gpio_pins)) { - dev_err(pc->dev, "%s: invalid brcm,pins value %d\n", - of_node_full_name(np), pin); + dev_err(pc->dev, "%pOF: invalid brcm,pins value %d\n", + np, pin); err = -EINVAL; goto out; } diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c index 0e5c9f14a706..0a20afc2210c 100644 --- a/drivers/pinctrl/devicetree.c +++ b/drivers/pinctrl/devicetree.c @@ -117,8 +117,8 @@ static int dt_to_map_one_config(struct pinctrl *p, for (;;) { np_pctldev = of_get_next_parent(np_pctldev); if (!np_pctldev || of_node_is_root(np_pctldev)) { - dev_info(p->dev, "could not find pctldev for node %s, deferring probe\n", - np_config->full_name); + dev_info(p->dev, "could not find pctldev for node %pOF, deferring probe\n", + np_config); of_node_put(np_pctldev); /* OK let's just assume this will appear later then */ return -EPROBE_DEFER; diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 72aca758f4c6..1f0095a69407 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -573,16 +573,14 @@ static int imx_pinctrl_parse_groups(struct device_node *np, list = of_get_property(np, "pins", &size); if (!list) { dev_err(info->dev, - "no fsl,pins and pins property in node %s\n", - np->full_name); + "no fsl,pins and pins property in node %pOF\n", np); return -EINVAL; } } /* we do not check return since it's safe node passed down */ if (!size || size % pin_size) { - dev_err(info->dev, "Invalid fsl,pins or pins property in node %s\n", - np->full_name); + dev_err(info->dev, "Invalid fsl,pins or pins property in node %pOF\n", np); return -EINVAL; } @@ -666,7 +664,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np, func->name = np->name; func->num_group_names = of_get_child_count(np); if (func->num_group_names == 0) { - dev_err(info->dev, "no groups defined in %s\n", np->full_name); + dev_err(info->dev, "no groups defined in %pOF\n", np); return -EINVAL; } func->group_names = devm_kcalloc(info->dev, func->num_group_names, diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index fc0c230aa11f..4cf901c78130 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c @@ -316,16 +316,15 @@ int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev, if (ret < 0) { /* EINVAL=missing, which is fine since it's optional */ if (ret != -EINVAL) - dev_err(dev, "%s: could not parse property function\n", - of_node_full_name(np)); + dev_err(dev, "%pOF: could not parse property function\n", + np); function = NULL; } ret = pinconf_generic_parse_dt_config(np, pctldev, &configs, &num_configs); if (ret < 0) { - dev_err(dev, "%s: could not parse node property\n", - of_node_full_name(np)); + dev_err(dev, "%pOF: could not parse node property\n", np); return ret; } diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index dc8591543dee..b1ca838dd80a 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c @@ -494,8 +494,8 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev, ret = pinconf_generic_parse_dt_config(np, pctldev, &configs, &num_configs); if (ret < 0) { - dev_err(pctldev->dev, "%s: could not parse node property\n", - of_node_full_name(np)); + dev_err(pctldev->dev, "%pOF: could not parse node property\n", + np); return ret; } @@ -504,8 +504,7 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev, num_pins = pins->length / sizeof(u32); if (!num_pins) { - dev_err(pctldev->dev, "no pins found in node %s\n", - of_node_full_name(np)); + dev_err(pctldev->dev, "no pins found in node %pOF\n", np); ret = -EINVAL; goto exit; } @@ -584,8 +583,8 @@ static int atmel_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, if (ret < 0) { pinctrl_utils_free_map(pctldev, *map, *num_maps); - dev_err(pctldev->dev, "can't create maps for node %s\n", - np_config->full_name); + dev_err(pctldev->dev, "can't create maps for node %pOF\n", + np_config); } return ret; diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index 3ae8066bc127..1703977de7cf 100644 --- a/drivers/pinctrl/pinctrl-st.c +++ b/drivers/pinctrl/pinctrl-st.c @@ -1537,7 +1537,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info, return err; } } else { - dev_info(dev, "No IRQ support for %s bank\n", np->full_name); + dev_info(dev, "No IRQ support for %pOF bank\n", np); } return 0; diff --git a/drivers/pinctrl/pinctrl-tb10x.c b/drivers/pinctrl/pinctrl-tb10x.c index edfba506e958..09d35006acb2 100644 --- a/drivers/pinctrl/pinctrl-tb10x.c +++ b/drivers/pinctrl/pinctrl-tb10x.c @@ -557,8 +557,8 @@ static int tb10x_dt_node_to_map(struct pinctrl_dev *pctl, int ret = 0; if (of_property_read_string(np_config, "abilis,function", &string)) { - pr_err("%s: No abilis,function property in device tree.\n", - np_config->full_name); + pr_err("%pOF: No abilis,function property in device tree.\n", + np_config); return -EINVAL; } diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index f542642eed8d..20b59bb02196 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -679,7 +679,7 @@ static int samsung_pinctrl_create_function(struct device *dev, npins = of_property_count_strings(func_np, "samsung,pins"); if (npins < 1) { - dev_err(dev, "invalid pin list in %s node", func_np->name); + dev_err(dev, "invalid pin list in %pOFn node", func_np); return -EINVAL; } @@ -696,8 +696,8 @@ static int samsung_pinctrl_create_function(struct device *dev, i, &gname); if (ret) { dev_err(dev, - "failed to read pin name %d from %s node\n", - i, func_np->name); + "failed to read pin name %d from %pOFn node\n", + i, func_np); return ret; } diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c index a70157f0acf4..e7a92eec06c2 100644 --- a/drivers/pinctrl/sh-pfc/pinctrl.c +++ b/drivers/pinctrl/sh-pfc/pinctrl.c @@ -290,7 +290,7 @@ static int sh_pfc_dt_node_to_map(struct pinctrl_dev *pctldev, if (*num_maps) return 0; - dev_err(dev, "no mapping found in node %s\n", np->full_name); + dev_err(dev, "no mapping found in node %pOF\n", np); ret = -EINVAL; done: diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c index 0df72be60704..80bfd4719199 100644 --- a/drivers/pinctrl/sirf/pinctrl-sirf.c +++ b/drivers/pinctrl/sirf/pinctrl-sirf.c @@ -810,7 +810,7 @@ static int sirfsoc_gpio_probe(struct device_node *np) sgpio->chip.gc.set = sirfsoc_gpio_set_value; sgpio->chip.gc.base = 0; sgpio->chip.gc.ngpio = SIRFSOC_GPIO_BANK_SIZE * SIRFSOC_GPIO_NO_OF_BANKS; - sgpio->chip.gc.label = kstrdup(np->full_name, GFP_KERNEL); + sgpio->chip.gc.label = kasprintf(GFP_KERNEL, "%pOF", np); sgpio->chip.gc.of_node = np; sgpio->chip.gc.of_xlate = sirfsoc_gpio_of_xlate; sgpio->chip.gc.of_gpio_n_cells = 2; @@ -819,8 +819,8 @@ static int sirfsoc_gpio_probe(struct device_node *np) err = gpiochip_add_data(&sgpio->chip.gc, sgpio); if (err) { - dev_err(&pdev->dev, "%s: error in probe function with status %d\n", - np->full_name, err); + dev_err(&pdev->dev, "%pOF: error in probe function with status %d\n", + np, err); goto out; }