All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: make flags mandatory for gpiod_get functions
@ 2015-06-15 21:36 Uwe Kleine-König
  2015-06-21  6:51 ` Alexandre Courbot
  2015-07-06  9:07   ` Uwe Kleine-König
  0 siblings, 2 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-06-15 21:36 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot; +Cc: linux-gpio, kernel

Now that all[1] users of the gpiod_get functions are converted to make
use of the up to now optional flags parameter, make it mandatory which
allows to remove some cpp magic.

[1] all but etraxfs-uart which is broken anyhow and I'm allowed to
    ignore it by Jesper Nilsson :-)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

the claim that all drivers are fixed is only true in my tree. I sent
several patches, some of them are not in next yet.

The gpiod branch in my repo[2] currently contains (in this order):
 - several patches cherry-picked from next that introduce new users of
   gpiod_get without flags;
 - several patches that fix gpiod_get users to make use of flags that
   are already in next;
 - several patches that fix gpiod_get users to make use of flags that
   are not yet in next;
 - this patch

I loosely agreed to Linus and Alexandre to get this change into next as
soon as 4.2-rc1 arrives. To assert that they have seen it before, I send
this mail. Also the remaining patches in my tree that don't make it into
4.2-rc1 should probably be taken before. So I plan to rebase my tree on
top of 4.2-rc1 as soon as it arrives and ask Linus to pull it for next
in the hope that it became considerably shorter by then. At least the
first two groups above should disappear.

Some of the patches in the category "not in next yet" didn't get a
response from a maintainer. I just pinged these.

I wrote a cocci-rule that finds all offending users, so I'm fairly
confident that I caught all of them as of next-20150615.

Best regards
Uwe

[2] git://git.pengutronix.de/git/ukl/linux.git gpiod

 drivers/gpio/devres.c         | 18 +++++-----
 drivers/gpio/gpiolib.c        | 16 ++++-----
 include/linux/gpio/consumer.h | 82 ++++++++++++-------------------------------
 3 files changed, 40 insertions(+), 76 deletions(-)

diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
index 07ba82317ece..903fcf4d04a0 100644
--- a/drivers/gpio/devres.c
+++ b/drivers/gpio/devres.c
@@ -59,13 +59,13 @@ static int devm_gpiod_match_array(struct device *dev, void *res, void *data)
  * automatically disposed on driver detach. See gpiod_get() for detailed
  * information about behavior and return values.
  */
