[RESEND,v2] leds: syscon: Support 'reg' in addition to 'offset' for register address

Message ID 20231122230754.2844665-2-robh@kernel.org
State New
Headers
Series [RESEND,v2] leds: syscon: Support 'reg' in addition to 'offset' for register address |

Commit Message

Rob Herring Nov. 22, 2023, 11:07 p.m. UTC
  The register-bit-led binding now also supports 'reg' in addition to
'offset' for the register address. Add support to the driver to get the
address from 'reg'.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
The binding change landed, but v2[1] was never applied. The last 
resend[2] may have missed kernel.org addresses.

[1] https://lore.kernel.org/all/20210913192816.1225025-3-robh@kernel.org/
[2] https://lore.kernel.org/all/20231025190619.881090-2-robh@kernel.org/

 drivers/leds/leds-syscon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Lee Jones Nov. 23, 2023, 9:12 a.m. UTC | #1
On Wed, 22 Nov 2023, Rob Herring wrote:

> The register-bit-led binding now also supports 'reg' in addition to
> 'offset' for the register address. Add support to the driver to get the
> address from 'reg'.
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> The binding change landed, but v2[1] was never applied. The last 
> resend[2] may have missed kernel.org addresses.
> 
> [1] https://lore.kernel.org/all/20210913192816.1225025-3-robh@kernel.org/
> [2] https://lore.kernel.org/all/20231025190619.881090-2-robh@kernel.org/
> 
>  drivers/leds/leds-syscon.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Looks like I just applied the last one.  I'm assuming no additional
changes, but please let me know if that's not the case.
  

Patch

diff --git a/drivers/leds/leds-syscon.c b/drivers/leds/leds-syscon.c
index 360a376fa738..d633ad519d0c 100644
--- a/drivers/leds/leds-syscon.c
+++ b/drivers/leds/leds-syscon.c
@@ -81,7 +81,8 @@  static int syscon_led_probe(struct platform_device *pdev)
 
 	sled->map = map;
 
-	if (of_property_read_u32(np, "offset", &sled->offset))
+	if (of_property_read_u32(np, "reg", &sled->offset) &&
+	    of_property_read_u32(np, "offset", &sled->offset))
 		return -EINVAL;
 	if (of_property_read_u32(np, "mask", &sled->mask))
 		return -EINVAL;