linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: Use of_property_present() for non-boolean properties
@ 2024-11-04 19:06 Rob Herring (Arm)
  2024-11-05  6:17 ` Dragan Simic
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rob Herring (Arm) @ 2024-11-04 19:06 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Heiko Stuebner
  Cc: linux-gpio, linux-arm-kernel, linux-rockchip, linux-kernel

The use of of_property_read_bool() for non-boolean properties is
deprecated in favor of of_property_present() when testing for property
presence.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
 drivers/gpio/gpio-rockchip.c | 2 +-
 drivers/gpio/gpiolib-of.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c
index 365ab947983c..64924bc01591 100644
--- a/drivers/gpio/gpio-rockchip.c
+++ b/drivers/gpio/gpio-rockchip.c
@@ -602,7 +602,7 @@ static int rockchip_gpiolib_register(struct rockchip_pin_bank *bank)
 	 * files which don't set the "gpio-ranges" property or systems that
 	 * utilize ACPI the driver has to call gpiochip_add_pin_range().
 	 */
-	if (!of_property_read_bool(bank->of_node, "gpio-ranges")) {
+	if (!of_property_present(bank->of_node, "gpio-ranges")) {
 		struct device_node *pctlnp = of_get_parent(bank->of_node);
 		struct pinctrl_dev *pctldev = NULL;
 
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 880f1efcaca5..2e537ee979f3 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -337,7 +337,7 @@ static void of_gpio_flags_quirks(const struct device_node *np,
 	 * to determine if the flags should have inverted semantics.
 	 */
 	if (IS_ENABLED(CONFIG_SPI_MASTER) && !strcmp(propname, "cs-gpios") &&
-	    of_property_read_bool(np, "cs-gpios")) {
+	    of_property_present(np, "cs-gpios")) {
 		u32 cs;
 		int ret;
 
-- 
2.45.2



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

* Re: [PATCH] gpio: Use of_property_present() for non-boolean properties
  2024-11-04 19:06 [PATCH] gpio: Use of_property_present() for non-boolean properties Rob Herring (Arm)
@ 2024-11-05  6:17 ` Dragan Simic
  2024-11-05 16:11 ` Heiko Stübner
  2024-11-06 13:41 ` Bartosz Golaszewski
  2 siblings, 0 replies; 4+ messages in thread
From: Dragan Simic @ 2024-11-05  6:17 UTC (permalink / raw)
  To: Rob Herring (Arm)
  Cc: Linus Walleij, Bartosz Golaszewski, Heiko Stuebner, linux-gpio,
	linux-arm-kernel, linux-rockchip, linux-kernel

Hello Rob,

On 2024-11-04 20:06, Rob Herring (Arm) wrote:
> The use of of_property_read_bool() for non-boolean properties is
> deprecated in favor of of_property_present() when testing for property
> presence.
> 
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

Looking good to me, thanks for the patch!

Reviewed-by: Dragan Simic <dsimic@manjaro.org>

