Merge tag 'psy-arm-gpio-charger-immutable-for-5.10-signed' into psy-next
authorSebastian Reichel <sre@kernel.org>
Thu, 27 Aug 2020 15:34:01 +0000 (17:34 +0200)
committerSebastian Reichel <sre@kernel.org>
Thu, 27 Aug 2020 15:34:01 +0000 (17:34 +0200)
Immutable branch between arm and power-supply for gpio-charger for 5.10

This immutable branch drops legacy gpio API from
gpio-charger and updates the remaining users to
the new gpiod API instead.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
1  2 
drivers/power/supply/gpio-charger.c

@@@ -149,32 -147,12 +147,10 @@@ static int gpio_charger_probe(struct pl
         * boardfile descriptor tables. It's good to try this first.
         */
        gpio_charger->gpiod = devm_gpiod_get_optional(dev, NULL, GPIOD_IN);
-       /*
-        * Fallback to legacy platform data method, if no GPIO is specified
-        * using boardfile descriptor tables.
-        */
-       if (!gpio_charger->gpiod && pdata) {
-               /* Non-DT: use legacy GPIO numbers */
-               if (!gpio_is_valid(pdata->gpio)) {
-                       dev_err(dev, "Invalid gpio pin in pdata\n");
-                       return -EINVAL;
-               }
-               flags = GPIOF_IN;
-               if (pdata->gpio_active_low)
-                       flags |= GPIOF_ACTIVE_LOW;
-               ret = devm_gpio_request_one(dev, pdata->gpio, flags,
-                                           dev_name(dev));
-               if (ret) {
-                       dev_err(dev, "Failed to request gpio pin: %d\n", ret);
-                       return ret;
-               }
-               /* Then convert this to gpiod for now */
-               gpio_charger->gpiod = gpio_to_desc(pdata->gpio);
-       } else if (IS_ERR(gpio_charger->gpiod)) {
+       if (IS_ERR(gpio_charger->gpiod)) {
                /* Just try again if this happens */
 -              if (PTR_ERR(gpio_charger->gpiod) == -EPROBE_DEFER)
 -                      return -EPROBE_DEFER;
 -              dev_err(dev, "error getting GPIO descriptor\n");
 -              return PTR_ERR(gpio_charger->gpiod);
 +              return dev_err_probe(dev, PTR_ERR(gpio_charger->gpiod),
 +                                   "error getting GPIO descriptor\n");
        }
  
        if (gpio_charger->gpiod) {