summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2018-09-23 17:07:07 +0300
committerLinus Walleij <linus.walleij@linaro.org>2018-09-24 11:08:39 +0300
commit212d7069617c9b9565ffee17c4db6b8423557460 (patch)
treef897df156c9186378fc49aa1e8d081ac318c0ac6 /drivers/gpio
parenta2ab1703748197b166c85b40d08a8d1fb612f55b (diff)
downloadlinux-212d7069617c9b9565ffee17c4db6b8423557460.tar.xz
gpio: htc-egpio: Unique label per chip
Give the HTC EGPIO chips unique names, htc-egpio-0, htc-egpio-1 etc, so that it gets possible to associate machine descriptor tables with individual chips. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-htc-egpio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-htc-egpio.c b/drivers/gpio/gpio-htc-egpio.c
index ad6e5b518669..38be44dbd6e1 100644
--- a/drivers/gpio/gpio-htc-egpio.c
+++ b/drivers/gpio/gpio-htc-egpio.c
@@ -334,7 +334,13 @@ static int __init egpio_probe(struct platform_device *pdev)
ei->chip[i].is_out = pdata->chip[i].direction;
ei->chip[i].dev = &(pdev->dev);
chip = &(ei->chip[i].chip);
- chip->label = "htc-egpio";
+ chip->label = devm_kasprintf(&pdev->dev, GFP_KERNEL,
+ "htc-egpio-%d",
+ i);
+ if (!chip->label) {
+ ret = -ENOMEM;
+ goto fail;
+ }
chip->parent = &pdev->dev;
chip->owner = THIS_MODULE;
chip->get = egpio_get;