summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/gpio-charger.c
diff options
context:
space:
mode:
authorSebastian Reichel <sre@kernel.org>2020-08-27 17:34:01 +0200
committerSebastian Reichel <sre@kernel.org>2020-08-27 17:34:01 +0200
commit39e95bbbac67aea2462acc74253e1f163dd39682 (patch)
tree0a77920e9c8a41e3265c9f45f034e75b5657325c /drivers/power/supply/gpio-charger.c
parente03e3601fb9fc2aa5dc8b483944006c01ffa6aa5 (diff)
parent17529bcf0ae20f1ac6d7846762bf0c6ad91dbb7f (diff)
downloadlinux-39e95bbbac67aea2462acc74253e1f163dd39682.tar.bz2
Merge tag 'psy-arm-gpio-charger-immutable-for-5.10-signed' into psy-next
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>
Diffstat (limited to 'drivers/power/supply/gpio-charger.c')
-rw-r--r--drivers/power/supply/gpio-charger.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/drivers/power/supply/gpio-charger.c b/drivers/power/supply/gpio-charger.c
index 557f879a6499..d7aff28f7e7e 100644
--- a/drivers/power/supply/gpio-charger.c
+++ b/drivers/power/supply/gpio-charger.c
@@ -5,7 +5,6 @@
*/
#include <linux/device.h>
-#include <linux/gpio.h> /* For legacy platform data */
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
@@ -131,7 +130,6 @@ static int gpio_charger_probe(struct platform_device *pdev)
struct power_supply_desc *charger_desc;
struct gpio_desc *charge_status;
int charge_status_irq;
- unsigned long flags;
int ret;
int num_props = 0;
@@ -149,29 +147,7 @@ static int gpio_charger_probe(struct platform_device *pdev)
* 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 */
return dev_err_probe(dev, PTR_ERR(gpio_charger->gpiod),
"error getting GPIO descriptor\n");