Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: nomadik: use gpiochip_dup_line_label()

Use the new gpiochip_dup_line_label() helper to safely retrieve the
descriptor label.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>

+5 -1
+5 -1
drivers/pinctrl/nomadik/pinctrl-nomadik.c
··· 8 8 * Copyright (C) 2011-2013 Linus Walleij <linus.walleij@linaro.org> 9 9 */ 10 10 #include <linux/bitops.h> 11 + #include <linux/cleanup.h> 11 12 #include <linux/clk.h> 12 13 #include <linux/device.h> 13 14 #include <linux/err.h> ··· 918 917 struct pinctrl_dev *pctldev, struct gpio_chip *chip, 919 918 unsigned offset, unsigned gpio) 920 919 { 921 - const char *label = gpiochip_is_requested(chip, offset); 922 920 struct nmk_gpio_chip *nmk_chip = gpiochip_get_data(chip); 923 921 int mode; 924 922 bool is_out; ··· 933 933 [NMK_GPIO_ALT_C+3] = "altC3", 934 934 [NMK_GPIO_ALT_C+4] = "altC4", 935 935 }; 936 + 937 + char *label = gpiochip_dup_line_label(chip, offset); 938 + if (IS_ERR(label)) 939 + return; 936 940 937 941 clk_enable(nmk_chip->clk); 938 942 is_out = !!(readl(nmk_chip->addr + NMK_GPIO_DIR) & BIT(offset));