> ---
>  drivers/gpio/gpio-rockchip.c | 2 +-
>  drivers/gpio/gpiolib-of.c    | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-rockchip.c 
> b/drivers/gpio/gpio-rockchip.c
> index 365ab947983c..64924bc01591 100644
> --- a/drivers/gpio/gpio-rockchip.c
> +++ b/drivers/gpio/gpio-rockchip.c
> @@ -602,7 +602,7 @@ static int rockchip_gpiolib_register(struct
> rockchip_pin_bank *bank)
>  	 * files which don't set the "gpio-ranges" property or systems that
>  	 * utilize ACPI the driver has to call gpiochip_add_pin_range().
>  	 */
> -	if (!of_property_read_bool(bank->of_node, "gpio-ranges")) {
> +	if (!of_property_present(bank->of_node, "gpio-ranges")) {
>  		struct device_node *pctlnp = of_get_parent(bank->of_node);
>  		struct pinctrl_dev *pctldev = NULL;
> 
> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> index 880f1efcaca5..2e537ee979f3 100644
> --- a/drivers/gpio/gpiolib-of.c
> +++ b/drivers/gpio/gpiolib-of.c
> @@ -337,7 +337,7 @@ static void of_gpio_flags_quirks(const struct
> device_node *np,
>  	 * to determine if the flags should have inverted semantics.
>  	 */
>  	if (IS_ENABLED(CONFIG_SPI_MASTER) && !strcmp(propname, "cs-gpios") &&
> -	    of_property_read_bool(np, "cs-gpios")) {
> +	    of_property_present(np, "cs-gpios")) {
>  		u32 cs;
>  		int ret;


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

* Re: [PATCH] gpio: Use of_property_present() for non-boolean properties
  2024-11-04 19:06 [PATCH] gpio: Use of_property_present() for non-boolean properties Rob Herring (Arm)
  2024-11-05  6:17 ` Dragan Simic
@ 2024-11-05 16:11 ` Heiko Stübner
  2024-11-06 13:41 ` Bartosz Golaszewski
  2 siblings, 0 replies; 4+ messages in thread
From: Heiko Stübner @ 2024-11-05 16:11 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Rob Herring (Arm)
  Cc: linux-gpio, linux-arm-kernel, linux-rockchip, linux-kernel

Am Montag, 4. November 2024, 20:06:27 CET schrieb Rob Herring (Arm):
> The use of of_property_read_bool() for non-boolean properties is
> deprecated in favor of of_property_present() when testing for property
> presence.
> 
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

With of_property_present essentially just mapping to of_property_read_bool,
this change looks correct and should not introduce any functional differences

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

> ---
>  drivers/gpio/gpio-rockchip.c | 2 +-
>  drivers/gpio/gpiolib-of.c    | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c
> index 365ab947983c..64924bc01591 100644
> --- a/drivers/gpio/gpio-rockchip.c
> +++ b/drivers/gpio/gpio-rockchip.c
> @@ -602,7 +602,7 @@ static int rockchip_gpiolib_register(struct rockchip_pin_bank *bank)
>  	 * files which don't set the "gpio-ranges" property or systems that
>  	 * utilize ACPI the driver has to call gpiochip_add_pin_range().
>  	 */
> -	if (!of_property_read_bool(bank->of_node, "gpio-ranges")) {
> +	if (!of_property_present(bank->of_node, "gpio-ranges")) {
>  		struct device_node *pctlnp = of_get_parent(bank->of_node);
>  		struct pinctrl_dev *pctldev = NULL;
>  
> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> index 880f1efcaca5..2e537ee979f3 100644
> --- a/drivers/gpio/gpiolib-of.c
> +++ b/drivers/gpio/gpiolib-of.c
> @@ -337,7 +337,7 @@ static void of_gpio_flags_quirks(const struct device_node *np,
>  	 * to determine if the flags should have inverted semantics.
>  	 */
>  	if (IS_ENABLED(CONFIG_SPI_MASTER) && !strcmp(propname, "cs-gpios") &&
> -	    of_property_read_bool(np, "cs-gpios")) {
> +	    of_property_present(np, "cs-gpios")) {
>  		u32 cs;
>  		int ret;
>  
> 






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

* Re: [PATCH] gpio: Use of_property_present() for non-boolean properties
  2024-11-04 19:06 [PATCH] gpio: Use of_property_present() for non-boolean properties Rob Herring (Arm)
  2024-11-05  6:17 ` Dragan Simic
  2024-11-05 16:11 ` Heiko Stübner
@ 2024-11-06 13:41 ` Bartosz Golaszewski
  2 siblings, 0 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2024-11-06 13:41 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Heiko Stuebner,
	Rob Herring (Arm)
  Cc: Bartosz Golaszewski, linux-gpio, linux-arm-kernel, linux-rockchip,
	linux-kernel

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


On Mon, 04 Nov 2024 13:06:27 -0600, Rob Herring (Arm) wrote:
> The use of of_property_read_bool() for non-boolean properties is
> deprecated in favor of of_property_present() when testing for property
> presence.
> 
> 

Applied, thanks!

[1/1] gpio: Use of_property_present() for non-boolean properties
      commit: c6789170ddef58d28cfbc3342933713ce1e2c860

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


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

end of thread, other threads:[~2024-11-06 13:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-04 19:06 [PATCH] gpio: Use of_property_present() for non-boolean properties Rob Herring (Arm)
2024-11-05  6:17 ` Dragan Simic
2024-11-05 16:11 ` Heiko Stübner
2024-11-06 13:41 ` Bartosz Golaszewski

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