]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
gpio: htc-egpio: Unique label per chip
authorLinus Walleij <linus.walleij@linaro.org>
Sun, 23 Sep 2018 14:07:07 +0000 (16:07 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 24 Sep 2018 08:08:39 +0000 (10:08 +0200)
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>
drivers/gpio/gpio-htc-egpio.c

index ad6e5b5186691b01ed7cd301acc6a95985c41933..38be44dbd6e14d02d62199125ae7400151f8c08d 100644 (file)
@@ -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;