pinctrl: Convert to using %pOFn instead of device_node.name

In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Dong Aisheng <aisheng.dong@nxp.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Sean Wang <sean.wang@mediatek.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Carlo Caione <carlo@caione.org>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Gregory Clement <gregory.clement@bootlin.com>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: linux-gpio@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Acked-by: Dong Aisheng <aisheng.dong@nxp.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Sean Wang <sean.wang@mediatek.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Rob Herring 2018-08-27 20:52:41 -05:00 committed by Linus Walleij
parent 803ceb297a
commit 94f4e54cec
17 changed files with 66 additions and 69 deletions

View File

@ -64,16 +64,14 @@ static int berlin_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrl_dev,
ret = of_property_read_string(node, "function", &function_name); ret = of_property_read_string(node, "function", &function_name);
if (ret) { if (ret) {
dev_err(pctrl->dev, dev_err(pctrl->dev,
"missing function property in node %s\n", "missing function property in node %pOFn\n", node);
node->name);
return -EINVAL; return -EINVAL;
} }
ngroups = of_property_count_strings(node, "groups"); ngroups = of_property_count_strings(node, "groups");
if (ngroups < 0) { if (ngroups < 0) {
dev_err(pctrl->dev, dev_err(pctrl->dev,
"missing groups property in node %s\n", "missing groups property in node %pOFn\n", node);
node->name);
return -EINVAL; return -EINVAL;
} }

View File

@ -69,8 +69,7 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
*/ */
grp = imx_pinctrl_find_group_by_name(pctldev, np->name); grp = imx_pinctrl_find_group_by_name(pctldev, np->name);
if (!grp) { if (!grp) {
dev_err(ipctl->dev, "unable to find group for node %s\n", dev_err(ipctl->dev, "unable to find group for node %pOFn\n", np);
np->name);
return -EINVAL; return -EINVAL;
} }
@ -434,7 +433,7 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
int i; int i;
u32 config; u32 config;
dev_dbg(ipctl->dev, "group(%d): %s\n", index, np->name); dev_dbg(ipctl->dev, "group(%d): %pOFn\n", index, np);
if (info->flags & SHARE_MUX_CONF_REG) if (info->flags & SHARE_MUX_CONF_REG)
pin_size = FSL_PIN_SHARE_SIZE; pin_size = FSL_PIN_SHARE_SIZE;
@ -544,7 +543,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
struct group_desc *grp; struct group_desc *grp;
u32 i = 0; u32 i = 0;
dev_dbg(pctl->dev, "parse function(%d): %s\n", index, np->name); dev_dbg(pctl->dev, "parse function(%d): %pOFn\n", index, np);
func = pinmux_generic_get_function(pctl, index); func = pinmux_generic_get_function(pctl, index);
if (!func) if (!func)

View File

@ -233,8 +233,8 @@ static int imx1_dt_node_to_map(struct pinctrl_dev *pctldev,
*/ */
grp = imx1_pinctrl_find_group_by_name(info, np->name); grp = imx1_pinctrl_find_group_by_name(info, np->name);
if (!grp) { if (!grp) {
dev_err(info->dev, "unable to find group for node %s\n", dev_err(info->dev, "unable to find group for node %pOFn\n",
np->name); np);
return -EINVAL; return -EINVAL;
} }
@ -466,7 +466,7 @@ static int imx1_pinctrl_parse_groups(struct device_node *np,
const __be32 *list; const __be32 *list;
int i; int i;
dev_dbg(info->dev, "group(%d): %s\n", index, np->name); dev_dbg(info->dev, "group(%d): %pOFn\n", index, np);
/* Initialise group */ /* Initialise group */
grp->name = np->name; grp->name = np->name;
@ -477,8 +477,8 @@ static int imx1_pinctrl_parse_groups(struct device_node *np,
list = of_get_property(np, "fsl,pins", &size); list = of_get_property(np, "fsl,pins", &size);
/* we do not check return since it's safe node passed down */ /* we do not check return since it's safe node passed down */
if (!size || size % 12) { if (!size || size % 12) {
dev_notice(info->dev, "Not a valid fsl,pins property (%s)\n", dev_notice(info->dev, "Not a valid fsl,pins property (%pOFn)\n",
np->name); np);
return -EINVAL; return -EINVAL;
} }
@ -513,7 +513,7 @@ static int imx1_pinctrl_parse_functions(struct device_node *np,
static u32 grp_index; static u32 grp_index;
u32 i = 0; u32 i = 0;
dev_dbg(info->dev, "parse function(%d): %s\n", index, np->name); dev_dbg(info->dev, "parse function(%d): %pOFn\n", index, np);
func = &info->functions[index]; func = &info->functions[index];

View File

@ -514,8 +514,8 @@ static int mtk_pctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
pins = of_find_property(node, "pinmux", NULL); pins = of_find_property(node, "pinmux", NULL);
if (!pins) { if (!pins) {
dev_err(pctl->dev, "missing pins property in node %s .\n", dev_err(pctl->dev, "missing pins property in node %pOFn .\n",
node->name); node);
return -EINVAL; return -EINVAL;
} }

View File

@ -451,7 +451,7 @@ static struct regmap *meson_map_resource(struct meson_pinctrl *pc,
meson_regmap_config.max_register = resource_size(&res) - 4; meson_regmap_config.max_register = resource_size(&res) - 4;
meson_regmap_config.name = devm_kasprintf(pc->dev, GFP_KERNEL, meson_regmap_config.name = devm_kasprintf(pc->dev, GFP_KERNEL,
"%s-%s", node->name, "%pOFn-%s", node,
name); name);
if (!meson_regmap_config.name) if (!meson_regmap_config.name)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);

View File

@ -413,14 +413,14 @@ static int mvebu_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
ret = of_property_read_string(np, "marvell,function", &function); ret = of_property_read_string(np, "marvell,function", &function);
if (ret) { if (ret) {
dev_err(pctl->dev, dev_err(pctl->dev,
"missing marvell,function in node %s\n", np->name); "missing marvell,function in node %pOFn\n", np);
return 0; return 0;
} }
nmaps = of_property_count_strings(np, "marvell,pins"); nmaps = of_property_count_strings(np, "marvell,pins");
if (nmaps < 0) { if (nmaps < 0) {
dev_err(pctl->dev, dev_err(pctl->dev,
"missing marvell,pins in node %s\n", np->name); "missing marvell,pins in node %pOFn\n", np);
return 0; return 0;
} }

View File

@ -1051,7 +1051,7 @@ static struct nmk_gpio_chip *nmk_gpio_populate_chip(struct device_node *np,
gpio_pdev = of_find_device_by_node(np); gpio_pdev = of_find_device_by_node(np);
if (!gpio_pdev) { if (!gpio_pdev) {
pr_err("populate \"%s\": device not found\n", np->name); pr_err("populate \"%pOFn\": device not found\n", np);
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }
if (of_property_read_u32(np, "gpio-bank", &id)) { if (of_property_read_u32(np, "gpio-bank", &id)) {
@ -1904,8 +1904,8 @@ static int nmk_pinctrl_probe(struct platform_device *pdev)
gpio_np = of_parse_phandle(np, "nomadik-gpio-chips", i); gpio_np = of_parse_phandle(np, "nomadik-gpio-chips", i);
if (gpio_np) { if (gpio_np) {
dev_info(&pdev->dev, dev_info(&pdev->dev,
"populate NMK GPIO %d \"%s\"\n", "populate NMK GPIO %d \"%pOFn\"\n",
i, gpio_np->name); i, gpio_np);
nmk_chip = nmk_gpio_populate_chip(gpio_np, pdev); nmk_chip = nmk_gpio_populate_chip(gpio_np, pdev);
if (IS_ERR(nmk_chip)) if (IS_ERR(nmk_chip))
dev_err(&pdev->dev, dev_err(&pdev->dev,

View File

@ -263,8 +263,8 @@ static int at91_dt_node_to_map(struct pinctrl_dev *pctldev,
*/ */
grp = at91_pinctrl_find_group_by_name(info, np->name); grp = at91_pinctrl_find_group_by_name(info, np->name);
if (!grp) { if (!grp) {
dev_err(info->dev, "unable to find group for node %s\n", dev_err(info->dev, "unable to find group for node %pOFn\n",
np->name); np);
return -EINVAL; return -EINVAL;
} }
@ -1071,7 +1071,7 @@ static int at91_pinctrl_parse_groups(struct device_node *np,
const __be32 *list; const __be32 *list;
int i, j; int i, j;
dev_dbg(info->dev, "group(%d): %s\n", index, np->name); dev_dbg(info->dev, "group(%d): %pOFn\n", index, np);
/* Initialise group */ /* Initialise group */
grp->name = np->name; grp->name = np->name;
@ -1122,7 +1122,7 @@ static int at91_pinctrl_parse_functions(struct device_node *np,
static u32 grp_index; static u32 grp_index;
u32 i = 0; u32 i = 0;
dev_dbg(info->dev, "parse function(%d): %s\n", index, np->name); dev_dbg(info->dev, "parse function(%d): %pOFn\n", index, np);
func = &info->functions[index]; func = &info->functions[index];

View File

@ -80,14 +80,14 @@ static void ltq_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
int ret, i; int ret, i;
if (!pins && !groups) { if (!pins && !groups) {
dev_err(pctldev->dev, "%s defines neither pins nor groups\n", dev_err(pctldev->dev, "%pOFn defines neither pins nor groups\n",
np->name); np);
return; return;
} }
if (pins && groups) { if (pins && groups) {
dev_err(pctldev->dev, "%s defines both pins and groups\n", dev_err(pctldev->dev, "%pOFn defines both pins and groups\n",
np->name); np);
return; return;
} }

View File

@ -501,8 +501,8 @@ static int rockchip_dt_node_to_map(struct pinctrl_dev *pctldev,
*/ */
grp = pinctrl_name_to_group(info, np->name); grp = pinctrl_name_to_group(info, np->name);
if (!grp) { if (!grp) {
dev_err(info->dev, "unable to find group for node %s\n", dev_err(info->dev, "unable to find group for node %pOFn\n",
np->name); np);
return -EINVAL; return -EINVAL;
} }
@ -2454,7 +2454,7 @@ static int rockchip_pinctrl_parse_groups(struct device_node *np,
int i, j; int i, j;
int ret; int ret;
dev_dbg(info->dev, "group(%d): %s\n", index, np->name); dev_dbg(info->dev, "group(%d): %pOFn\n", index, np);
/* Initialise group */ /* Initialise group */
grp->name = np->name; grp->name = np->name;
@ -2519,7 +2519,7 @@ static int rockchip_pinctrl_parse_functions(struct device_node *np,
static u32 grp_index; static u32 grp_index;
u32 i = 0; u32 i = 0;
dev_dbg(info->dev, "parse function(%d): %s\n", index, np->name); dev_dbg(info->dev, "parse function(%d): %pOFn\n", index, np);
func = &info->functions[index]; func = &info->functions[index];

View File

@ -930,8 +930,8 @@ static int rza1_parse_pinmux_node(struct rza1_pinctrl *rza1_pctl,
&npin_configs); &npin_configs);
if (ret) { if (ret) {
dev_err(rza1_pctl->dev, dev_err(rza1_pctl->dev,
"Unable to parse pin configuration options for %s\n", "Unable to parse pin configuration options for %pOFn\n",
np->name); np);
return ret; return ret;
} }
@ -1226,8 +1226,8 @@ static int rza1_parse_gpiochip(struct rza1_pinctrl *rza1_pctl,
*chip = rza1_gpiochip_template; *chip = rza1_gpiochip_template;
chip->base = -1; chip->base = -1;
chip->label = devm_kasprintf(rza1_pctl->dev, GFP_KERNEL, "%s", chip->label = devm_kasprintf(rza1_pctl->dev, GFP_KERNEL, "%pOFn",
np->name); np);
chip->ngpio = of_args.args[2]; chip->ngpio = of_args.args[2];
chip->of_node = np; chip->of_node = np;
chip->parent = rza1_pctl->dev; chip->parent = rza1_pctl->dev;

View File

@ -1022,14 +1022,14 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs,
vals[found].reg = pcs->base + offset; vals[found].reg = pcs->base + offset;
vals[found].val = pinctrl_spec.args[1]; vals[found].val = pinctrl_spec.args[1];
dev_dbg(pcs->dev, "%s index: 0x%x value: 0x%x\n", dev_dbg(pcs->dev, "%pOFn index: 0x%x value: 0x%x\n",
pinctrl_spec.np->name, offset, pinctrl_spec.args[1]); pinctrl_spec.np, offset, pinctrl_spec.args[1]);
pin = pcs_get_pin_by_offset(pcs, offset); pin = pcs_get_pin_by_offset(pcs, offset);
if (pin < 0) { if (pin < 0) {
dev_err(pcs->dev, dev_err(pcs->dev,
"could not add functions for %s %ux\n", "could not add functions for %pOFn %ux\n",
np->name, offset); np, offset);
break; break;
} }
pins[found++] = pin; pins[found++] = pin;
@ -1135,8 +1135,8 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
val = pinctrl_spec.args[1]; val = pinctrl_spec.args[1];
mask = pinctrl_spec.args[2]; mask = pinctrl_spec.args[2];
dev_dbg(pcs->dev, "%s index: 0x%x value: 0x%x mask: 0x%x\n", dev_dbg(pcs->dev, "%pOFn index: 0x%x value: 0x%x mask: 0x%x\n",
pinctrl_spec.np->name, offset, val, mask); pinctrl_spec.np, offset, val, mask);
/* Parse pins in each row from LSB */ /* Parse pins in each row from LSB */
while (mask) { while (mask) {
@ -1148,8 +1148,8 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
if ((mask & mask_pos) == 0) { if ((mask & mask_pos) == 0) {
dev_err(pcs->dev, dev_err(pcs->dev,
"Invalid mask for %s at 0x%x\n", "Invalid mask for %pOFn at 0x%x\n",
np->name, offset); np, offset);
break; break;
} }
@ -1157,8 +1157,8 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
if (submask != mask_pos) { if (submask != mask_pos) {
dev_warn(pcs->dev, dev_warn(pcs->dev,
"Invalid submask 0x%x for %s at 0x%x\n", "Invalid submask 0x%x for %pOFn at 0x%x\n",
submask, np->name, offset); submask, np, offset);
continue; continue;
} }
@ -1169,8 +1169,8 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
pin = pcs_get_pin_by_offset(pcs, offset); pin = pcs_get_pin_by_offset(pcs, offset);
if (pin < 0) { if (pin < 0) {
dev_err(pcs->dev, dev_err(pcs->dev,
"could not add functions for %s %ux\n", "could not add functions for %pOFn %ux\n",
np->name, offset); np, offset);
break; break;
} }
pins[found++] = pin + pin_num_from_lsb; pins[found++] = pin + pin_num_from_lsb;
@ -1254,16 +1254,16 @@ static int pcs_dt_node_to_map(struct pinctrl_dev *pctldev,
ret = pcs_parse_bits_in_pinctrl_entry(pcs, np_config, map, ret = pcs_parse_bits_in_pinctrl_entry(pcs, np_config, map,
num_maps, pgnames); num_maps, pgnames);
if (ret < 0) { if (ret < 0) {
dev_err(pcs->dev, "no pins entries for %s\n", dev_err(pcs->dev, "no pins entries for %pOFn\n",
np_config->name); np_config);
goto free_pgnames; goto free_pgnames;
} }
} else { } else {
ret = pcs_parse_one_pinctrl_entry(pcs, np_config, map, ret = pcs_parse_one_pinctrl_entry(pcs, np_config, map,
num_maps, pgnames); num_maps, pgnames);
if (ret < 0) { if (ret < 0) {
dev_err(pcs->dev, "no pins entries for %s\n", dev_err(pcs->dev, "no pins entries for %pOFn\n",
np_config->name); np_config);
goto free_pgnames; goto free_pgnames;
} }
} }

View File

@ -817,8 +817,8 @@ static int st_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
grp = st_pctl_find_group_by_name(info, np->name); grp = st_pctl_find_group_by_name(info, np->name);
if (!grp) { if (!grp) {
dev_err(info->dev, "unable to find group for node %s\n", dev_err(info->dev, "unable to find group for node %pOFn\n",
np->name); np);
return -EINVAL; return -EINVAL;
} }
@ -1184,7 +1184,7 @@ static int st_pctl_dt_parse_groups(struct device_node *np,
if (pp->length / sizeof(__be32) >= OF_GPIO_ARGS_MIN) { if (pp->length / sizeof(__be32) >= OF_GPIO_ARGS_MIN) {
npins++; npins++;
} else { } else {
pr_warn("Invalid st,pins in %s node\n", np->name); pr_warn("Invalid st,pins in %pOFn node\n", np);
return -EINVAL; return -EINVAL;
} }
} }

View File

@ -6058,8 +6058,8 @@ static int atlas7_gpio_probe(struct platform_device *pdev)
ret = gpiochip_add_data(chip, a7gc); ret = gpiochip_add_data(chip, a7gc);
if (ret) { if (ret) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"%s: error in probe function with status %d\n", "%pOF: error in probe function with status %d\n",
np->name, ret); np, ret);
goto failed; goto failed;
} }

View File

@ -416,8 +416,8 @@ static int stm32_pctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
pins = of_find_property(node, "pinmux", NULL); pins = of_find_property(node, "pinmux", NULL);
if (!pins) { if (!pins) {
dev_err(pctl->dev, "missing pins property in node %s .\n", dev_err(pctl->dev, "missing pins property in node %pOFn .\n",
node->name); node);
return -EINVAL; return -EINVAL;
} }

View File

@ -332,15 +332,15 @@ static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
function = sunxi_pctrl_parse_function_prop(node); function = sunxi_pctrl_parse_function_prop(node);
if (!function) { if (!function) {
dev_err(pctl->dev, "missing function property in node %s\n", dev_err(pctl->dev, "missing function property in node %pOFn\n",
node->name); node);
return -EINVAL; return -EINVAL;
} }
pin_prop = sunxi_pctrl_find_pins_prop(node, &npins); pin_prop = sunxi_pctrl_find_pins_prop(node, &npins);
if (!pin_prop) { if (!pin_prop) {
dev_err(pctl->dev, "missing pins property in node %s\n", dev_err(pctl->dev, "missing pins property in node %pOFn\n",
node->name); node);
return -EINVAL; return -EINVAL;
} }

View File

@ -452,8 +452,8 @@ static int ti_iodelay_node_iterator(struct pinctrl_dev *pctldev,
pin = ti_iodelay_offset_to_pin(iod, cfg[pin_index].offset); pin = ti_iodelay_offset_to_pin(iod, cfg[pin_index].offset);
if (pin < 0) { if (pin < 0) {
dev_err(iod->dev, "could not add functions for %s %ux\n", dev_err(iod->dev, "could not add functions for %pOFn %ux\n",
np->name, cfg[pin_index].offset); np, cfg[pin_index].offset);
return -ENODEV; return -ENODEV;
} }
pins[pin_index] = pin; pins[pin_index] = pin;
@ -461,8 +461,8 @@ static int ti_iodelay_node_iterator(struct pinctrl_dev *pctldev,
pd = &iod->pa[pin]; pd = &iod->pa[pin];
pd->drv_data = &cfg[pin_index]; pd->drv_data = &cfg[pin_index];
dev_dbg(iod->dev, "%s offset=%x a_delay = %d g_delay = %d\n", dev_dbg(iod->dev, "%pOFn offset=%x a_delay = %d g_delay = %d\n",
np->name, cfg[pin_index].offset, cfg[pin_index].a_delay, np, cfg[pin_index].offset, cfg[pin_index].a_delay,
cfg[pin_index].g_delay); cfg[pin_index].g_delay);
return 0; return 0;