diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2021-11-20 03:44:07 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2021-11-20 03:44:07 +0100 |
commit | cc4dac3f5e3eff8d042b4d8712bed6f7ea75454c (patch) | |
tree | fe3f2d3a9f5c20f90769748406ea69fc093f652b /drivers/gpio/gpio-mockup.c | |
parent | fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf (diff) | |
parent | f7c151d86487eec720f52843133bce270b07fecc (diff) | |
download | linux-cc4dac3f5e3eff8d042b4d8712bed6f7ea75454c.tar.gz linux-cc4dac3f5e3eff8d042b4d8712bed6f7ea75454c.tar.bz2 linux-cc4dac3f5e3eff8d042b4d8712bed6f7ea75454c.zip |
Merge tag 'intel-pinctrl-v5.17-2' of gitolite.kernel.org:pub/scm/linux/kernel/git/pinctrl/intel into devel
intel-pinctrl for v5.17-2
* Introduce new generic kasprintf_strarray() API
* Clean up and convert existing drivers to use the above
The API will be needed in the future for new comers, including Intel ones.
The following is an automated git shortlog grouped by driver:
armada-37xx:
- Switch to use devm_kasprintf_strarray()
- Convert to use dev_err_probe()
- Make use of the devm_platform_ioremap_resource()
- Use temporary variable for struct device
- Fix function name in the kernel doc
gpio:
- mockup: Switch to use kasprintf_strarray()
lib/string_helpers:
- Introduce managed variant of kasprintf_strarray()
- Introduce kasprintf_strarray()
pinctrl/rockchip:
- Switch to use devm_kasprintf_strarray()
- Convert to use dev_err_probe()
- Make use of the devm_platform_get_and_ioremap_resource()
- Use temporary variable for struct device
- Drop wrong kernel doc annotation
st:
- Switch to use devm_kasprintf_strarray()
- Convert to use dev_err_probe()
- Make use of the devm_platform_ioremap_resource_byname()
- Use temporary variable for struct device
- Drop wrong kernel doc annotations
zynqmp:
- Unify pin naming
Diffstat (limited to 'drivers/gpio/gpio-mockup.c')
-rw-r--r-- | drivers/gpio/gpio-mockup.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c index d26bff29157b..8943cea92764 100644 --- a/drivers/gpio/gpio-mockup.c +++ b/drivers/gpio/gpio-mockup.c @@ -491,27 +491,6 @@ static void gpio_mockup_unregister_pdevs(void) } } -static __init char **gpio_mockup_make_line_names(const char *label, - unsigned int num_lines) -{ - unsigned int i; - char **names; - - names = kcalloc(num_lines + 1, sizeof(char *), GFP_KERNEL); - if (!names) - return NULL; - - for (i = 0; i < num_lines; i++) { - names[i] = kasprintf(GFP_KERNEL, "%s-%u", label, i); - if (!names[i]) { - kfree_strarray(names, i); - return NULL; - } - } - - return names; -} - static int __init gpio_mockup_register_chip(int idx) { struct property_entry properties[GPIO_MOCKUP_MAX_PROP]; @@ -538,7 +517,7 @@ static int __init gpio_mockup_register_chip(int idx) properties[prop++] = PROPERTY_ENTRY_U16("nr-gpios", ngpio); if (gpio_mockup_named_lines) { - line_names = gpio_mockup_make_line_names(chip_label, ngpio); + line_names = kasprintf_strarray(GFP_KERNEL, chip_label, ngpio); if (!line_names) return -ENOMEM; |