Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "gpio: rcar: Fine-grained Runtime PM support"

This reverts commit 65194cb174b873448b208eb6e04ecb72237af76e.

+6 -17
+6 -17
drivers/gpio/gpio-rcar.c
··· 242 242 243 243 static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset) 244 244 { 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); 257 246 } 258 247 259 248 static void gpio_rcar_free(struct gpio_chip *chip, unsigned offset) 260 249 { 261 - struct gpio_rcar_priv *p = gpiochip_get_data(chip); 262 - 263 250 pinctrl_free_gpio(chip->base + offset); 264 251 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 266 254 * drive the GPIO pin as an output. 267 255 */ 268 256 gpio_rcar_config_general_input_output_mode(chip, offset, false); 269 - 270 - pm_runtime_put(&p->pdev->dev); 271 257 } 272 258 273 259 static int gpio_rcar_direction_input(struct gpio_chip *chip, unsigned offset) ··· 400 414 } 401 415 402 416 pm_runtime_enable(dev); 417 + pm_runtime_get_sync(dev); 403 418 404 419 io = platform_get_resource(pdev, IORESOURCE_MEM, 0); 405 420 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); ··· 467 480 err1: 468 481 gpiochip_remove(gpio_chip); 469 482 err0: 483 + pm_runtime_put(dev); 470 484 pm_runtime_disable(dev); 471 485 return ret; 472 486 } ··· 478 490 479 491 gpiochip_remove(&p->gpio_chip); 480 492 493 + pm_runtime_put(&pdev->dev); 481 494 pm_runtime_disable(&pdev->dev); 482 495 return 0; 483 496 }