linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ludovic Desroches <ludovic.desroches@microchip.com>
To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Subject: [RFC PATCH 1/7] gpio: of: use the BIT macro for of_gpio_flags
Date: Thu, 14 Dec 2017 15:21:32 +0100	[thread overview]
Message-ID: <20171214142138.23008-2-ludovic.desroches@microchip.com> (raw)
In-Reply-To: <20171214142138.23008-1-ludovic.desroches@microchip.com>

Use the BIT macro for the of_gpio_flags enumeration.

Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
---
 include/linux/of_gpio.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index 18a7f03e1182..f928c2df2bcd 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -14,6 +14,7 @@
 #ifndef __LINUX_OF_GPIO_H
 #define __LINUX_OF_GPIO_H
 
+#include <linux/bitops.h>
 #include <linux/compiler.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -28,10 +29,10 @@ struct device_node;
  * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended.
  */
 enum of_gpio_flags {
-	OF_GPIO_ACTIVE_LOW = 0x1,
-	OF_GPIO_SINGLE_ENDED = 0x2,
-	OF_GPIO_OPEN_DRAIN = 0x4,
-	OF_GPIO_TRANSITORY = 0x8,
+	OF_GPIO_ACTIVE_LOW	= BIT(0),
+	OF_GPIO_SINGLE_ENDED	= BIT(1),
+	OF_GPIO_OPEN_DRAIN	= BIT(2),
+	OF_GPIO_TRANSITORY	= BIT(3),
 };
 
 #ifdef CONFIG_OF_GPIO
-- 
2.12.2


  reply	other threads:[~2017-12-14 14:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 14:21 [RFC PATCH 0/7] gpiolib: add bias support Ludovic Desroches
2017-12-14 14:21 ` Ludovic Desroches [this message]
2017-12-14 14:21 ` [RFC PATCH 2/7] gpio: gpiolib: split the gpiod_configure_flags function Ludovic Desroches
2017-12-15  9:26   ` Julien Thierry
2017-12-18  7:02     ` Ludovic Desroches
2017-12-14 14:21 ` [RFC PATCH 3/7] gpio: gpiolib: save GPIO flags in of_get_named_gpiod_flags Ludovic Desroches
2017-12-14 14:21 ` [RFC PATCH 4/7] gpio: gpiolib: add bias support Ludovic Desroches
2017-12-14 14:21 ` [RFC PATCH 5/7] pinctrl: at91-pio4: allow the gpiolib to set pin configuration Ludovic Desroches
2017-12-14 14:21 ` [RFC PATCH 6/7] pinctrl: at91-pio4: use strict mode if explicitly requested Ludovic Desroches
2017-12-14 14:21 ` [RFC PATCH 7/7] ARM: dts: at91-sama5d2_xplained: remove gpios from pinmux Ludovic Desroches
2017-12-14 16:06 ` [RFC PATCH 0/7] gpiolib: add bias support Andrew Lunn
2017-12-15  6:54   ` Ludovic Desroches
2017-12-19  9:40 ` [RFC PATCH v2] draft for gpio pinconf Ludovic Desroches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171214142138.23008-2-ludovic.desroches@microchip.com \
    --to=ludovic.desroches@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).