Skip to content

Commit 76837e0

Browse files
author
Linus Walleij
committed
Merge tag 'sh-pfc-for-v5.4-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel
pinctrl: sh-pfc: Updates for v5.4 - Add missing of_node_put() calls on RZ/N1, - Small cleanups.
2 parents bf4b87b + 625efea commit 76837e0

3 files changed

Lines changed: 12 additions & 13 deletions

File tree

‎drivers/pinctrl/pinctrl-rza1.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,6 @@ static int rza1_pinctrl_register(struct rza1_pinctrl *rza1_pctl)
13591359
static int rza1_pinctrl_probe(struct platform_device *pdev)
13601360
{
13611361
struct rza1_pinctrl *rza1_pctl;
1362-
struct resource *res;
13631362
int ret;
13641363

13651364
rza1_pctl = devm_kzalloc(&pdev->dev, sizeof(*rza1_pctl), GFP_KERNEL);
@@ -1368,8 +1367,7 @@ static int rza1_pinctrl_probe(struct platform_device *pdev)
13681367

13691368
rza1_pctl->dev = &pdev->dev;
13701369

1371-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1372-
rza1_pctl->base = devm_ioremap_resource(&pdev->dev, res);
1370+
rza1_pctl->base = devm_platform_ioremap_resource(pdev, 0);
13731371
if (IS_ERR(rza1_pctl->base))
13741372
return PTR_ERR(rza1_pctl->base);
13751373

‎drivers/pinctrl/pinctrl-rzn1.c‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,10 @@ static int rzn1_dt_node_to_map(struct pinctrl_dev *pctldev,
412412

413413
for_each_child_of_node(np, child) {
414414
ret = rzn1_dt_node_to_map_one(pctldev, child, map, num_maps);
415-
if (ret < 0)
415+
if (ret < 0) {
416+
of_node_put(child);
416417
return ret;
418+
}
417419
}
418420

419421
return 0;
@@ -792,8 +794,10 @@ static int rzn1_pinctrl_parse_functions(struct device_node *np,
792794
grp = &ipctl->groups[ipctl->ngroups];
793795
grp->func = func->name;
794796
ret = rzn1_pinctrl_parse_groups(child, grp, ipctl);
795-
if (ret < 0)
797+
if (ret < 0) {
798+
of_node_put(child);
796799
return ret;
800+
}
797801
i++;
798802
ipctl->ngroups++;
799803
}
@@ -838,8 +842,10 @@ static int rzn1_pinctrl_probe_dt(struct platform_device *pdev,
838842

839843
for_each_child_of_node(np, child) {
840844
ret = rzn1_pinctrl_parse_functions(child, ipctl, i++);
841-
if (ret < 0)
845+
if (ret < 0) {
846+
of_node_put(child);
842847
return ret;
848+
}
843849
}
844850

845851
return 0;

‎drivers/pinctrl/sh-pfc/gpio.c‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,18 +255,13 @@ static int gpio_pin_setup(struct sh_pfc_chip *chip)
255255
#ifdef CONFIG_PINCTRL_SH_FUNC_GPIO
256256
static int gpio_function_request(struct gpio_chip *gc, unsigned offset)
257257
{
258-
static bool __print_once;
259258
struct sh_pfc *pfc = gpio_to_pfc(gc);
260259
unsigned int mark = pfc->info->func_gpios[offset].enum_id;
261260
unsigned long flags;
262261
int ret;
263262

264-
if (!__print_once) {
265-
dev_notice(pfc->dev,
266-
"Use of GPIO API for function requests is deprecated."
267-
" Convert to pinctrl\n");
268-
__print_once = true;
269-
}
263+
dev_notice_once(pfc->dev,
264+
"Use of GPIO API for function requests is deprecated, convert to pinctrl\n");
270265

271266
if (mark == 0)
272267
return -EINVAL;

0 commit comments

Comments
 (0)