linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio: mvebu: allow building the module with COMPILE_TEST=y
@ 2024-09-30  9:11 Bartosz Golaszewski
  2024-09-30  9:11 ` [PATCH 2/2] gpio: mvebu: use generic device properties Bartosz Golaszewski
  2024-10-08  8:09 ` [PATCH 1/2] gpio: mvebu: allow building the module with COMPILE_TEST=y Bartosz Golaszewski
  0 siblings, 2 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2024-09-30  9:11 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Uwe Kleine-König
  Cc: linux-gpio, linux-kernel, linux-pwm, Bartosz Golaszewski

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

Make it possible to build the module when COMPILE_TEST is enabled for
better build coverage.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/gpio/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index d93cd4f722b4..98722e814e81 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -487,7 +487,7 @@ config GPIO_MT7621
 
 config GPIO_MVEBU
 	def_bool y
-	depends on PLAT_ORION || ARCH_MVEBU
+	depends on PLAT_ORION || ARCH_MVEBU || COMPILE_TEST
 	depends on OF_GPIO
 	select GENERIC_IRQ_CHIP
 	select REGMAP_MMIO
-- 
2.43.0


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

* [PATCH 2/2] gpio: mvebu: use generic device properties
  2024-09-30  9:11 [PATCH 1/2] gpio: mvebu: allow building the module with COMPILE_TEST=y Bartosz Golaszewski
@ 2024-09-30  9:11 ` Bartosz Golaszewski
  2024-10-01  7:33   ` Uwe Kleine-König
  2024-10-08  8:09 ` [PATCH 1/2] gpio: mvebu: allow building the module with COMPILE_TEST=y Bartosz Golaszewski
  1 sibling, 1 reply; 5+ messages in thread
From: Bartosz Golaszewski @ 2024-09-30  9:11 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Uwe Kleine-König
  Cc: linux-gpio, linux-kernel, linux-pwm, Bartosz Golaszewski

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

OF-specific routines should not be used unless necessary. Generic device
properties are preferred so switch to using them in the driver code.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/gpio/gpio-mvebu.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 8cfd3a89c018..5ffb332e9849 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -794,8 +794,8 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
 	u32 set;
 
 	if (mvchip->soc_variant == MVEBU_GPIO_SOC_VARIANT_A8K) {
-		int ret = of_property_read_u32(dev->of_node,
-					       "marvell,pwm-offset", &offset);
+		int ret = device_property_read_u32(dev, "marvell,pwm-offset",
+						   &offset);
 		if (ret < 0)
 			return 0;
 	} else {
@@ -1106,7 +1106,7 @@ static int mvebu_gpio_probe_syscon(struct platform_device *pdev,
 	if (IS_ERR(mvchip->regs))
 		return PTR_ERR(mvchip->regs);
 
-	if (of_property_read_u32(pdev->dev.of_node, "offset", &mvchip->offset))
+	if (device_property_read_u32(&pdev->dev, "offset", &mvchip->offset))
 		return -EINVAL;
 
 	return 0;
@@ -1147,7 +1147,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, mvchip);
 
-	if (of_property_read_u32(pdev->dev.of_node, "ngpios", &ngpios)) {
+	if (device_property_read_u32(&pdev->dev, "ngpios", &ngpios)) {
 		dev_err(&pdev->dev, "Missing ngpios OF property\n");
 		return -ENODEV;
 	}
-- 
2.43.0


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

* Re: [PATCH 2/2] gpio: mvebu: use generic device properties
  2024-09-30  9:11 ` [PATCH 2/2] gpio: mvebu: use generic device properties Bartosz Golaszewski
@ 2024-10-01  7:33   ` Uwe Kleine-König
  2024-10-01  8:42     ` Bartosz Golaszewski
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2024-10-01  7:33 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Linus Walleij, linux-gpio, linux-kernel, linux-pwm,
	Bartosz Golaszewski

[-- Attachment #1: Type: text/plain, Size: 1516 bytes --]

Hello Bart,

On Mon, Sep 30, 2024 at 11:11:11AM +0200, Bartosz Golaszewski wrote:
> diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
> index 8cfd3a89c018..5ffb332e9849 100644
> --- a/drivers/gpio/gpio-mvebu.c
> +++ b/drivers/gpio/gpio-mvebu.c
> @@ -794,8 +794,8 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
>  	u32 set;
>  
>  	if (mvchip->soc_variant == MVEBU_GPIO_SOC_VARIANT_A8K) {
> -		int ret = of_property_read_u32(dev->of_node,
> -					       "marvell,pwm-offset", &offset);
> +		int ret = device_property_read_u32(dev, "marvell,pwm-offset",
> +						   &offset);
>  		if (ret < 0)
>  			return 0;
>  	} else {
> @@ -1106,7 +1106,7 @@ static int mvebu_gpio_probe_syscon(struct platform_device *pdev,
>  	if (IS_ERR(mvchip->regs))
>  		return PTR_ERR(mvchip->regs);
>  
> -	if (of_property_read_u32(pdev->dev.of_node, "offset", &mvchip->offset))
> +	if (device_property_read_u32(&pdev->dev, "offset", &mvchip->offset))
>  		return -EINVAL;
>  
>  	return 0;
> @@ -1147,7 +1147,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, mvchip);
>  
> -	if (of_property_read_u32(pdev->dev.of_node, "ngpios", &ngpios)) {
> +	if (device_property_read_u32(&pdev->dev, "ngpios", &ngpios)) {
>  		dev_err(&pdev->dev, "Missing ngpios OF property\n");
>  		return -ENODEV;
>  	}

I didn't look closely, but I wonder if GPIO_MVEBU depending on OF_GPIO
can be softened with this change?!

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 2/2] gpio: mvebu: use generic device properties
  2024-10-01  7:33   ` Uwe Kleine-König
@ 2024-10-01  8:42     ` Bartosz Golaszewski
  0 siblings, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2024-10-01  8:42 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Linus Walleij, linux-gpio, linux-kernel, linux-pwm,
	Bartosz Golaszewski

On Tue, Oct 1, 2024 at 9:34 AM Uwe Kleine-König
<u.kleine-koenig@baylibre.com> wrote:
>
> I didn't look closely, but I wonder if GPIO_MVEBU depending on OF_GPIO
> can be softened with this change?!
>

Yes, this can be done in a follow-up patch.

Bart

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

* Re: [PATCH 1/2] gpio: mvebu: allow building the module with COMPILE_TEST=y
  2024-09-30  9:11 [PATCH 1/2] gpio: mvebu: allow building the module with COMPILE_TEST=y Bartosz Golaszewski
  2024-09-30  9:11 ` [PATCH 2/2] gpio: mvebu: use generic device properties Bartosz Golaszewski
@ 2024-10-08  8:09 ` Bartosz Golaszewski
  1 sibling, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2024-10-08  8:09 UTC (permalink / raw)
  To: Linus Walleij, Uwe Kleine-König, Bartosz Golaszewski
  Cc: Bartosz Golaszewski, linux-gpio, linux-kernel, linux-pwm

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


On Mon, 30 Sep 2024 11:11:10 +0200, Bartosz Golaszewski wrote:
> Make it possible to build the module when COMPILE_TEST is enabled for
> better build coverage.
> 
> 

Applied, thanks!

[1/2] gpio: mvebu: allow building the module with COMPILE_TEST=y
      commit: 956ee0c5c969c9caf6744e166f5a80526be10c5b
[2/2] gpio: mvebu: use generic device properties
      commit: ddfdfe76ca54e5615a8e3eefd7dbe44c624ee9fa

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

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

end of thread, other threads:[~2024-10-08  8:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-30  9:11 [PATCH 1/2] gpio: mvebu: allow building the module with COMPILE_TEST=y Bartosz Golaszewski
2024-09-30  9:11 ` [PATCH 2/2] gpio: mvebu: use generic device properties Bartosz Golaszewski
2024-10-01  7:33   ` Uwe Kleine-König
2024-10-01  8:42     ` Bartosz Golaszewski
2024-10-08  8:09 ` [PATCH 1/2] gpio: mvebu: allow building the module with COMPILE_TEST=y 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).