[PATCH v5 04/17] gpiolib: Add temporary variable to gpiod_set_transitory() for cleaner code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Temporary variable that keeps mode allows to neat the code a bit.
It will also help for the future changes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
 drivers/gpio/gpiolib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 87bb73991337..134f11a84b91 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2374,6 +2374,7 @@ EXPORT_SYMBOL_GPL(gpiod_set_debounce);
  */
 int gpiod_set_transitory(struct gpio_desc *desc, bool transitory)
 {
+	enum pin_config_param mode = PIN_CONFIG_PERSIST_STATE;
 	struct gpio_chip *gc;
 	unsigned long packed;
 	int gpio;
@@ -2391,8 +2392,7 @@ int gpiod_set_transitory(struct gpio_desc *desc, bool transitory)
 	if (!gc->set_config)
 		return 0;
 
-	packed = pinconf_to_config_packed(PIN_CONFIG_PERSIST_STATE,
-					  !transitory);
+	packed = pinconf_to_config_packed(mode, !transitory);
 	gpio = gpio_chip_hwgpio(desc);
 	rc = gpio_do_set_config(gc, gpio, packed);
 	if (rc == -ENOTSUPP) {
-- 
2.28.0




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux