Skip to content

Commit ce0e2c6

Browse files
committed
Revert "gpio: rcar: Fine-grained Runtime PM support"
This reverts commit 65194cb.
1 parent 42c2501 commit ce0e2c6

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

drivers/gpio/gpio-rcar.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -242,32 +242,18 @@ static void gpio_rcar_config_general_input_output_mode(struct gpio_chip *chip,
242242

243243
static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset)
244244
{
245-
struct gpio_rcar_priv *p = gpiochip_get_data(chip);
246-
int error;
247-
248-
error = pm_runtime_get_sync(&p->pdev->dev);
249-
if (error < 0)
250-
return error;
251-
252-
error = pinctrl_request_gpio(chip->base + offset);
253-
if (error)
254-
pm_runtime_put(&p->pdev->dev);
255-
256-
return error;
245+
return pinctrl_request_gpio(chip->base + offset);
257246
}
258247

259248
static void gpio_rcar_free(struct gpio_chip *chip, unsigned offset)
260249
{
261-
struct gpio_rcar_priv *p = gpiochip_get_data(chip);
262-
263250
pinctrl_free_gpio(chip->base + offset);
264251

265-
/* Set the GPIO as an input to ensure that the next GPIO request won't
252+
/*
253+
* Set the GPIO as an input to ensure that the next GPIO request won't
266254
* drive the GPIO pin as an output.
267255
*/
268256
gpio_rcar_config_general_input_output_mode(chip, offset, false);
269-
270-
pm_runtime_put(&p->pdev->dev);
271257
}
272258

273259
static int gpio_rcar_direction_input(struct gpio_chip *chip, unsigned offset)
@@ -414,6 +400,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
414400
}
415401

416402
pm_runtime_enable(dev);
403+
pm_runtime_get_sync(dev);
417404

418405
io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
419406
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
@@ -480,6 +467,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
480467
err1:
481468
gpiochip_remove(gpio_chip);
482469
err0:
470+
pm_runtime_put(dev);
483471
pm_runtime_disable(dev);
484472
return ret;
485473
}
@@ -490,6 +478,7 @@ static int gpio_rcar_remove(struct platform_device *pdev)
490478

491479
gpiochip_remove(&p->gpio_chip);
492480

481+
pm_runtime_put(&pdev->dev);
493482
pm_runtime_disable(&pdev->dev);
494483
return 0;
495484
}

0 commit comments

Comments
 (0)