linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h
@ 2025-02-17 10:39 Bartosz Golaszewski
  2025-02-17 10:39 ` [PATCH v4 2/2] gpiolib: don't build HTE code with CONFIG_HTE disabled Bartosz Golaszewski
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Bartosz Golaszewski @ 2025-02-17 10:39 UTC (permalink / raw)
  To: Dipen Patel, Linus Walleij
  Cc: linux-gpio, linux-kernel, timestamp, Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

We have several conditional includes depending on !CONFIG_GPIOLIB. This
is supposed to reduce compilation time with CONFIG_GPIOLIB=y but in
practice there's no difference on modern machines. It makes adding new
stubs that depend on more than just GPIOLIB harder so move them all to
the top, unduplicate them and replace asm/ with preferred linux/
alternatives.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
Changes in v4:
- rebased after fixing conflicts

 include/linux/gpio/consumer.h | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index 5cbd4afd7862..0dc49b5fca5c 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -3,7 +3,10 @@
 #define __LINUX_GPIO_CONSUMER_H
 
 #include <linux/bits.h>
+#include <linux/bug.h>
 #include <linux/err.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
 #include <linux/types.h>
 
 struct acpi_device;
@@ -184,11 +187,6 @@ struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,
 
 #else /* CONFIG_GPIOLIB */
 
-#include <linux/err.h>
-#include <linux/kernel.h>
-
-#include <asm/bug.h>
-
 static inline int gpiod_count(struct device *dev, const char *con_id)
 {
 	return 0;
@@ -609,8 +607,6 @@ int devm_acpi_dev_add_driver_gpios(struct device *dev,
 
 #else  /* CONFIG_GPIOLIB && CONFIG_ACPI */
 
-#include <linux/err.h>
-
 static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev,
 			      const struct acpi_gpio_mapping *gpios)
 {
@@ -636,8 +632,6 @@ void gpiod_unexport(struct gpio_desc *desc);
 
 #else  /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */
 
-#include <asm/errno.h>
-
 static inline int gpiod_export(struct gpio_desc *desc,
 			       bool direction_may_change)
 {
-- 
2.45.2


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

* [PATCH v4 2/2] gpiolib: don't build HTE code with CONFIG_HTE disabled
  2025-02-17 10:39 [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h Bartosz Golaszewski
@ 2025-02-17 10:39 ` Bartosz Golaszewski
  2025-02-19 22:24   ` Dipen Patel
  2025-02-18 10:26 ` [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h Bartosz Golaszewski
  2025-02-19 12:32 ` Andy Shevchenko
  2 siblings, 1 reply; 7+ messages in thread
From: Bartosz Golaszewski @ 2025-02-17 10:39 UTC (permalink / raw)
  To: Dipen Patel, Linus Walleij
  Cc: linux-gpio, linux-kernel, timestamp, Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Hardware timestamping is only used on tegra186 platforms but we include
the code and export the symbols everywhere. Shrink the binary a bit by
compiling the relevant functions conditionally.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
Changes in v4:
- rebased after fixing conflicts

 drivers/gpio/gpiolib.c        |  2 ++
 include/linux/gpio/consumer.h | 36 +++++++++++++++++++++--------------
 2 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index f261f7893f85..65ca749a1078 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2906,6 +2906,7 @@ int gpiod_direction_output_nonotify(struct gpio_desc *desc, int value)
 	return 0;
 }
 
+#if IS_ENABLED(CONFIG_HTE)
 /**
  * gpiod_enable_hw_timestamp_ns - Enable hardware timestamp in nanoseconds.
  *
@@ -2971,6 +2972,7 @@ int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags)
 	return ret;
 }
 EXPORT_SYMBOL_GPL(gpiod_disable_hw_timestamp_ns);
+#endif /* CONFIG_HTE */
 
 /**
  * gpiod_set_config - sets @config for a GPIO
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index 0dc49b5fca5c..0b2b56199c36 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -114,8 +114,6 @@ int gpiod_get_direction(struct gpio_desc *desc);
 int gpiod_direction_input(struct gpio_desc *desc);
 int gpiod_direction_output(struct gpio_desc *desc, int value);
 int gpiod_direction_output_raw(struct gpio_desc *desc, int value);
-int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags);
-int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags);
 
 /* Value get/set from non-sleeping context */
 int gpiod_get_value(const struct gpio_desc *desc);
@@ -347,18 +345,6 @@ static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value)
 	WARN_ON(desc);
 	return -ENOSYS;
 }
-static inline int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc,
-					       unsigned long flags)
-{
-	WARN_ON(desc);
-	return -ENOSYS;
-}
-static inline int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc,
-						unsigned long flags)
-{
-	WARN_ON(desc);
-	return -ENOSYS;
-}
 static inline int gpiod_get_value(const struct gpio_desc *desc)
 {
 	/* GPIO can never have been requested */
@@ -559,6 +545,28 @@ struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,
 
 #endif /* CONFIG_GPIOLIB */
 
+#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_HTE)
+int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags);
+int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags);
+#else
+static inline int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc,
+					       unsigned long flags)
+{
+	if (!IS_ENABLED(CONFIG_GPIOLIB))
+		WARN_ON(desc);
+
+	return -ENOSYS;
+}
+static inline int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc,
+						unsigned long flags)
+{
+	if (!IS_ENABLED(CONFIG_GPIOLIB))
+		WARN_ON(desc);
+
+	return -ENOSYS;
+}
+#endif /* CONFIG_GPIOLIB && CONFIG_HTE */
+
 static inline
 struct gpio_desc *devm_fwnode_gpiod_get(struct device *dev,
 					struct fwnode_handle *fwnode,
-- 
2.45.2


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

* Re: [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h
  2025-02-17 10:39 [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h Bartosz Golaszewski
  2025-02-17 10:39 ` [PATCH v4 2/2] gpiolib: don't build HTE code with CONFIG_HTE disabled Bartosz Golaszewski
@ 2025-02-18 10:26 ` Bartosz Golaszewski
  2025-02-19 12:32 ` Andy Shevchenko
  2 siblings, 0 replies; 7+ messages in thread
From: Bartosz Golaszewski @ 2025-02-18 10:26 UTC (permalink / raw)
  To: Dipen Patel, Linus Walleij, Bartosz Golaszewski
  Cc: Bartosz Golaszewski, linux-gpio, linux-kernel, timestamp

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Mon, 17 Feb 2025 11:39:21 +0100, Bartosz Golaszewski wrote:
> We have several conditional includes depending on !CONFIG_GPIOLIB. This
> is supposed to reduce compilation time with CONFIG_GPIOLIB=y but in
> practice there's no difference on modern machines. It makes adding new
> stubs that depend on more than just GPIOLIB harder so move them all to
> the top, unduplicate them and replace asm/ with preferred linux/
> alternatives.
> 
> [...]

Applied, thanks!

[1/2] gpiolib: move all includes to the top of gpio/consumer.h
      commit: dea69f2d1cc8d9ecdc72ba350d10a1e71940ef18
[2/2] gpiolib: don't build HTE code with CONFIG_HTE disabled
      commit: 63cdf6241ac7edd94cb4cd9a8f1ba2c3c61ed219

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

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

* Re: [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h
  2025-02-17 10:39 [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h Bartosz Golaszewski
  2025-02-17 10:39 ` [PATCH v4 2/2] gpiolib: don't build HTE code with CONFIG_HTE disabled Bartosz Golaszewski
  2025-02-18 10:26 ` [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h Bartosz Golaszewski
@ 2025-02-19 12:32 ` Andy Shevchenko
  2025-02-19 14:35   ` Bartosz Golaszewski
  2 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2025-02-19 12:32 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Dipen Patel, Linus Walleij, linux-gpio, linux-kernel, timestamp,
	Bartosz Golaszewski

On Mon, Feb 17, 2025 at 11:39:21AM +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> We have several conditional includes depending on !CONFIG_GPIOLIB. This
> is supposed to reduce compilation time with CONFIG_GPIOLIB=y but in
> practice there's no difference on modern machines.

It's not about modern machines. If every maintainer will think this way,
we end up in the complete and utter dead end with the headers.

I believe you at least had read the cover letter for the infamous Ingo's series
about headers and how it speeds up the build (in some cases up to 70% on as you
said "modern machines").

> It makes adding new stubs that depend on more than just GPIOLIB harder so
> move them all to the top, unduplicate them and replace asm/ with preferred
> linux/ alternatives.

NAK.

This makes dependency hell things much worse and this is a step back on the
untangling the current situation along with the slowing down the speed of the
build. Please. consider to revert or discard this patch.

...

>  #include <linux/bits.h>
> +#include <linux/bug.h>

Okay to replace, but not okay to move.

>  #include <linux/err.h>
> +#include <linux/errno.h>

Please, double check that it uses error codes from it, otherwise err.h includes
asm/errno.h with basic codes already.

> +#include <linux/kernel.h>

This is definitely no. Please, read what's written in the top of that file and
here is just a proxy for should come in the future a kind of might_sleep.h.
Do not move this one at all, please.

>  #include <linux/types.h>

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h
  2025-02-19 12:32 ` Andy Shevchenko
@ 2025-02-19 14:35   ` Bartosz Golaszewski
  2025-02-19 15:18     ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Bartosz Golaszewski @ 2025-02-19 14:35 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Dipen Patel, Linus Walleij, linux-gpio, linux-kernel, timestamp,
	Bartosz Golaszewski, Bartosz Golaszewski

On Wed, 19 Feb 2025 13:32:49 +0100, Andy Shevchenko
<andriy.shevchenko@intel.com> said:
> On Mon, Feb 17, 2025 at 11:39:21AM +0100, Bartosz Golaszewski wrote:
>> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>>
>> We have several conditional includes depending on !CONFIG_GPIOLIB. This
>> is supposed to reduce compilation time with CONFIG_GPIOLIB=y but in
>> practice there's no difference on modern machines.
>
> It's not about modern machines. If every maintainer will think this way,
> we end up in the complete and utter dead end with the headers.
>
> I believe you at least had read the cover letter for the infamous Ingo's series
> about headers and how it speeds up the build (in some cases up to 70% on as you
> said "modern machines").
>
>> It makes adding new stubs that depend on more than just GPIOLIB harder so
>> move them all to the top, unduplicate them and replace asm/ with preferred
>> linux/ alternatives.
>
> NAK.
>
> This makes dependency hell things much worse and this is a step back on the
> untangling the current situation along with the slowing down the speed of the
> build. Please. consider to revert or discard this patch.
>
> ...
>
>>  #include <linux/bits.h>
>> +#include <linux/bug.h>
>
> Okay to replace, but not okay to move.
>
>>  #include <linux/err.h>
>> +#include <linux/errno.h>
>
> Please, double check that it uses error codes from it, otherwise err.h includes
> asm/errno.h with basic codes already.
>
>> +#include <linux/kernel.h>
>
> This is definitely no. Please, read what's written in the top of that file and
> here is just a proxy for should come in the future a kind of might_sleep.h.
> Do not move this one at all, please.
>
>>  #include <linux/types.h>
>

Fair enough. Does this look right to you?

diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index 0b2b56199c36..38e313fd0e9a 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -3,10 +3,6 @@
 #define __LINUX_GPIO_CONSUMER_H

 #include <linux/bits.h>
-#include <linux/bug.h>
-#include <linux/err.h>
-#include <linux/errno.h>
-#include <linux/kernel.h>
 #include <linux/types.h>

 struct acpi_device;
@@ -185,6 +181,10 @@ struct gpio_desc
*devm_fwnode_gpiod_get_index(struct device *dev,

 #else /* CONFIG_GPIOLIB */

+#include <linux/bug.h>
+#include <linux/err.h>
+#include <linux/kernel.h>
+
 static inline int gpiod_count(struct device *dev, const char *con_id)
 {
	return 0;
@@ -549,6 +549,10 @@ struct gpio_desc
*devm_fwnode_gpiod_get_index(struct device *dev,
 int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags);
 int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags);
 #else
+
+#include <linux/bug.h>
+#include <linux/err.h>
+
 static inline int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc,
					       unsigned long flags)
 {
@@ -615,6 +619,8 @@ int devm_acpi_dev_add_driver_gpios(struct device *dev,

 #else  /* CONFIG_GPIOLIB && CONFIG_ACPI */

+#include <linux/err.h>
+
 static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev,
			      const struct acpi_gpio_mapping *gpios)
 {
@@ -640,6 +646,8 @@ void gpiod_unexport(struct gpio_desc *desc);

 #else  /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */

+#include <linux/err.h>
+
 static inline int gpiod_export(struct gpio_desc *desc,
			       bool direction_may_change)
 {

Bart

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

* Re: [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h
  2025-02-19 14:35   ` Bartosz Golaszewski
@ 2025-02-19 15:18     ` Andy Shevchenko
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2025-02-19 15:18 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Dipen Patel, Linus Walleij, linux-gpio, linux-kernel, timestamp,
	Bartosz Golaszewski

On Wed, Feb 19, 2025 at 06:35:59AM -0800, Bartosz Golaszewski wrote:
> On Wed, 19 Feb 2025 13:32:49 +0100, Andy Shevchenko
> <andriy.shevchenko@intel.com> said:
> > On Mon, Feb 17, 2025 at 11:39:21AM +0100, Bartosz Golaszewski wrote:
> >> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >>
> >> We have several conditional includes depending on !CONFIG_GPIOLIB. This
> >> is supposed to reduce compilation time with CONFIG_GPIOLIB=y but in
> >> practice there's no difference on modern machines.
> >
> > It's not about modern machines. If every maintainer will think this way,
> > we end up in the complete and utter dead end with the headers.
> >
> > I believe you at least had read the cover letter for the infamous Ingo's series
> > about headers and how it speeds up the build (in some cases up to 70% on as you
> > said "modern machines").
> >
> >> It makes adding new stubs that depend on more than just GPIOLIB harder so
> >> move them all to the top, unduplicate them and replace asm/ with preferred
> >> linux/ alternatives.
> >
> > NAK.
> >
> > This makes dependency hell things much worse and this is a step back on the
> > untangling the current situation along with the slowing down the speed of the
> > build. Please. consider to revert or discard this patch.
> >
> > ...
> >
> >>  #include <linux/bits.h>
> >> +#include <linux/bug.h>
> >
> > Okay to replace, but not okay to move.
> >
> >>  #include <linux/err.h>
> >> +#include <linux/errno.h>
> >
> > Please, double check that it uses error codes from it, otherwise err.h includes
> > asm/errno.h with basic codes already.
> >
> >> +#include <linux/kernel.h>
> >
> > This is definitely no. Please, read what's written in the top of that file and
> > here is just a proxy for should come in the future a kind of might_sleep.h.
> > Do not move this one at all, please.
> >
> >>  #include <linux/types.h>


Fair enough. Does this look right to you?

For kernel.h definitely, for err.h you proved your point (but which was unclear
to me as the repetitions are already being in a number).

For bug.h looks also good. But I prefer to use asm/bug.h as it's the one that
provides the APIs. Note, the reference to the recommended linux/* headers
rather than asm/* applies to the C code or custom headers which are not under
include/*. The latter should be optimized to what it uses exactly.

So, summarizing the above I would return kernel.h to where it belongs and
move back to asm/bug.h.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v4 2/2] gpiolib: don't build HTE code with CONFIG_HTE disabled
  2025-02-17 10:39 ` [PATCH v4 2/2] gpiolib: don't build HTE code with CONFIG_HTE disabled Bartosz Golaszewski
@ 2025-02-19 22:24   ` Dipen Patel
  0 siblings, 0 replies; 7+ messages in thread
From: Dipen Patel @ 2025-02-19 22:24 UTC (permalink / raw)
  To: Bartosz Golaszewski, Linus Walleij
  Cc: linux-gpio, linux-kernel, timestamp, Bartosz Golaszewski

On 2/17/25 2:39 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> Hardware timestamping is only used on tegra186 platforms but we include
> the code and export the symbols everywhere. Shrink the binary a bit by
> compiling the relevant functions conditionally.
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
> Changes in v4:
> - rebased after fixing conflicts
> 
>  drivers/gpio/gpiolib.c        |  2 ++
>  include/linux/gpio/consumer.h | 36 +++++++++++++++++++++--------------
>  2 files changed, 24 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index f261f7893f85..65ca749a1078 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -2906,6 +2906,7 @@ int gpiod_direction_output_nonotify(struct gpio_desc *desc, int value)
>  	return 0;
>  }
>  
> +#if IS_ENABLED(CONFIG_HTE)
>  /**
>   * gpiod_enable_hw_timestamp_ns - Enable hardware timestamp in nanoseconds.
>   *
> @@ -2971,6 +2972,7 @@ int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags)
>  	return ret;
>  }
>  EXPORT_SYMBOL_GPL(gpiod_disable_hw_timestamp_ns);
> +#endif /* CONFIG_HTE */
>  
>  /**
>   * gpiod_set_config - sets @config for a GPIO
> diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
> index 0dc49b5fca5c..0b2b56199c36 100644
> --- a/include/linux/gpio/consumer.h
> +++ b/include/linux/gpio/consumer.h
> @@ -114,8 +114,6 @@ int gpiod_get_direction(struct gpio_desc *desc);
>  int gpiod_direction_input(struct gpio_desc *desc);
>  int gpiod_direction_output(struct gpio_desc *desc, int value);
>  int gpiod_direction_output_raw(struct gpio_desc *desc, int value);
> -int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags);
> -int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags);
>  
>  /* Value get/set from non-sleeping context */
>  int gpiod_get_value(const struct gpio_desc *desc);
> @@ -347,18 +345,6 @@ static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value)
>  	WARN_ON(desc);
>  	return -ENOSYS;
>  }
> -static inline int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc,
> -					       unsigned long flags)
> -{
> -	WARN_ON(desc);
> -	return -ENOSYS;
> -}
> -static inline int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc,
> -						unsigned long flags)
> -{
> -	WARN_ON(desc);
> -	return -ENOSYS;
> -}
>  static inline int gpiod_get_value(const struct gpio_desc *desc)
>  {
>  	/* GPIO can never have been requested */
> @@ -559,6 +545,28 @@ struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,
>  
>  #endif /* CONFIG_GPIOLIB */
>  
> +#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_HTE)
> +int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags);
> +int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc, unsigned long flags);
> +#else
> +static inline int gpiod_enable_hw_timestamp_ns(struct gpio_desc *desc,
> +					       unsigned long flags)
> +{
> +	if (!IS_ENABLED(CONFIG_GPIOLIB))
> +		WARN_ON(desc);
> +
> +	return -ENOSYS;
> +}
> +static inline int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc,
> +						unsigned long flags)
> +{
> +	if (!IS_ENABLED(CONFIG_GPIOLIB))
> +		WARN_ON(desc);
> +
> +	return -ENOSYS;
> +}
> +#endif /* CONFIG_GPIOLIB && CONFIG_HTE */
> +
>  static inline
>  struct gpio_desc *devm_fwnode_gpiod_get(struct device *dev,
>  					struct fwnode_handle *fwnode,
Acked-by: Dipen Patel <dipenp@nvidia.com>

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

end of thread, other threads:[~2025-02-19 22:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-17 10:39 [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h Bartosz Golaszewski
2025-02-17 10:39 ` [PATCH v4 2/2] gpiolib: don't build HTE code with CONFIG_HTE disabled Bartosz Golaszewski
2025-02-19 22:24   ` Dipen Patel
2025-02-18 10:26 ` [PATCH v4 1/2] gpiolib: move all includes to the top of gpio/consumer.h Bartosz Golaszewski
2025-02-19 12:32 ` Andy Shevchenko
2025-02-19 14:35   ` Bartosz Golaszewski
2025-02-19 15:18     ` Andy Shevchenko

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).