aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-11-05 14:42:41 +0200
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-11-18 18:40:10 +0200
commit9122cda6a325f80564f02b7899cc063009f5e1f9 (patch)
treee1bd8e4b885b7e5f3e7b6e308709e5c4bb437081
parent3956d6c85f26b5dd59cc6d3bf85a6a7341c68518 (diff)
downloadintel-9122cda6a325f80564f02b7899cc063009f5e1f9.tar.gz
pinctrl: zynqmp: Unify pin naming
Notice: this object is not reachable from any branch.
Since we have devm_kasprintf_strarray() helper, which is used in the rest of pin control drivers, it makes sense to switch this driver to it. The pin names are not part of any ABI and hence there will be no regression based on that. Otherwise all generated pin names will follow the same schema in the pin control subsystem. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Notice: this object is not reachable from any branch.
-rw-r--r--drivers/pinctrl/pinctrl-zynqmp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/pinctrl/pinctrl-zynqmp.c b/drivers/pinctrl/pinctrl-zynqmp.c
index e14012209992f..6cc307595783e 100644
--- a/drivers/pinctrl/pinctrl-zynqmp.c
+++ b/drivers/pinctrl/pinctrl-zynqmp.c
@@ -809,6 +809,7 @@ static int zynqmp_pinctrl_prepare_pin_desc(struct device *dev,
unsigned int *npins)
{
struct pinctrl_pin_desc *pins, *pin;
+ char **pin_names;
int ret;
int i;
@@ -820,13 +821,14 @@ static int zynqmp_pinctrl_prepare_pin_desc(struct device *dev,
if (!pins)
return -ENOMEM;
+ pin_names = devm_kasprintf_strarray(dev, ZYNQMP_PIN_PREFIX, *npins);
+ if (IS_ERR(pin->name))
+ return PTR_ERR(pin_names);
+
for (i = 0; i < *npins; i++) {
pin = &pins[i];
pin->number = i;
- pin->name = devm_kasprintf(dev, GFP_KERNEL, "%s%d",
- ZYNQMP_PIN_PREFIX, i);
- if (!pin->name)
- return -ENOMEM;
+ pin->name = pin_names[i];
}
*zynqmp_pins = pins;