-struct gpio_desc *__must_check __devm_gpiod_get(struct device *dev,
+struct gpio_desc *__must_check devm_gpiod_get(struct device *dev,
 					      const char *con_id,
 					      enum gpiod_flags flags)
 {
 	return devm_gpiod_get_index(dev, con_id, 0, flags);
 }
-EXPORT_SYMBOL(__devm_gpiod_get);
+EXPORT_SYMBOL(devm_gpiod_get);
 
 /**
  * devm_gpiod_get_optional - Resource-managed gpiod_get_optional()
@@ -77,13 +77,13 @@ EXPORT_SYMBOL(__devm_gpiod_get);
  * are automatically disposed on driver detach. See gpiod_get_optional() for
  * detailed information about behavior and return values.
  */
-struct gpio_desc *__must_check __devm_gpiod_get_optional(struct device *dev,
+struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev,
 						       const char *con_id,
 						       enum gpiod_flags flags)
 {
 	return devm_gpiod_get_index_optional(dev, con_id, 0, flags);
 }
-EXPORT_SYMBOL(__devm_gpiod_get_optional);
+EXPORT_SYMBOL(devm_gpiod_get_optional);
 
 /**
  * devm_gpiod_get_index - Resource-managed gpiod_get_index()
@@ -96,7 +96,7 @@ EXPORT_SYMBOL(__devm_gpiod_get_optional);
  * automatically disposed on driver detach. See gpiod_get_index() for detailed
  * information about behavior and return values.
  */
-struct gpio_desc *__must_check __devm_gpiod_get_index(struct device *dev,
+struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev,
 						    const char *con_id,
 						    unsigned int idx,
 						    enum gpiod_flags flags)
@@ -120,7 +120,7 @@ struct gpio_desc *__must_check __devm_gpiod_get_index(struct device *dev,
 
 	return desc;
 }
-EXPORT_SYMBOL(__devm_gpiod_get_index);
+EXPORT_SYMBOL(devm_gpiod_get_index);
 
 /**
  * devm_get_gpiod_from_child - get a GPIO descriptor from a device's child node
@@ -182,10 +182,10 @@ EXPORT_SYMBOL(devm_get_gpiod_from_child);
  * gpiod_get_index_optional() for detailed information about behavior and
  * return values.
  */
-struct gpio_desc *__must_check __devm_gpiod_get_index_optional(struct device *dev,
+struct gpio_desc *__must_check devm_gpiod_get_index_optional(struct device *dev,
 							     const char *con_id,
 							     unsigned int index,
-							 enum gpiod_flags flags)
+							     enum gpiod_flags flags)
 {
 	struct gpio_desc *desc;
 
@@ -197,7 +197,7 @@ struct gpio_desc *__must_check __devm_gpiod_get_index_optional(struct device *de
 
 	return desc;
 }
-EXPORT_SYMBOL(__devm_gpiod_get_index_optional);
+EXPORT_SYMBOL(devm_gpiod_get_index_optional);
 
 /**
  * devm_gpiod_get_array - Resource-managed gpiod_get_array()
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 6bc612b8a49f..e857d87f7780 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1882,12 +1882,12 @@ EXPORT_SYMBOL_GPL(gpiod_count);
  * dev, -ENOENT if no GPIO has been assigned to the requested function, or
  * another IS_ERR() code if an error occured while trying to acquire the GPIO.
  */
-struct gpio_desc *__must_check __gpiod_get(struct device *dev, const char *con_id,
+struct gpio_desc *__must_check gpiod_get(struct device *dev, const char *con_id,
 					 enum gpiod_flags flags)
 {
 	return gpiod_get_index(dev, con_id, 0, flags);
 }
-EXPORT_SYMBOL_GPL(__gpiod_get);
+EXPORT_SYMBOL_GPL(gpiod_get);
 
 /**
  * gpiod_get_optional - obtain an optional GPIO for a given GPIO function
@@ -1899,13 +1899,13 @@ EXPORT_SYMBOL_GPL(__gpiod_get);
  * the requested function it will return NULL. This is convenient for drivers
  * that need to handle optional GPIOs.
  */
-struct gpio_desc *__must_check __gpiod_get_optional(struct device *dev,
+struct gpio_desc *__must_check gpiod_get_optional(struct device *dev,
 						  const char *con_id,
 						  enum gpiod_flags flags)
 {
 	return gpiod_get_index_optional(dev, con_id, 0, flags);
 }
-EXPORT_SYMBOL_GPL(__gpiod_get_optional);
+EXPORT_SYMBOL_GPL(gpiod_get_optional);
 
 
 /**
@@ -1962,7 +1962,7 @@ static int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id,
  * requested function and/or index, or another IS_ERR() code if an error
  * occured while trying to acquire the GPIO.
  */
-struct gpio_desc *__must_check __gpiod_get_index(struct device *dev,
+struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
 					       const char *con_id,
 					       unsigned int idx,
 					       enum gpiod_flags flags)
@@ -2011,7 +2011,7 @@ struct gpio_desc *__must_check __gpiod_get_index(struct device *dev,
 
 	return desc;
 }
-EXPORT_SYMBOL_GPL(__gpiod_get_index);
+EXPORT_SYMBOL_GPL(gpiod_get_index);
 
 /**
  * fwnode_get_named_gpiod - obtain a GPIO from firmware node
@@ -2080,7 +2080,7 @@ EXPORT_SYMBOL_GPL(fwnode_get_named_gpiod);
  * specified index was assigned to the requested function it will return NULL.
  * This is convenient for drivers that need to handle optional GPIOs.
  */
-struct gpio_desc *__must_check __gpiod_get_index_optional(struct device *dev,
+struct gpio_desc *__must_check gpiod_get_index_optional(struct device *dev,
 							const char *con_id,
 							unsigned int index,
 							enum gpiod_flags flags)
@@ -2095,7 +2095,7 @@ struct gpio_desc *__must_check __gpiod_get_index_optional(struct device *dev,
 
 	return desc;
 }
-EXPORT_SYMBOL_GPL(__gpiod_get_index_optional);
+EXPORT_SYMBOL_GPL(gpiod_get_index_optional);
 
 /**
  * gpiod_hog - Hog the specified GPIO desc given the provided flags
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index 3a7c9ffd5ab9..9e8bd65f94fa 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -47,17 +47,17 @@ enum gpiod_flags {
 int gpiod_count(struct device *dev, const char *con_id);
 
 /* Acquire and dispose GPIOs */
-struct gpio_desc *__must_check __gpiod_get(struct device *dev,
+struct gpio_desc *__must_check gpiod_get(struct device *dev,
 					 const char *con_id,
 					 enum gpiod_flags flags);
-struct gpio_desc *__must_check __gpiod_get_index(struct device *dev,
+struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
 					       const char *con_id,
 					       unsigned int idx,
 					       enum gpiod_flags flags);
-struct gpio_desc *__must_check __gpiod_get_optional(struct device *dev,
+struct gpio_desc *__must_check gpiod_get_optional(struct device *dev,
 						  const char *con_id,
 						  enum gpiod_flags flags);
-struct gpio_desc *__must_check __gpiod_get_index_optional(struct device *dev,
+struct gpio_desc *__must_check gpiod_get_index_optional(struct device *dev,
 							const char *con_id,
 							unsigned int index,
 							enum gpiod_flags flags);
@@ -70,18 +70,18 @@ struct gpio_descs *__must_check gpiod_get_array_optional(struct device *dev,
 void gpiod_put(struct gpio_desc *desc);
 void gpiod_put_array(struct gpio_descs *descs);
 
-struct gpio_desc *__must_check __devm_gpiod_get(struct device *dev,
+struct gpio_desc *__must_check devm_gpiod_get(struct device *dev,
 					      const char *con_id,
 					      enum gpiod_flags flags);
-struct gpio_desc *__must_check __devm_gpiod_get_index(struct device *dev,
+struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev,
 						    const char *con_id,
 						    unsigned int idx,
 						    enum gpiod_flags flags);
-struct gpio_desc *__must_check __devm_gpiod_get_optional(struct device *dev,
+struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev,
 						       const char *con_id,
 						       enum gpiod_flags flags);
 struct gpio_desc *__must_check
-__devm_gpiod_get_index_optional(struct device *dev, const char *con_id,
+devm_gpiod_get_index_optional(struct device *dev, const char *con_id,
 			      unsigned int index, enum gpiod_flags flags);
 struct gpio_descs *__must_check devm_gpiod_get_array(struct device *dev,
 						     const char *con_id,
@@ -145,31 +145,31 @@ static inline int gpiod_count(struct device *dev, const char *con_id)
 	return 0;
 }
 
-static inline struct gpio_desc *__must_check __gpiod_get(struct device *dev,
-						const char *con_id,
-						enum gpiod_flags flags)
+static inline struct gpio_desc *__must_check gpiod_get(struct device *dev,
+						       const char *con_id,
+						       enum gpiod_flags flags)
 {
 	return ERR_PTR(-ENOSYS);
 }
 static inline struct gpio_desc *__must_check
-__gpiod_get_index(struct device *dev,
-		  const char *con_id,
-		  unsigned int idx,
-		  enum gpiod_flags flags)
+gpiod_get_index(struct device *dev,
+		const char *con_id,
+		unsigned int idx,
+		enum gpiod_flags flags)
 {
 	return ERR_PTR(-ENOSYS);
 }
 
 static inline struct gpio_desc *__must_check
-__gpiod_get_optional(struct device *dev, const char *con_id,
-		     enum gpiod_flags flags)
+gpiod_get_optional(struct device *dev, const char *con_id,
+		   enum gpiod_flags flags)
 {
 	return ERR_PTR(-ENOSYS);
 }
 
 static inline struct gpio_desc *__must_check
-__gpiod_get_index_optional(struct device *dev, const char *con_id,
-			   unsigned int index, enum gpiod_flags flags)
+gpiod_get_index_optional(struct device *dev, const char *con_id,
+			 unsigned int index, enum gpiod_flags flags)
 {
 	return ERR_PTR(-ENOSYS);
 }
@@ -205,7 +205,7 @@ static inline void gpiod_put_array(struct gpio_descs *descs)
 }
 
 static inline struct gpio_desc *__must_check
-__devm_gpiod_get(struct device *dev,
+devm_gpiod_get(struct device *dev,
 		 const char *con_id,
 		 enum gpiod_flags flags)
 {
@@ -213,7 +213,7 @@ __devm_gpiod_get(struct device *dev,
 }
 static inline
 struct gpio_desc *__must_check
-__devm_gpiod_get_index(struct device *dev,
+devm_gpiod_get_index(struct device *dev,
 		       const char *con_id,
 		       unsigned int idx,
 		       enum gpiod_flags flags)
@@ -222,14 +222,14 @@ __devm_gpiod_get_index(struct device *dev,
 }
 
 static inline struct gpio_desc *__must_check
-__devm_gpiod_get_optional(struct device *dev, const char *con_id,
+devm_gpiod_get_optional(struct device *dev, const char *con_id,
 			  enum gpiod_flags flags)
 {
 	return ERR_PTR(-ENOSYS);
 }
 
 static inline struct gpio_desc *__must_check
-__devm_gpiod_get_index_optional(struct device *dev, const char *con_id,
+devm_gpiod_get_index_optional(struct device *dev, const char *con_id,
 				unsigned int index, enum gpiod_flags flags)
 {
 	return ERR_PTR(-ENOSYS);
@@ -408,42 +408,6 @@ static inline int desc_to_gpio(const struct gpio_desc *desc)
 
 #endif /* CONFIG_GPIOLIB */
 
-/*
- * Vararg-hacks! This is done to transition the kernel to always pass
- * the options flags argument to the below functions. During a transition
- * phase these vararg macros make both old-and-newstyle code compile,
- * but when all calls to the elder API are removed, these should go away
- * and the __gpiod_get() etc functions above be renamed just gpiod_get()
- * etc.
- */
-#define __gpiod_get(dev, con_id, flags, ...) __gpiod_get(dev, con_id, flags)
-#define gpiod_get(varargs...) __gpiod_get(varargs, GPIOD_ASIS)
-#define __gpiod_get_index(dev, con_id, index, flags, ...)		\
-	__gpiod_get_index(dev, con_id, index, flags)
-#define gpiod_get_index(varargs...) __gpiod_get_index(varargs, GPIOD_ASIS)
-#define __gpiod_get_optional(dev, con_id, flags, ...)			\
-	__gpiod_get_optional(dev, con_id, flags)
-#define gpiod_get_optional(varargs...) __gpiod_get_optional(varargs, GPIOD_ASIS)
-#define __gpiod_get_index_optional(dev, con_id, index, flags, ...)	\
-	__gpiod_get_index_optional(dev, con_id, index, flags)
-#define gpiod_get_index_optional(varargs...)				\
-	__gpiod_get_index_optional(varargs, GPIOD_ASIS)
-#define __devm_gpiod_get(dev, con_id, flags, ...)			\
-	__devm_gpiod_get(dev, con_id, flags)
-#define devm_gpiod_get(varargs...) __devm_gpiod_get(varargs, GPIOD_ASIS)
-#define __devm_gpiod_get_index(dev, con_id, index, flags, ...)		\
-	__devm_gpiod_get_index(dev, con_id, index, flags)
-#define devm_gpiod_get_index(varargs...)				\
-	__devm_gpiod_get_index(varargs, GPIOD_ASIS)
-#define __devm_gpiod_get_optional(dev, con_id, flags, ...)		\
-	__devm_gpiod_get_optional(dev, con_id, flags)
-#define devm_gpiod_get_optional(varargs...)				\
-	__devm_gpiod_get_optional(varargs, GPIOD_ASIS)
-#define __devm_gpiod_get_index_optional(dev, con_id, index, flags, ...)	\
-	__devm_gpiod_get_index_optional(dev, con_id, index, flags)
-#define devm_gpiod_get_index_optional(varargs...)			\
-	__devm_gpiod_get_index_optional(varargs, GPIOD_ASIS)
-
 #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS)
 
 int gpiod_export(struct gpio_desc *desc, bool direction_may_change);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH] gpio: make flags mandatory for gpiod_get functions
  2015-06-15 21:36 [PATCH] gpio: make flags mandatory for gpiod_get functions Uwe Kleine-König
@ 2015-06-21  6:51 ` Alexandre Courbot
  2015-07-06  9:07   ` Uwe Kleine-König
  1 sibling, 0 replies; 26+ messages in thread
From: Alexandre Courbot @ 2015-06-21  6:51 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Linus Walleij, linux-gpio, Sascha Hauer

On Tue, Jun 16, 2015 at 6:36 AM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> Now that all[1] users of the gpiod_get functions are converted to make
> use of the up to now optional flags parameter, make it mandatory which
> allows to remove some cpp magic.
>
> [1] all but etraxfs-uart which is broken anyhow and I'm allowed to
>     ignore it by Jesper Nilsson :-)
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
>
> the claim that all drivers are fixed is only true in my tree. I sent
> several patches, some of them are not in next yet.
>
> The gpiod branch in my repo[2] currently contains (in this order):
>  - several patches cherry-picked from next that introduce new users of
>    gpiod_get without flags;
>  - several patches that fix gpiod_get users to make use of flags that
>    are already in next;
>  - several patches that fix gpiod_get users to make use of flags that
>    are not yet in next;
>  - this patch
>
> I loosely agreed to Linus and Alexandre to get this change into next as
> soon as 4.2-rc1 arrives. To assert that they have seen it before, I send
> this mail. Also the remaining patches in my tree that don't make it into
> 4.2-rc1 should probably be taken before. So I plan to rebase my tree on
> top of 4.2-rc1 as soon as it arrives and ask Linus to pull it for next
> in the hope that it became considerably shorter by then. At least the
> first two groups above should disappear.
>
> Some of the patches in the category "not in next yet" didn't get a
> response from a maintainer. I just pinged these.
>
> I wrote a cocci-rule that finds all offending users, so I'm fairly
> confident that I caught all of them as of next-20150615.

Uwe, a big *thank you* for taking care of this and making GPIO safer
for everyone.

Acked-by: Alexandre Courbot <acourbot@nvidia.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PULL gpio-for-next] gpio: make flags mandatory for gpiod_get functions
  2015-06-15 21:36 [PATCH] gpio: make flags mandatory for gpiod_get functions Uwe Kleine-König
@ 2015-07-06  9:07   ` Uwe Kleine-König
  2015-07-06  9:07   ` Uwe Kleine-König
  1 sibling, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-06  9:07 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: linux-gpio, kernel, Aloisio Almeida Jr, Charles Gorand,
	Daniel Mack, David Airlie, dri-devel, Ezequiel Garcia,
	Felipe Balbi, Greg Kroah-Hartman, Haojian Zhuang, Hartmut Knaack,
	Heikki Krogerus, Irina Tirdea, Jonathan Cameron,
	Kishon Vijay Abraham I, Lars-Peter Clausen, Lauro Ramos Venancio,
	linux-iio, linux-media, linux-nfc, linux-omap, linux-usb,
	Mauro Carvalho Chehab

Hello,

now that all patches that were in next hit Linus Torvalds' tree and
v4.2-rc1 is out here comes the promised pull request that makes usage of
the flags parameter mandatory for gpiod_get et al:

The following changes since commit d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754:

  Linux 4.2-rc1 (2015-07-05 11:01:52 -0700)

are available in the git repository at:

  git://git.pengutronix.de/git/ukl/linux.git tags/gpiod-flags-for-4.3

for you to fetch changes up to b17d1bf16cc72a374a48d748940f700009d40ff4:

  gpio: make flags mandatory for gpiod_get functions (2015-07-06 10:39:24 +0200)

----------------------------------------------------------------
The last patch in this series makes the flags parameter for the various
gpiod_get* functions mandatory and so allows to remove an ugly cpp hack
introduced in commit 39b2bbe3d715 (gpio: add flags argument to gpiod_get*()
functions) for v3.17-rc1.

The other nine commits fix the last remaining users of these functions that
don't pass flags yet. (Only etraxfs-uart wasn't fixed; this driver's use of the
gpiod functions needs fixing anyhow.)

----------------------------------------------------------------

According to the coccinelle-script I wrote all users (apart from
etraxfs-uart) are fixed now.

As some of the maintainers requested it, I'll resend the patches
contained in this series as a reply to this mail.

It would be great if this could be put into next via the gpio tree to
give new users enough time to adapt their patches.

Thanks
Uwe

Uwe Kleine-König (10):
      drm/msm/dp: use flags argument of devm_gpiod_get to set direction
      drm/tilcdc: panel: make better use of gpiod API
      iio: light: stk3310: use flags argument of devm_gpiod_get
      iio: magn: bmc150: use flags argument of devm_gpiod_get
      media: i2c/adp1653: set enable gpio to output
      NFC: nxp-nci_i2c: use flags argument of devm_gpiod_get_index
      phy: tusb1210: make better use of gpiod API
      usb: dwc3: pci: make better use of gpiod API
      usb: pass flags parameter to gpiod_get functions
      gpio: make flags mandatory for gpiod_get functions

 drivers/gpio/devres.c                  | 18 ++++----
 drivers/gpio/gpiolib.c                 | 16 +++----
 drivers/gpu/drm/msm/edp/edp_ctrl.c     | 17 +------
 drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 22 +++------
 drivers/iio/light/stk3310.c            |  6 +--
 drivers/iio/magnetometer/bmc150_magn.c |  6 +--
 drivers/media/i2c/adp1653.c            |  2 +-
 drivers/nfc/nxp-nci/i2c.c              | 10 ++---
 drivers/phy/phy-tusb1210.c             | 30 +++++--------
 drivers/usb/dwc3/dwc3-pci.c            | 26 ++++++-----
 drivers/usb/gadget/udc/pxa27x_udc.c    |  2 +-
 drivers/usb/phy/phy-generic.c          |  6 ++-
 include/linux/gpio/consumer.h          | 82 ++++++++++------------------------
 13 files changed, 88 insertions(+), 155 deletions(-)

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PULL gpio-for-next] gpio: make flags mandatory for gpiod_get functions
@ 2015-07-06  9:07   ` Uwe Kleine-König
  0 siblings, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-06  9:07 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: linux-gpio, kernel, Aloisio Almeida Jr, Charles Gorand,
	Daniel Mack, David Airlie, dri-devel, Ezequiel Garcia,
	Felipe Balbi, Greg Kroah-Hartman, Haojian Zhuang, Hartmut Knaack,
	Heikki Krogerus, Irina Tirdea, Jonathan Cameron,
	Kishon Vijay Abraham I, Lars-Peter Clausen, Lauro Ramos Venancio,
	linux-iio, linux-media, linux-nfc, linux-omap, linux-usb,
	Mauro Carvalho Chehab, Oleg Zhurakivskyy, Pavel Machek,
	Peter Meerwald, Robert Jarzmik, Sakari Ailus, Samuel Ortiz,
	Tiberiu Breana

Hello,

now that all patches that were in next hit Linus Torvalds' tree and
v4.2-rc1 is out here comes the promised pull request that makes usage of
the flags parameter mandatory for gpiod_get et al:

The following changes since commit d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754:

  Linux 4.2-rc1 (2015-07-05 11:01:52 -0700)

are available in the git repository at:

  git://git.pengutronix.de/git/ukl/linux.git tags/gpiod-flags-for-4.3

for you to fetch changes up to b17d1bf16cc72a374a48d748940f700009d40ff4:

  gpio: make flags mandatory for gpiod_get functions (2015-07-06 10:39:24 +0200)

----------------------------------------------------------------
The last patch in this series makes the flags parameter for the various
gpiod_get* functions mandatory and so allows to remove an ugly cpp hack
introduced in commit 39b2bbe3d715 (gpio: add flags argument to gpiod_get*()
functions) for v3.17-rc1.

The other nine commits fix the last remaining users of these functions that
don't pass flags yet. (Only etraxfs-uart wasn't fixed; this driver's use of the
gpiod functions needs fixing anyhow.)

----------------------------------------------------------------

According to the coccinelle-script I wrote all users (apart from
etraxfs-uart) are fixed now.

As some of the maintainers requested it, I'll resend the patches
contained in this series as a reply to this mail.

It would be great if this could be put into next via the gpio tree to
give new users enough time to adapt their patches.

Thanks
Uwe

Uwe Kleine-König (10):
      drm/msm/dp: use flags argument of devm_gpiod_get to set direction
      drm/tilcdc: panel: make better use of gpiod API
      iio: light: stk3310: use flags argument of devm_gpiod_get
      iio: magn: bmc150: use flags argument of devm_gpiod_get
      media: i2c/adp1653: set enable gpio to output
      NFC: nxp-nci_i2c: use flags argument of devm_gpiod_get_index
      phy: tusb1210: make better use of gpiod API
      usb: dwc3: pci: make better use of gpiod API
      usb: pass flags parameter to gpiod_get functions
      gpio: make flags mandatory for gpiod_get functions

 drivers/gpio/devres.c                  | 18 ++++----
 drivers/gpio/gpiolib.c                 | 16 +++----
 drivers/gpu/drm/msm/edp/edp_ctrl.c     | 17 +------
 drivers/gpu/drm/tilcdc/tilcdc_panel.c  | 22 +++------
 drivers/iio/light/stk3310.c            |  6 +--
 drivers/iio/magnetometer/bmc150_magn.c |  6 +--
 drivers/media/i2c/adp1653.c            |  2 +-
 drivers/nfc/nxp-nci/i2c.c              | 10 ++---
 drivers/phy/phy-tusb1210.c             | 30 +++++--------
 drivers/usb/dwc3/dwc3-pci.c            | 26 ++++++-----
 drivers/usb/gadget/udc/pxa27x_udc.c    |  2 +-
 drivers/usb/phy/phy-generic.c          |  6 ++-
 include/linux/gpio/consumer.h          | 82 ++++++++++------------------------
 13 files changed, 88 insertions(+), 155 deletions(-)

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH gpio-for-next 01/10] drm/msm/dp: use flags argument of devm_gpiod_get to set direction
  2015-07-06  9:07   ` Uwe Kleine-König
  (?)
@ 2015-07-06  9:09   ` Uwe Kleine-König
  -1 siblings, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-06  9:09 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: linux-gpio, kernel, David Airlie, dri-devel

Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Use this to simplify the driver. Furthermore this is one caller less
that stops us making the flags argument to gpiod_get*() mandatory.

Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/gpu/drm/msm/edp/edp_ctrl.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/msm/edp/edp_ctrl.c b/drivers/gpu/drm/msm/edp/edp_ctrl.c
index 7991069dd492..81200e9be382 100644
--- a/drivers/gpu/drm/msm/edp/edp_ctrl.c
+++ b/drivers/gpu/drm/msm/edp/edp_ctrl.c
@@ -373,7 +373,7 @@ static int edp_gpio_config(struct edp_ctrl *ctrl)
 	struct device *dev = &ctrl->pdev->dev;
 	int ret;
 
-	ctrl->panel_hpd_gpio = devm_gpiod_get(dev, "panel-hpd");
+	ctrl->panel_hpd_gpio = devm_gpiod_get(dev, "panel-hpd", GPIOD_IN);
 	if (IS_ERR(ctrl->panel_hpd_gpio)) {
 		ret = PTR_ERR(ctrl->panel_hpd_gpio);
 		ctrl->panel_hpd_gpio = NULL;
@@ -381,13 +381,7 @@ static int edp_gpio_config(struct edp_ctrl *ctrl)
 		return ret;
 	}
 
-	ret = gpiod_direction_input(ctrl->panel_hpd_gpio);
-	if (ret) {
-		pr_err("%s: Set direction for hpd failed, %d\n", __func__, ret);
-		return ret;
-	}
-
-	ctrl->panel_en_gpio = devm_gpiod_get(dev, "panel-en");
+	ctrl->panel_en_gpio = devm_gpiod_get(dev, "panel-en", GPIOD_OUT_LOW);
 	if (IS_ERR(ctrl->panel_en_gpio)) {
 		ret = PTR_ERR(ctrl->panel_en_gpio);
 		ctrl->panel_en_gpio = NULL;
@@ -395,13 +389,6 @@ static int edp_gpio_config(struct edp_ctrl *ctrl)
 		return ret;
 	}
 
-	ret = gpiod_direction_output(ctrl->panel_en_gpio, 0);
-	if (ret) {
-		pr_err("%s: Set direction for panel_en failed, %d\n",
-				__func__, ret);
-		return ret;
-	}
-
 	DBG("gpio on");
 
 	return 0;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH gpio-for-next 02/10] drm/tilcdc: panel: make better use of gpiod API
  2015-07-06  9:07   ` Uwe Kleine-König
  (?)
  (?)
@ 2015-07-06  9:09   ` Uwe Kleine-König
  -1 siblings, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-06  9:09 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: linux-gpio, kernel, David Airlie, dri-devel, Ezequiel Garcia

Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Furthermore there is devm_gpiod_get_optional which is designed to get
optional gpios.

Simplify driver accordingly.

Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/gpu/drm/tilcdc/tilcdc_panel.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index 7a0315855e90..0af8bed7ce1e 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -375,25 +375,17 @@ static int panel_probe(struct platform_device *pdev)
 		dev_info(&pdev->dev, "found backlight\n");
 	}
 
-	panel_mod->enable_gpio = devm_gpiod_get(&pdev->dev, "enable");
+	panel_mod->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
+							 GPIOD_OUT_LOW);
 	if (IS_ERR(panel_mod->enable_gpio)) {
 		ret = PTR_ERR(panel_mod->enable_gpio);
-		if (ret != -ENOENT) {
-			dev_err(&pdev->dev, "failed to request enable GPIO\n");
-			goto fail_backlight;
-		}
-
-		/* Optional GPIO is not here, continue silently. */
-		panel_mod->enable_gpio = NULL;
-	} else {
-		ret = gpiod_direction_output(panel_mod->enable_gpio, 0);
-		if (ret < 0) {
-			dev_err(&pdev->dev, "failed to setup GPIO\n");
-			goto fail_backlight;
-		}
-		dev_info(&pdev->dev, "found enable GPIO\n");
+		dev_err(&pdev->dev, "failed to request enable GPIO\n");
+		goto fail_backlight;
 	}
 
+	if (panel_mod->enable_gpio)
+		dev_info(&pdev->dev, "found enable GPIO\n");
+
 	mod = &panel_mod->base;
 	pdev->dev.platform_data = mod;
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH gpio-for-next 03/10] iio: light: stk3310: use flags argument of devm_gpiod_get
  2015-07-06  9:07   ` Uwe Kleine-König
@ 2015-07-06  9:09       ` Uwe Kleine-König
  -1 siblings, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-06  9:09 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: linux-gpio-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	Tiberiu Breana, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald,
	linux-iio-u79uwXL29TY76Z2rM5mHXA

Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Simplify driver accordingly. Furthermore this is one caller less that
stops us making the flags argument to gpiod_get*() mandatory.

Acked-by: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
 drivers/iio/light/stk3310.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
index fee4297d7c8f..84c77d42a2c6 100644
--- a/drivers/iio/light/stk3310.c
+++ b/drivers/iio/light/stk3310.c
@@ -488,16 +488,12 @@ static int stk3310_gpio_probe(struct i2c_client *client)
 	dev = &client->dev;
 
 	/* gpio interrupt pin */
-	gpio = devm_gpiod_get_index(dev, STK3310_GPIO, 0);
+	gpio = devm_gpiod_get_index(dev, STK3310_GPIO, 0, GPIOD_IN);
 	if (IS_ERR(gpio)) {
 		dev_err(dev, "acpi gpio get index failed\n");
 		return PTR_ERR(gpio);
 	}
 
-	ret = gpiod_direction_input(gpio);
-	if (ret)
-		return ret;
-
 	ret = gpiod_to_irq(gpio);
 	dev_dbg(dev, "GPIO resource, no:%d irq:%d\n", desc_to_gpio(gpio), ret);
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH gpio-for-next 03/10] iio: light: stk3310: use flags argument of devm_gpiod_get
@ 2015-07-06  9:09       ` Uwe Kleine-König
  0 siblings, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-06  9:09 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: linux-gpio, kernel, Tiberiu Breana, Jonathan Cameron,
	Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald, linux-iio

Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Simplify driver accordingly. Furthermore this is one caller less that
stops us making the flags argument to gpiod_get*() mandatory.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/iio/light/stk3310.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
index fee4297d7c8f..84c77d42a2c6 100644
--- a/drivers/iio/light/stk3310.c
+++ b/drivers/iio/light/stk3310.c
@@ -488,16 +488,12 @@ static int stk3310_gpio_probe(struct i2c_client *client)
 	dev = &client->dev;
 
 	/* gpio interrupt pin */
-	gpio = devm_gpiod_get_index(dev, STK3310_GPIO, 0);
+	gpio = devm_gpiod_get_index(dev, STK3310_GPIO, 0, GPIOD_IN);
 	if (IS_ERR(gpio)) {
 		dev_err(dev, "acpi gpio get index failed\n");
 		return PTR_ERR(gpio);
 	}
 
-	ret = gpiod_direction_input(gpio);
-	if (ret)
-		return ret;
-
 	ret = gpiod_to_irq(gpio);
 	dev_dbg(dev, "GPIO resource, no:%d irq:%d\n", desc_to_gpio(gpio), ret);
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH gpio-for-next 04/10] iio: magn: bmc150: use flags argument of devm_gpiod_get
  2015-07-06  9:07   ` Uwe Kleine-König
@ 2015-07-06  9:09       ` Uwe Kleine-König
  -1 siblings, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-06  9:09 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: linux-gpio-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald, Irina Tirdea, linux-iio-u79uwXL29TY76Z2rM5mHXA

Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Simplify driver accordingly. Furthermore this is one caller less that
stops us making the flags argument to gpiod_get*() mandatory.

Acked-by: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
 drivers/iio/magnetometer/bmc150_magn.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c
index d4c178869991..187a31fdc35a 100644
--- a/drivers/iio/magnetometer/bmc150_magn.c
+++ b/drivers/iio/magnetometer/bmc150_magn.c
@@ -839,16 +839,12 @@ static int bmc150_magn_gpio_probe(struct i2c_client *client)
 	dev = &client->dev;
 
 	/* data ready GPIO interrupt pin */
-	gpio = devm_gpiod_get_index(dev, BMC150_MAGN_GPIO_INT, 0);
+	gpio = devm_gpiod_get_index(dev, BMC150_MAGN_GPIO_INT, 0, GPIOD_IN);
 	if (IS_ERR(gpio)) {
 		dev_err(dev, "ACPI GPIO get index failed\n");
 		return PTR_ERR(gpio);
 	}
 
-	ret = gpiod_direction_input(gpio);
-	if (ret)
-		return ret;
-
 	ret = gpiod_to_irq(gpio);
 
 	dev_dbg(dev, "GPIO resource, no:%d irq:%d\n", desc_to_gpio(gpio), ret);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH gpio-for-next 04/10] iio: magn: bmc150: use flags argument of devm_gpiod_get
@ 2015-07-06  9:09       ` Uwe Kleine-König
  0 siblings, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-06  9:09 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: linux-gpio, kernel, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald, Irina Tirdea, linux-iio

Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Simplify driver accordingly. Furthermore this is one caller less that
stops us making the flags argument to gpiod_get*() mandatory.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/iio/magnetometer/bmc150_magn.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c
index d4c178869991..187a31fdc35a 100644
--- a/drivers/iio/magnetometer/bmc150_magn.c
+++ b/drivers/iio/magnetometer/bmc150_magn.c
@@ -839,16 +839,12 @@ static int bmc150_magn_gpio_probe(struct i2c_client *client)
 	dev = &client->dev;
 
 	/* data ready GPIO interrupt pin */
-	gpio = devm_gpiod_get_index(dev, BMC150_MAGN_GPIO_INT, 0);
+	gpio = devm_gpiod_get_index(dev, BMC150_MAGN_GPIO_INT, 0, GPIOD_IN);
 	if (IS_ERR(gpio)) {
 		dev_err(dev, "ACPI GPIO get index failed\n");
 		return PTR_ERR(gpio);
 	}
 
-	ret = gpiod_direction_input(gpio);
-	if (ret)
-		return ret;
-
 	ret = gpiod_to_irq(gpio);
 
 	dev_dbg(dev, "GPIO resource, no:%d irq:%d\n", desc_to_gpio(gpio), ret);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH gpio-for-next 05/10] media: i2c/adp1653: set enable gpio to output
  2015-07-06  9:07   ` Uwe Kleine-König
                     ` (2 preceding siblings ...)
  (?)
@ 2015-07-06  9:09   ` Uwe Kleine-König
  -1 siblings, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-06  9:09 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: linux-gpio, kernel, Pavel Machek, Sakari Ailus,
	Mauro Carvalho Chehab, linux-media

Without setting the direction of a gpio to output a call to
gpiod_set_value doesn't have a defined outcome.

Furthermore this is one caller less that stops us making the flags
argument to gpiod_get*() mandatory.

Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/media/i2c/adp1653.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/adp1653.c b/drivers/media/i2c/adp1653.c
index c70ababce954..5dd39775d6ca 100644
--- a/drivers/media/i2c/adp1653.c
+++ b/drivers/media/i2c/adp1653.c
@@ -465,7 +465,7 @@ static int adp1653_of_init(struct i2c_client *client,
 
 	of_node_put(child);
 
-	pd->enable_gpio = devm_gpiod_get(&client->dev, "enable");
+	pd->enable_gpio = devm_gpiod_get(&client->dev, "enable", GPIOD_OUT_LOW);
 	if (!pd->enable_gpio) {
 		dev_err(&client->dev, "Error getting GPIO\n");
 		return -EINVAL;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH gpio-for-next 06/10] NFC: nxp-nci_i2c: use flags argument of devm_gpiod_get_index
  2015-07-06  9:07   ` Uwe Kleine-König
                     ` (3 preceding siblings ...)
  (?)
@ 2015-07-06  9:09   ` Uwe Kleine-König
  -1 siblings, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-06  9:09 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: linux-gpio, kernel, Oleg Zhurakivskyy, Samuel Ortiz,
	Lauro Ramos Venancio, Aloisio Almeida Jr, Charles Gorand,
	linux-nfc

Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Simplify driver accordingly which even makes error checking more correct
because gpiod_direction_{in,out}put might fail. Furthermore this is one
caller less that stops us making the flags argument to gpiod_get*()
mandatory.

Acked-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/nfc/nxp-nci/i2c.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 2f77f1d03638..fac80c691914 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -318,19 +318,15 @@ static int nxp_nci_i2c_acpi_config(struct nxp_nci_i2c_phy *phy)
 	struct i2c_client *client = phy->i2c_dev;
 	struct gpio_desc *gpiod_en, *gpiod_fw, *gpiod_irq;
 
-	gpiod_en = devm_gpiod_get_index(&client->dev, NULL, 2);
-	gpiod_fw = devm_gpiod_get_index(&client->dev, NULL, 1);
-	gpiod_irq = devm_gpiod_get_index(&client->dev, NULL, 0);
+	gpiod_en = devm_gpiod_get_index(&client->dev, NULL, 2, GPIOD_OUT_LOW);
+	gpiod_fw = devm_gpiod_get_index(&client->dev, NULL, 1, GPIOD_OUT_LOW);
+	gpiod_irq = devm_gpiod_get_index(&client->dev, NULL, 0, GPIOD_IN);
 
 	if (IS_ERR(gpiod_en) || IS_ERR(gpiod_fw) || IS_ERR(gpiod_irq)) {
 		nfc_err(&client->dev, "No GPIOs\n");
 		return -EINVAL;
 	}
 
-	gpiod_direction_output(gpiod_en, 0);
-	gpiod_direction_output(gpiod_fw, 0);
-	gpiod_direction_input(gpiod_irq);
-
 	client->irq = gpiod_to_irq(gpiod_irq);
 	if (client->irq < 0) {
 		nfc_err(&client->dev, "No IRQ\n");
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH gpio-for-next 07/10] phy: tusb1210: make better use of gpiod API
  2015-07-06  9:07   ` Uwe Kleine-König
                     ` (4 preceding siblings ...)
  (?)
@ 2015-07-06  9:09   ` Uwe Kleine-König
  -1 siblings, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-06  9:09 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: linux-gpio, kernel, Heikki Krogerus, Felipe Balbi,
	Kishon Vijay Abraham I, linux-usb

Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Furthermore there is devm_gpiod_get_optional which is designed to get
optional gpios.

Simplify driver accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/phy/phy-tusb1210.c | 30 ++++++++++++------------------
 1 file changed, 12 insertions(+), 18 deletions(-)

diff --git a/drivers/phy/phy-tusb1210.c b/drivers/phy/phy-tusb1210.c
index 07efdd318bdc..93dd45f2f26e 100644
--- a/drivers/phy/phy-tusb1210.c
+++ b/drivers/phy/phy-tusb1210.c
@@ -61,32 +61,26 @@ static struct phy_ops phy_ops = {
 
 static int tusb1210_probe(struct ulpi *ulpi)
 {
-	struct gpio_desc *gpio;
 	struct tusb1210 *tusb;
 	u8 val, reg;
-	int ret;
 
 	tusb = devm_kzalloc(&ulpi->dev, sizeof(*tusb), GFP_KERNEL);
 	if (!tusb)
 		return -ENOMEM;
 
-	gpio = devm_gpiod_get(&ulpi->dev, "reset");
-	if (!IS_ERR(gpio)) {
-		ret = gpiod_direction_output(gpio, 0);
-		if (ret)
-			return ret;
-		gpiod_set_value_cansleep(gpio, 1);
-		tusb->gpio_reset = gpio;
-	}
+	tusb->gpio_reset = devm_gpiod_get_optional(&ulpi->dev, "reset",
+						   GPIOD_OUT_LOW);
+	if (IS_ERR(tusb->gpio_reset))
+		return PTR_ERR(tusb->gpio_reset);
 
-	gpio = devm_gpiod_get(&ulpi->dev, "cs");
-	if (!IS_ERR(gpio)) {
-		ret = gpiod_direction_output(gpio, 0);
-		if (ret)
-			return ret;
-		gpiod_set_value_cansleep(gpio, 1);
-		tusb->gpio_cs = gpio;
-	}
+	gpiod_set_value_cansleep(tusb->gpio_reset, 1);
+
+	tusb->gpio_cs = devm_gpiod_get_optional(&ulpi->dev, "cs",
+						GPIOD_OUT_LOW);
+	if (IS_ERR(tusb->gpio_cs))
+		return PTR_ERR(tusb->gpio_cs);
+
+	gpiod_set_value_cansleep(tusb->gpio_cs, 1);
 
 	/*
 	 * VENDOR_SPECIFIC2 register in TUSB1210 can be used for configuring eye
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH gpio-for-next 08/10] usb: dwc3: pci: make better use of gpiod API
  2015-07-06  9:07   ` Uwe Kleine-König
                     ` (5 preceding siblings ...)
  (?)
@ 2015-07-06  9:09   ` Uwe Kleine-König
  -1 siblings, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-06  9:09 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: linux-gpio, kernel, Heikki Krogerus, Felipe Balbi,
	Greg Kroah-Hartman, linux-usb, linux-omap

Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Use this additional parameter and the _optional variant to simplify the
driver and improve error handling. Also expand the comment to explain
why it's not sensible to switch to devm_gpiod_get and why the gpiod_put
is also necessary.

Furthermore this is one caller less that stops us making the flags
argument to gpiod_get*() mandatory.

Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/usb/dwc3/dwc3-pci.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 27e4fc896e9d..f62617999f3c 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -83,17 +83,23 @@ static int dwc3_pci_quirks(struct pci_dev *pdev)
 		acpi_dev_add_driver_gpios(ACPI_COMPANION(&pdev->dev),
 					  acpi_dwc3_byt_gpios);
 
-		/* These GPIOs will turn on the USB2 PHY */
-		gpio = gpiod_get(&pdev->dev, "cs");
-		if (!IS_ERR(gpio)) {
-			gpiod_direction_output(gpio, 0);
-			gpiod_set_value_cansleep(gpio, 1);
-			gpiod_put(gpio);
-		}
+		/*
+		 * These GPIOs will turn on the USB2 PHY. Note that we have to
+		 * put the gpio descriptors again here because the phy driver
+		 * might want to grab them, too.
+		 */
+		gpio = gpiod_get_optional(&pdev->dev, "cs", GPIOD_OUT_LOW);
+		if (IS_ERR(gpio))
+			return PTR_ERR(gpio);
+
+		gpiod_set_value_cansleep(gpio, 1);
+		gpiod_put(gpio);
+
+		gpio = gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW);
+		if (IS_ERR(gpio))
+			return PTR_ERR(gpio);
 
-		gpio = gpiod_get(&pdev->dev, "reset");
-		if (!IS_ERR(gpio)) {
-			gpiod_direction_output(gpio, 0);
+		if (gpio) {
 			gpiod_set_value_cansleep(gpio, 1);
 			gpiod_put(gpio);
 			usleep_range(10000, 11000);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH gpio-for-next 09/10] usb: pass flags parameter to gpiod_get functions
       [not found]   ` <20150706090759.GS11824-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  2015-07-06  9:09       ` Uwe Kleine-König
  2015-07-06  9:09       ` Uwe Kleine-König
@ 2015-07-06  9:09     ` Uwe Kleine-König
  2 siblings, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-06  9:09 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: linux-gpio-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	Daniel Mack, Haojian Zhuang, Robert Jarzmik, Felipe Balbi,
	Greg Kroah-Hartman, linux-usb-u79uwXL29TY76Z2rM5mHXA

Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Currently this parameter is made optional with the help of a cpp trick.
To allow dropping this hack convert callers to explictly pass a value
for flags.

Acked-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
Acked-by: Robert Jarzmik <robert.jarzmik-GANU6spQydw@public.gmane.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
 drivers/usb/gadget/udc/pxa27x_udc.c | 2 +-
 drivers/usb/phy/phy-generic.c       | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
index b51226abade6..042f06b52677 100644
--- a/drivers/usb/gadget/udc/pxa27x_udc.c
+++ b/drivers/usb/gadget/udc/pxa27x_udc.c
@@ -2422,7 +2422,7 @@ static int pxa_udc_probe(struct platform_device *pdev)
 		}
 		udc->udc_command = mach->udc_command;
 	} else {
-		udc->gpiod = devm_gpiod_get(&pdev->dev, NULL);
+		udc->gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_ASIS);
 	}
 
 	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
index deee68eafb72..ec6ecd03269c 100644
--- a/drivers/usb/phy/phy-generic.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -218,11 +218,13 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
 			clk_rate = 0;
 
 		needs_vcc = of_property_read_bool(node, "vcc-supply");
-		nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset");
+		nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset",
+							   GPIOD_ASIS);
 		err = PTR_ERR_OR_ZERO(nop->gpiod_reset);
 		if (!err) {
 			nop->gpiod_vbus = devm_gpiod_get_optional(dev,
-							 "vbus-detect");
+							 "vbus-detect",
+							 GPIOD_ASIS);
 			err = PTR_ERR_OR_ZERO(nop->gpiod_vbus);
 		}
 	} else if (pdata) {
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH gpio-for-next 10/10] gpio: make flags mandatory for gpiod_get functions
  2015-07-06  9:07   ` Uwe Kleine-König
                     ` (7 preceding siblings ...)
  (?)
@ 2015-07-06  9:09   ` Uwe Kleine-König
  -1 siblings, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-06  9:09 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot; +Cc: linux-gpio, kernel

Now that all[1] users of the gpiod_get functions are converted to make
use of the up to now optional flags parameter, make it mandatory which
allows to remove some cpp magic.

[1] all but etraxfs-uart which is broken anyhow and I'm allowed to
    ignore it by Jesper Nilsson :-)

Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/gpio/devres.c         | 18 +++++-----
 drivers/gpio/gpiolib.c        | 16 ++++-----
 include/linux/gpio/consumer.h | 82 ++++++++++++-------------------------------
 3 files changed, 40 insertions(+), 76 deletions(-)

diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
index 07ba82317ece..903fcf4d04a0 100644
--- a/drivers/gpio/devres.c
+++ b/drivers/gpio/devres.c
@@ -59,13 +59,13 @@ static int devm_gpiod_match_array(struct device *dev, void *res, void *data)
  * automatically disposed on driver detach. See gpiod_get() for detailed
  * information about behavior and return values.
  */
-struct gpio_desc *__must_check __devm_gpiod_get(struct device *dev,
+struct gpio_desc *__must_check devm_gpiod_get(struct device *dev,
 					      const char *con_id,
 					      enum gpiod_flags flags)
 {
 	return devm_gpiod_get_index(dev, con_id, 0, flags);
 }
-EXPORT_SYMBOL(__devm_gpiod_get);
+EXPORT_SYMBOL(devm_gpiod_get);
 
 /**
  * devm_gpiod_get_optional - Resource-managed gpiod_get_optional()
@@ -77,13 +77,13 @@ EXPORT_SYMBOL(__devm_gpiod_get);
  * are automatically disposed on driver detach. See gpiod_get_optional() for
  * detailed information about behavior and return values.
  */
-struct gpio_desc *__must_check __devm_gpiod_get_optional(struct device *dev,
+struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev,
 						       const char *con_id,
 						       enum gpiod_flags flags)
 {
 	return devm_gpiod_get_index_optional(dev, con_id, 0, flags);
 }
-EXPORT_SYMBOL(__devm_gpiod_get_optional);
+EXPORT_SYMBOL(devm_gpiod_get_optional);
 
 /**
  * devm_gpiod_get_index - Resource-managed gpiod_get_index()
@@ -96,7 +96,7 @@ EXPORT_SYMBOL(__devm_gpiod_get_optional);
  * automatically disposed on driver detach. See gpiod_get_index() for detailed
  * information about behavior and return values.
  */
-struct gpio_desc *__must_check __devm_gpiod_get_index(struct device *dev,
+struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev,
 						    const char *con_id,
 						    unsigned int idx,
 						    enum gpiod_flags flags)
@@ -120,7 +120,7 @@ struct gpio_desc *__must_check __devm_gpiod_get_index(struct device *dev,
 
 	return desc;
 }
-EXPORT_SYMBOL(__devm_gpiod_get_index);
+EXPORT_SYMBOL(devm_gpiod_get_index);
 
 /**
  * devm_get_gpiod_from_child - get a GPIO descriptor from a device's child node
@@ -182,10 +182,10 @@ EXPORT_SYMBOL(devm_get_gpiod_from_child);
  * gpiod_get_index_optional() for detailed information about behavior and
  * return values.
  */
-struct gpio_desc *__must_check __devm_gpiod_get_index_optional(struct device *dev,
+struct gpio_desc *__must_check devm_gpiod_get_index_optional(struct device *dev,
 							     const char *con_id,
 							     unsigned int index,
-							 enum gpiod_flags flags)
+							     enum gpiod_flags flags)
 {
 	struct gpio_desc *desc;
 
@@ -197,7 +197,7 @@ struct gpio_desc *__must_check __devm_gpiod_get_index_optional(struct device *de
 
 	return desc;
 }
-EXPORT_SYMBOL(__devm_gpiod_get_index_optional);
+EXPORT_SYMBOL(devm_gpiod_get_index_optional);
 
 /**
  * devm_gpiod_get_array - Resource-managed gpiod_get_array()
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index bf4bd1d120c3..4b2f98168225 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1894,12 +1894,12 @@ EXPORT_SYMBOL_GPL(gpiod_count);
  * dev, -ENOENT if no GPIO has been assigned to the requested function, or
  * another IS_ERR() code if an error occurred while trying to acquire the GPIO.
  */
-struct gpio_desc *__must_check __gpiod_get(struct device *dev, const char *con_id,
+struct gpio_desc *__must_check gpiod_get(struct device *dev, const char *con_id,
 					 enum gpiod_flags flags)
 {
 	return gpiod_get_index(dev, con_id, 0, flags);
 }
-EXPORT_SYMBOL_GPL(__gpiod_get);
+EXPORT_SYMBOL_GPL(gpiod_get);
 
 /**
  * gpiod_get_optional - obtain an optional GPIO for a given GPIO function
@@ -1911,13 +1911,13 @@ EXPORT_SYMBOL_GPL(__gpiod_get);
  * the requested function it will return NULL. This is convenient for drivers
  * that need to handle optional GPIOs.
  */
-struct gpio_desc *__must_check __gpiod_get_optional(struct device *dev,
+struct gpio_desc *__must_check gpiod_get_optional(struct device *dev,
 						  const char *con_id,
 						  enum gpiod_flags flags)
 {
 	return gpiod_get_index_optional(dev, con_id, 0, flags);
 }
-EXPORT_SYMBOL_GPL(__gpiod_get_optional);
+EXPORT_SYMBOL_GPL(gpiod_get_optional);
 
 
 /**
@@ -1974,7 +1974,7 @@ static int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id,
  * requested function and/or index, or another IS_ERR() code if an error
  * occurred while trying to acquire the GPIO.
  */
-struct gpio_desc *__must_check __gpiod_get_index(struct device *dev,
+struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
 					       const char *con_id,
 					       unsigned int idx,
 					       enum gpiod_flags flags)
@@ -2023,7 +2023,7 @@ struct gpio_desc *__must_check __gpiod_get_index(struct device *dev,
 
 	return desc;
 }
-EXPORT_SYMBOL_GPL(__gpiod_get_index);
+EXPORT_SYMBOL_GPL(gpiod_get_index);
 
 /**
  * fwnode_get_named_gpiod - obtain a GPIO from firmware node
@@ -2092,7 +2092,7 @@ EXPORT_SYMBOL_GPL(fwnode_get_named_gpiod);
  * specified index was assigned to the requested function it will return NULL.
  * This is convenient for drivers that need to handle optional GPIOs.
  */
-struct gpio_desc *__must_check __gpiod_get_index_optional(struct device *dev,
+struct gpio_desc *__must_check gpiod_get_index_optional(struct device *dev,
 							const char *con_id,
 							unsigned int index,
 							enum gpiod_flags flags)
@@ -2107,7 +2107,7 @@ struct gpio_desc *__must_check __gpiod_get_index_optional(struct device *dev,
 
 	return desc;
 }
-EXPORT_SYMBOL_GPL(__gpiod_get_index_optional);
+EXPORT_SYMBOL_GPL(gpiod_get_index_optional);
 
 /**
  * gpiod_hog - Hog the specified GPIO desc given the provided flags
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index adac255aee86..14cac67c2012 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -47,17 +47,17 @@ enum gpiod_flags {
 int gpiod_count(struct device *dev, const char *con_id);
 
 /* Acquire and dispose GPIOs */
-struct gpio_desc *__must_check __gpiod_get(struct device *dev,
+struct gpio_desc *__must_check gpiod_get(struct device *dev,
 					 const char *con_id,
 					 enum gpiod_flags flags);
-struct gpio_desc *__must_check __gpiod_get_index(struct device *dev,
+struct gpio_desc *__must_check gpiod_get_index(struct device *dev,
 					       const char *con_id,
 					       unsigned int idx,
 					       enum gpiod_flags flags);
-struct gpio_desc *__must_check __gpiod_get_optional(struct device *dev,
+struct gpio_desc *__must_check gpiod_get_optional(struct device *dev,
 						  const char *con_id,
 						  enum gpiod_flags flags);
-struct gpio_desc *__must_check __gpiod_get_index_optional(struct device *dev,
+struct gpio_desc *__must_check gpiod_get_index_optional(struct device *dev,
 							const char *con_id,
 							unsigned int index,
 							enum gpiod_flags flags);
@@ -70,18 +70,18 @@ struct gpio_descs *__must_check gpiod_get_array_optional(struct device *dev,
 void gpiod_put(struct gpio_desc *desc);
 void gpiod_put_array(struct gpio_descs *descs);
 
-struct gpio_desc *__must_check __devm_gpiod_get(struct device *dev,
+struct gpio_desc *__must_check devm_gpiod_get(struct device *dev,
 					      const char *con_id,
 					      enum gpiod_flags flags);
-struct gpio_desc *__must_check __devm_gpiod_get_index(struct device *dev,
+struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev,
 						    const char *con_id,
 						    unsigned int idx,
 						    enum gpiod_flags flags);
-struct gpio_desc *__must_check __devm_gpiod_get_optional(struct device *dev,
+struct gpio_desc *__must_check devm_gpiod_get_optional(struct device *dev,
 						       const char *con_id,
 						       enum gpiod_flags flags);
 struct gpio_desc *__must_check
-__devm_gpiod_get_index_optional(struct device *dev, const char *con_id,
+devm_gpiod_get_index_optional(struct device *dev, const char *con_id,
 			      unsigned int index, enum gpiod_flags flags);
 struct gpio_descs *__must_check devm_gpiod_get_array(struct device *dev,
 						     const char *con_id,
@@ -146,31 +146,31 @@ static inline int gpiod_count(struct device *dev, const char *con_id)
 	return 0;
 }
 
-static inline struct gpio_desc *__must_check __gpiod_get(struct device *dev,
-						const char *con_id,
-						enum gpiod_flags flags)
+static inline struct gpio_desc *__must_check gpiod_get(struct device *dev,
+						       const char *con_id,
+						       enum gpiod_flags flags)
 {
 	return ERR_PTR(-ENOSYS);
 }
 static inline struct gpio_desc *__must_check
-__gpiod_get_index(struct device *dev,
-		  const char *con_id,
-		  unsigned int idx,
-		  enum gpiod_flags flags)
+gpiod_get_index(struct device *dev,
+		const char *con_id,
+		unsigned int idx,
+		enum gpiod_flags flags)
 {
 	return ERR_PTR(-ENOSYS);
 }
 
 static inline struct gpio_desc *__must_check
-__gpiod_get_optional(struct device *dev, const char *con_id,
-		     enum gpiod_flags flags)
+gpiod_get_optional(struct device *dev, const char *con_id,
+		   enum gpiod_flags flags)
 {
 	return ERR_PTR(-ENOSYS);
 }
 
 static inline struct gpio_desc *__must_check
-__gpiod_get_index_optional(struct device *dev, const char *con_id,
-			   unsigned int index, enum gpiod_flags flags)
+gpiod_get_index_optional(struct device *dev, const char *con_id,
+			 unsigned int index, enum gpiod_flags flags)
 {
 	return ERR_PTR(-ENOSYS);
 }
@@ -206,7 +206,7 @@ static inline void gpiod_put_array(struct gpio_descs *descs)
 }
 
 static inline struct gpio_desc *__must_check
-__devm_gpiod_get(struct device *dev,
+devm_gpiod_get(struct device *dev,
 		 const char *con_id,
 		 enum gpiod_flags flags)
 {
@@ -214,7 +214,7 @@ __devm_gpiod_get(struct device *dev,
 }
 static inline
 struct gpio_desc *__must_check
-__devm_gpiod_get_index(struct device *dev,
+devm_gpiod_get_index(struct device *dev,
 		       const char *con_id,
 		       unsigned int idx,
 		       enum gpiod_flags flags)
@@ -223,14 +223,14 @@ __devm_gpiod_get_index(struct device *dev,
 }
 
 static inline struct gpio_desc *__must_check
-__devm_gpiod_get_optional(struct device *dev, const char *con_id,
+devm_gpiod_get_optional(struct device *dev, const char *con_id,
 			  enum gpiod_flags flags)
 {
 	return ERR_PTR(-ENOSYS);
 }
 
 static inline struct gpio_desc *__must_check
-__devm_gpiod_get_index_optional(struct device *dev, const char *con_id,
+devm_gpiod_get_index_optional(struct device *dev, const char *con_id,
 				unsigned int index, enum gpiod_flags flags)
 {
 	return ERR_PTR(-ENOSYS);
@@ -424,42 +424,6 @@ static inline struct gpio_desc *devm_get_gpiod_from_child(
 
 #endif /* CONFIG_GPIOLIB */
 
-/*
- * Vararg-hacks! This is done to transition the kernel to always pass
- * the options flags argument to the below functions. During a transition
- * phase these vararg macros make both old-and-newstyle code compile,
- * but when all calls to the elder API are removed, these should go away
- * and the __gpiod_get() etc functions above be renamed just gpiod_get()
- * etc.
- */
-#define __gpiod_get(dev, con_id, flags, ...) __gpiod_get(dev, con_id, flags)
-#define gpiod_get(varargs...) __gpiod_get(varargs, GPIOD_ASIS)
-#define __gpiod_get_index(dev, con_id, index, flags, ...)		\
-	__gpiod_get_index(dev, con_id, index, flags)
-#define gpiod_get_index(varargs...) __gpiod_get_index(varargs, GPIOD_ASIS)
-#define __gpiod_get_optional(dev, con_id, flags, ...)			\
-	__gpiod_get_optional(dev, con_id, flags)
-#define gpiod_get_optional(varargs...) __gpiod_get_optional(varargs, GPIOD_ASIS)
-#define __gpiod_get_index_optional(dev, con_id, index, flags, ...)	\
-	__gpiod_get_index_optional(dev, con_id, index, flags)
-#define gpiod_get_index_optional(varargs...)				\
-	__gpiod_get_index_optional(varargs, GPIOD_ASIS)
-#define __devm_gpiod_get(dev, con_id, flags, ...)			\
-	__devm_gpiod_get(dev, con_id, flags)
-#define devm_gpiod_get(varargs...) __devm_gpiod_get(varargs, GPIOD_ASIS)
-#define __devm_gpiod_get_index(dev, con_id, index, flags, ...)		\
-	__devm_gpiod_get_index(dev, con_id, index, flags)
-#define devm_gpiod_get_index(varargs...)				\
-	__devm_gpiod_get_index(varargs, GPIOD_ASIS)
-#define __devm_gpiod_get_optional(dev, con_id, flags, ...)		\
-	__devm_gpiod_get_optional(dev, con_id, flags)
-#define devm_gpiod_get_optional(varargs...)				\
-	__devm_gpiod_get_optional(varargs, GPIOD_ASIS)
-#define __devm_gpiod_get_index_optional(dev, con_id, index, flags, ...)	\
-	__devm_gpiod_get_index_optional(dev, con_id, index, flags)
-#define devm_gpiod_get_index_optional(varargs...)			\
-	__devm_gpiod_get_index_optional(varargs, GPIOD_ASIS)
-
 #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS)
 
 int gpiod_export(struct gpio_desc *desc, bool direction_may_change);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* RE: [PATCH gpio-for-next 03/10] iio: light: stk3310: use flags argument of devm_gpiod_get
  2015-07-06  9:09       ` Uwe Kleine-König
@ 2015-07-06  9:35         ` Breana, Tiberiu A
  -1 siblings, 0 replies; 26+ messages in thread
From: Breana, Tiberiu A @ 2015-07-06  9:35 UTC (permalink / raw)
  To: Uwe Kleine-König, Linus Walleij, Alexandre Courbot
  Cc: linux-gpio, kernel, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald, linux-iio

> -----Original Message-----
> From: Uwe Kleine-König [mailto:u.kleine-koenig@pengutronix.de]
> Sent: Monday, July 6, 2015 12:10 PM
> To: Linus Walleij; Alexandre Courbot
> Cc: linux-gpio@vger.kernel.org; kernel@pengutronix.de; Breana, Tiberiu A;
> Jonathan Cameron; Hartmut Knaack; Lars-Peter Clausen; Peter Meerwald;
> linux-iio@vger.kernel.org
> Subject: [PATCH gpio-for-next 03/10] iio: light: stk3310: use flags argument of
> devm_gpiod_get
> 
> Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
> which appeared in v3.17-rc1, the gpiod_get* functions take an additional
> parameter that allows to specify direction and initial value for output.
> 
> Simplify driver accordingly. Furthermore this is one caller less that stops us
> making the flags argument to gpiod_get*() mandatory.
> 
> Acked-by: Jonathan Cameron <jic23@kernel.org>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

+1

Reviewed-by: Tiberiu Breana <tiberiu.a.breana@intel.com>

> ---
>  drivers/iio/light/stk3310.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index
> fee4297d7c8f..84c77d42a2c6 100644
> --- a/drivers/iio/light/stk3310.c
> +++ b/drivers/iio/light/stk3310.c
> @@ -488,16 +488,12 @@ static int stk3310_gpio_probe(struct i2c_client
> *client)
>  	dev = &client->dev;
> 
>  	/* gpio interrupt pin */
> -	gpio = devm_gpiod_get_index(dev, STK3310_GPIO, 0);
> +	gpio = devm_gpiod_get_index(dev, STK3310_GPIO, 0, GPIOD_IN);
>  	if (IS_ERR(gpio)) {
>  		dev_err(dev, "acpi gpio get index failed\n");
>  		return PTR_ERR(gpio);
>  	}
> 
> -	ret = gpiod_direction_input(gpio);
> -	if (ret)
> -		return ret;
> -
>  	ret = gpiod_to_irq(gpio);
>  	dev_dbg(dev, "GPIO resource, no:%d irq:%d\n", desc_to_gpio(gpio),
> ret);
> 
> --
> 2.1.4


^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [PATCH gpio-for-next 03/10] iio: light: stk3310: use flags argument of devm_gpiod_get
@ 2015-07-06  9:35         ` Breana, Tiberiu A
  0 siblings, 0 replies; 26+ messages in thread
From: Breana, Tiberiu A @ 2015-07-06  9:35 UTC (permalink / raw)
  To: Uwe Kleine-König, Linus Walleij, Alexandre Courbot
  Cc: linux-gpio, kernel, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald, linux-iio

PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBVd2UgS2xlaW5lLUvDtm5pZyBb
bWFpbHRvOnUua2xlaW5lLWtvZW5pZ0BwZW5ndXRyb25peC5kZV0NCj4gU2VudDogTW9uZGF5LCBK
dWx5IDYsIDIwMTUgMTI6MTAgUE0NCj4gVG86IExpbnVzIFdhbGxlaWo7IEFsZXhhbmRyZSBDb3Vy
Ym90DQo+IENjOiBsaW51eC1ncGlvQHZnZXIua2VybmVsLm9yZzsga2VybmVsQHBlbmd1dHJvbml4
LmRlOyBCcmVhbmEsIFRpYmVyaXUgQTsNCj4gSm9uYXRoYW4gQ2FtZXJvbjsgSGFydG11dCBLbmFh
Y2s7IExhcnMtUGV0ZXIgQ2xhdXNlbjsgUGV0ZXIgTWVlcndhbGQ7DQo+IGxpbnV4LWlpb0B2Z2Vy
Lmtlcm5lbC5vcmcNCj4gU3ViamVjdDogW1BBVENIIGdwaW8tZm9yLW5leHQgMDMvMTBdIGlpbzog
bGlnaHQ6IHN0azMzMTA6IHVzZSBmbGFncyBhcmd1bWVudCBvZg0KPiBkZXZtX2dwaW9kX2dldA0K
PiANCj4gU2luY2UgMzliMmJiZTNkNzE1IChncGlvOiBhZGQgZmxhZ3MgYXJndW1lbnQgdG8gZ3Bp
b2RfZ2V0KigpIGZ1bmN0aW9ucykNCj4gd2hpY2ggYXBwZWFyZWQgaW4gdjMuMTctcmMxLCB0aGUg
Z3Bpb2RfZ2V0KiBmdW5jdGlvbnMgdGFrZSBhbiBhZGRpdGlvbmFsDQo+IHBhcmFtZXRlciB0aGF0
IGFsbG93cyB0byBzcGVjaWZ5IGRpcmVjdGlvbiBhbmQgaW5pdGlhbCB2YWx1ZSBmb3Igb3V0cHV0
Lg0KPiANCj4gU2ltcGxpZnkgZHJpdmVyIGFjY29yZGluZ2x5LiBGdXJ0aGVybW9yZSB0aGlzIGlz
IG9uZSBjYWxsZXIgbGVzcyB0aGF0IHN0b3BzIHVzDQo+IG1ha2luZyB0aGUgZmxhZ3MgYXJndW1l
bnQgdG8gZ3Bpb2RfZ2V0KigpIG1hbmRhdG9yeS4NCj4gDQo+IEFja2VkLWJ5OiBKb25hdGhhbiBD
YW1lcm9uIDxqaWMyM0BrZXJuZWwub3JnPg0KPiBTaWduZWQtb2ZmLWJ5OiBVd2UgS2xlaW5lLUvD
tm5pZyA8dS5rbGVpbmUta29lbmlnQHBlbmd1dHJvbml4LmRlPg0KDQorMQ0KDQpSZXZpZXdlZC1i
eTogVGliZXJpdSBCcmVhbmEgPHRpYmVyaXUuYS5icmVhbmFAaW50ZWwuY29tPg0KDQo+IC0tLQ0K
PiAgZHJpdmVycy9paW8vbGlnaHQvc3RrMzMxMC5jIHwgNiArLS0tLS0NCj4gIDEgZmlsZSBjaGFu
Z2VkLCAxIGluc2VydGlvbigrKSwgNSBkZWxldGlvbnMoLSkNCj4gDQo+IGRpZmYgLS1naXQgYS9k
cml2ZXJzL2lpby9saWdodC9zdGszMzEwLmMgYi9kcml2ZXJzL2lpby9saWdodC9zdGszMzEwLmMg
aW5kZXgNCj4gZmVlNDI5N2Q3YzhmLi44NGM3N2Q0MmEyYzYgMTAwNjQ0DQo+IC0tLSBhL2RyaXZl
cnMvaWlvL2xpZ2h0L3N0azMzMTAuYw0KPiArKysgYi9kcml2ZXJzL2lpby9saWdodC9zdGszMzEw
LmMNCj4gQEAgLTQ4OCwxNiArNDg4LDEyIEBAIHN0YXRpYyBpbnQgc3RrMzMxMF9ncGlvX3Byb2Jl
KHN0cnVjdCBpMmNfY2xpZW50DQo+ICpjbGllbnQpDQo+ICAJZGV2ID0gJmNsaWVudC0+ZGV2Ow0K
PiANCj4gIAkvKiBncGlvIGludGVycnVwdCBwaW4gKi8NCj4gLQlncGlvID0gZGV2bV9ncGlvZF9n
ZXRfaW5kZXgoZGV2LCBTVEszMzEwX0dQSU8sIDApOw0KPiArCWdwaW8gPSBkZXZtX2dwaW9kX2dl
dF9pbmRleChkZXYsIFNUSzMzMTBfR1BJTywgMCwgR1BJT0RfSU4pOw0KPiAgCWlmIChJU19FUlIo
Z3BpbykpIHsNCj4gIAkJZGV2X2VycihkZXYsICJhY3BpIGdwaW8gZ2V0IGluZGV4IGZhaWxlZFxu
Iik7DQo+ICAJCXJldHVybiBQVFJfRVJSKGdwaW8pOw0KPiAgCX0NCj4gDQo+IC0JcmV0ID0gZ3Bp
b2RfZGlyZWN0aW9uX2lucHV0KGdwaW8pOw0KPiAtCWlmIChyZXQpDQo+IC0JCXJldHVybiByZXQ7
DQo+IC0NCj4gIAlyZXQgPSBncGlvZF90b19pcnEoZ3Bpbyk7DQo+ICAJZGV2X2RiZyhkZXYsICJH
UElPIHJlc291cmNlLCBubzolZCBpcnE6JWRcbiIsIGRlc2NfdG9fZ3BpbyhncGlvKSwNCj4gcmV0
KTsNCj4gDQo+IC0tDQo+IDIuMS40DQoNCg==

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PULL gpio-for-next] gpio: make flags mandatory for gpiod_get functions
  2015-07-06  9:07   ` Uwe Kleine-König
                     ` (8 preceding siblings ...)
  (?)
@ 2015-07-08 10:51   ` Uwe Kleine-König
  2015-07-15  6:28     ` Uwe Kleine-König
  -1 siblings, 1 reply; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-08 10:51 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot; +Cc: linux-gpio

Hello Linus, hello Alexandre,

On Mon, Jul 06, 2015 at 11:07:59AM +0200, Uwe Kleine-König wrote:
> now that all patches that were in next hit Linus Torvalds' tree and
> v4.2-rc1 is out here comes the promised pull request that makes usage of
> the flags parameter mandatory for gpiod_get et al:
> 
> The following changes since commit d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754:
> 
>   Linux 4.2-rc1 (2015-07-05 11:01:52 -0700)
> 
> are available in the git repository at:
> 
>   git://git.pengutronix.de/git/ukl/linux.git tags/gpiod-flags-for-4.3
> 
> for you to fetch changes up to b17d1bf16cc72a374a48d748940f700009d40ff4:
> 
>   gpio: make flags mandatory for gpiod_get functions (2015-07-06 10:39:24 +0200)
gentle ping!

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PULL gpio-for-next] gpio: make flags mandatory for gpiod_get functions
  2015-07-08 10:51   ` [PULL gpio-for-next] " Uwe Kleine-König
@ 2015-07-15  6:28     ` Uwe Kleine-König
  2015-07-15  6:39       ` Alexandre Courbot
  0 siblings, 1 reply; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-15  6:28 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot; +Cc: linux-gpio, kernel

Hello Linus, hello Alexandre,

On Wed, Jul 08, 2015 at 12:51:38PM +0200, Uwe Kleine-König wrote:
> On Mon, Jul 06, 2015 at 11:07:59AM +0200, Uwe Kleine-König wrote:
> > now that all patches that were in next hit Linus Torvalds' tree and
> > v4.2-rc1 is out here comes the promised pull request that makes usage of
> > the flags parameter mandatory for gpiod_get et al:
> > 
> > The following changes since commit d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754:
> > 
> >   Linux 4.2-rc1 (2015-07-05 11:01:52 -0700)
> > 
> > are available in the git repository at:
> > 
> >   git://git.pengutronix.de/git/ukl/linux.git tags/gpiod-flags-for-4.3
> > 
> > for you to fetch changes up to b17d1bf16cc72a374a48d748940f700009d40ff4:
> > 
> >   gpio: make flags mandatory for gpiod_get functions (2015-07-06 10:39:24 +0200)
> gentle ping!
the (or at least my) plan was to get this into next early after the
merge window for 4.2 closes. Now we're already at -rc2. Can you please
comment?

As of next-20150715 there don't seem to be any new users of gpiod
without flags btw.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PULL gpio-for-next] gpio: make flags mandatory for gpiod_get functions
  2015-07-15  6:28     ` Uwe Kleine-König
@ 2015-07-15  6:39       ` Alexandre Courbot
  2015-07-17 12:28         ` Linus Walleij
  0 siblings, 1 reply; 26+ messages in thread
From: Alexandre Courbot @ 2015-07-15  6:39 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Linus Walleij, linux-gpio, Sascha Hauer

On Wed, Jul 15, 2015 at 3:28 PM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> Hello Linus, hello Alexandre,
>
> On Wed, Jul 08, 2015 at 12:51:38PM +0200, Uwe Kleine-König wrote:
>> On Mon, Jul 06, 2015 at 11:07:59AM +0200, Uwe Kleine-König wrote:
>> > now that all patches that were in next hit Linus Torvalds' tree and
>> > v4.2-rc1 is out here comes the promised pull request that makes usage of
>> > the flags parameter mandatory for gpiod_get et al:
>> >
>> > The following changes since commit d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754:
>> >
>> >   Linux 4.2-rc1 (2015-07-05 11:01:52 -0700)
>> >
>> > are available in the git repository at:
>> >
>> >   git://git.pengutronix.de/git/ukl/linux.git tags/gpiod-flags-for-4.3
>> >
>> > for you to fetch changes up to b17d1bf16cc72a374a48d748940f700009d40ff4:
>> >
>> >   gpio: make flags mandatory for gpiod_get functions (2015-07-06 10:39:24 +0200)
>> gentle ping!
> the (or at least my) plan was to get this into next early after the
> merge window for 4.2 closes. Now we're already at -rc2. Can you please
> comment?
>
> As of next-20150715 there don't seem to be any new users of gpiod
> without flags btw.

I'm all for taking this into -next ASAP then. Linus has control over
the tree though, so his action is required.
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PULL gpio-for-next] gpio: make flags mandatory for gpiod_get functions
  2015-07-15  6:39       ` Alexandre Courbot
@ 2015-07-17 12:28         ` Linus Walleij
  2015-07-20  6:56           ` Uwe Kleine-König
  0 siblings, 1 reply; 26+ messages in thread
From: Linus Walleij @ 2015-07-17 12:28 UTC (permalink / raw)
  To: Alexandre Courbot; +Cc: Uwe Kleine-König, linux-gpio, Sascha Hauer

On Wed, Jul 15, 2015 at 8:39 AM, Alexandre Courbot <gnurou@gmail.com> wrote:
> On Wed, Jul 15, 2015 at 3:28 PM, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
>> Hello Linus, hello Alexandre,
>>
>> On Wed, Jul 08, 2015 at 12:51:38PM +0200, Uwe Kleine-König wrote:
>>> On Mon, Jul 06, 2015 at 11:07:59AM +0200, Uwe Kleine-König wrote:
>>> > now that all patches that were in next hit Linus Torvalds' tree and
>>> > v4.2-rc1 is out here comes the promised pull request that makes usage of
>>> > the flags parameter mandatory for gpiod_get et al:
>>> >
>>> > The following changes since commit d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754:
>>> >
>>> >   Linux 4.2-rc1 (2015-07-05 11:01:52 -0700)
>>> >
>>> > are available in the git repository at:
>>> >
>>> >   git://git.pengutronix.de/git/ukl/linux.git tags/gpiod-flags-for-4.3
>>> >
>>> > for you to fetch changes up to b17d1bf16cc72a374a48d748940f700009d40ff4:
>>> >
>>> >   gpio: make flags mandatory for gpiod_get functions (2015-07-06 10:39:24 +0200)
>>> gentle ping!
>> the (or at least my) plan was to get this into next early after the
>> merge window for 4.2 closes. Now we're already at -rc2. Can you please
>> comment?
>>
>> As of next-20150715 there don't seem to be any new users of gpiod
>> without flags btw.
>
> I'm all for taking this into -next ASAP then. Linus has control over
> the tree though, so his action is required.

I am pushing it today.

I finally found this message in my messy inbox. I'm a bit up over my
ears in patches...

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PULL gpio-for-next] gpio: make flags mandatory for gpiod_get functions
  2015-07-17 12:28         ` Linus Walleij
@ 2015-07-20  6:56           ` Uwe Kleine-König
  2015-07-20  7:41             ` Linus Walleij
  2015-07-20  8:28             ` Linus Walleij
  0 siblings, 2 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-20  6:56 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Alexandre Courbot, linux-gpio, kernel

Hello Linus,

On Fri, Jul 17, 2015 at 02:28:25PM +0200, Linus Walleij wrote:
> On Wed, Jul 15, 2015 at 8:39 AM, Alexandre Courbot <gnurou@gmail.com> wrote:
> > I'm all for taking this into -next ASAP then. Linus has control over
> > the tree though, so his action is required.
> 
> I am pushing it today.
> 
> I finally found this message in my messy inbox. I'm a bit up over my
> ears in patches...
This somehow failed.  My tag is merged in your devel branch, but this
contains several commits missing in your for-next. Is this intended?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PULL gpio-for-next] gpio: make flags mandatory for gpiod_get functions
  2015-07-20  6:56           ` Uwe Kleine-König
@ 2015-07-20  7:41             ` Linus Walleij
  2015-07-20  7:51               ` Uwe Kleine-König
  2015-07-20  8:28             ` Linus Walleij
  1 sibling, 1 reply; 26+ messages in thread
From: Linus Walleij @ 2015-07-20  7:41 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Alexandre Courbot, linux-gpio, Sascha Hauer

On Mon, Jul 20, 2015 at 8:56 AM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> Hello Linus,
>
> On Fri, Jul 17, 2015 at 02:28:25PM +0200, Linus Walleij wrote:
>> On Wed, Jul 15, 2015 at 8:39 AM, Alexandre Courbot <gnurou@gmail.com> wrote:
>> > I'm all for taking this into -next ASAP then. Linus has control over
>> > the tree though, so his action is required.
>>
>> I am pushing it today.
>>
>> I finally found this message in my messy inbox. I'm a bit up over my
>> ears in patches...
> This somehow failed.  My tag is merged in your devel branch, but this
> contains several commits missing in your for-next. Is this intended?

No ... :(

I just pulled it in. If anything is to blame, I hope it's not me, I just
issued git pull.

commit 2563606ce45314bfeae811edfa9984b1921fff06
Merge: 015403145a65 b17d1bf16cc7
Author: Linus Walleij <linus.walleij@linaro.org>
Date:   Fri Jul 17 13:44:15 2015 +0200

    Merge tag 'gpiod-flags-for-4.3' of
git://git.pengutronix.de/git/ukl/linux into devel

    The last patch in this series makes the flags parameter for the various
    gpiod_get* functions mandatory and so allows to remove an ugly cpp hack
    introduced in commit 39b2bbe3d715 (gpio: add flags argument to gpiod_get*()
    functions) for v3.17-rc1.

    The other nine commits fix the last remaining users of these functions that
    don't pass flags yet. (Only etraxfs-uart wasn't fixed; this
driver's use of the
    gpiod functions needs fixing anyhow.)


Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PULL gpio-for-next] gpio: make flags mandatory for gpiod_get functions
  2015-07-20  7:41             ` Linus Walleij
@ 2015-07-20  7:51               ` Uwe Kleine-König
  0 siblings, 0 replies; 26+ messages in thread
From: Uwe Kleine-König @ 2015-07-20  7:51 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Alexandre Courbot, linux-gpio, Sascha Hauer

Hello Linus,

On Mon, Jul 20, 2015 at 09:41:09AM +0200, Linus Walleij wrote:
> On Mon, Jul 20, 2015 at 8:56 AM, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> > Hello Linus,
> >
> > On Fri, Jul 17, 2015 at 02:28:25PM +0200, Linus Walleij wrote:
> >> On Wed, Jul 15, 2015 at 8:39 AM, Alexandre Courbot <gnurou@gmail.com> wrote:
> >> > I'm all for taking this into -next ASAP then. Linus has control over
> >> > the tree though, so his action is required.
> >>
> >> I am pushing it today.
> >>
> >> I finally found this message in my messy inbox. I'm a bit up over my
> >> ears in patches...
> > This somehow failed.  My tag is merged in your devel branch, but this
> > contains several commits missing in your for-next. Is this intended?
> 
> No ... :(
> 
> I just pulled it in. If anything is to blame, I hope it's not me, I just
> issued git pull.
> 
> commit 2563606ce45314bfeae811edfa9984b1921fff06
> Merge: 015403145a65 b17d1bf16cc7
> Author: Linus Walleij <linus.walleij@linaro.org>
> Date:   Fri Jul 17 13:44:15 2015 +0200
> 
>     Merge tag 'gpiod-flags-for-4.3' of
> git://git.pengutronix.de/git/ukl/linux into devel
> 
>     The last patch in this series makes the flags parameter for the various
>     gpiod_get* functions mandatory and so allows to remove an ugly cpp hack
>     introduced in commit 39b2bbe3d715 (gpio: add flags argument to gpiod_get*()
>     functions) for v3.17-rc1.
> 
>     The other nine commits fix the last remaining users of these functions that
>     don't pass flags yet. (Only etraxfs-uart wasn't fixed; this
> driver's use of the
>     gpiod functions needs fixing anyhow.)
this is fine. It contains my signed data (you have to do

	git cat-file commit 2563606ce45314bfeae811edfa9984b1921fff06

to see that) and the usual ö-Problem doesn't exist here, because it was
me who created the commits.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PULL gpio-for-next] gpio: make flags mandatory for gpiod_get functions
  2015-07-20  6:56           ` Uwe Kleine-König
  2015-07-20  7:41             ` Linus Walleij
@ 2015-07-20  8:28             ` Linus Walleij
  1 sibling, 0 replies; 26+ messages in thread
From: Linus Walleij @ 2015-07-20  8:28 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Alexandre Courbot, linux-gpio, Sascha Hauer

On Mon, Jul 20, 2015 at 8:56 AM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:

>> I finally found this message in my messy inbox. I'm a bit up over my
>> ears in patches...
>
> This somehow failed.  My tag is merged in your devel branch, but this
> contains several commits missing in your for-next. Is this intended?

Ah wait I see.

I pushed it to devel for testing, but the 0day build was not completing
so I did not get green light to push it to next.

I'll push to linux-next now.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2015-07-20  8:28 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-15 21:36 [PATCH] gpio: make flags mandatory for gpiod_get functions Uwe Kleine-König
2015-06-21  6:51 ` Alexandre Courbot
2015-07-06  9:07 ` [PULL gpio-for-next] " Uwe Kleine-König
2015-07-06  9:07   ` Uwe Kleine-König
2015-07-06  9:09   ` [PATCH gpio-for-next 01/10] drm/msm/dp: use flags argument of devm_gpiod_get to set direction Uwe Kleine-König
2015-07-06  9:09   ` [PATCH gpio-for-next 02/10] drm/tilcdc: panel: make better use of gpiod API Uwe Kleine-König
2015-07-06  9:09   ` [PATCH gpio-for-next 05/10] media: i2c/adp1653: set enable gpio to output Uwe Kleine-König
2015-07-06  9:09   ` [PATCH gpio-for-next 06/10] NFC: nxp-nci_i2c: use flags argument of devm_gpiod_get_index Uwe Kleine-König
2015-07-06  9:09   ` [PATCH gpio-for-next 07/10] phy: tusb1210: make better use of gpiod API Uwe Kleine-König
2015-07-06  9:09   ` [PATCH gpio-for-next 08/10] usb: dwc3: pci: " Uwe Kleine-König
     [not found]   ` <20150706090759.GS11824-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-07-06  9:09     ` [PATCH gpio-for-next 03/10] iio: light: stk3310: use flags argument of devm_gpiod_get Uwe Kleine-König
2015-07-06  9:09       ` Uwe Kleine-König
2015-07-06  9:35       ` Breana, Tiberiu A
2015-07-06  9:35         ` Breana, Tiberiu A
2015-07-06  9:09     ` [PATCH gpio-for-next 04/10] iio: magn: bmc150: " Uwe Kleine-König
2015-07-06  9:09       ` Uwe Kleine-König
2015-07-06  9:09     ` [PATCH gpio-for-next 09/10] usb: pass flags parameter to gpiod_get functions Uwe Kleine-König
2015-07-06  9:09   ` [PATCH gpio-for-next 10/10] gpio: make flags mandatory for " Uwe Kleine-König
2015-07-08 10:51   ` [PULL gpio-for-next] " Uwe Kleine-König
2015-07-15  6:28     ` Uwe Kleine-König
2015-07-15  6:39       ` Alexandre Courbot
2015-07-17 12:28         ` Linus Walleij
2015-07-20  6:56           ` Uwe Kleine-König
2015-07-20  7:41             ` Linus Walleij
2015-07-20  7:51               ` Uwe Kleine-König
2015-07-20  8:28             ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.