diff mbox series

[v5,2/6] power: reset: syscon-reboot: Accept reg property

Message ID 20240925215847.3594898-3-chris.packham@alliedtelesis.co.nz (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series RTL9300 support for reboot and i2c | expand

Commit Message

Chris Packham Sept. 25, 2024, 9:58 p.m. UTC
For historical reasons syscon-reboot has used an 'offset' property. As a
child on a MMIO bus having a 'reg' property is more appropriate. Accept
'reg' as an alternative to 'offset'.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---

Notes:
    Changes in v5:
    - New, making the driver accept the updated binding

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

Comments

Krzysztof Kozlowski Sept. 26, 2024, 6:35 a.m. UTC | #1
On Thu, Sep 26, 2024 at 09:58:43AM +1200, Chris Packham wrote:
> For historical reasons syscon-reboot has used an 'offset' property. As a
> child on a MMIO bus having a 'reg' property is more appropriate. Accept
> 'reg' as an alternative to 'offset'.
> 
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
> 
> Notes:
>     Changes in v5:
>     - New, making the driver accept the updated binding

Thanks for doing this.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/power/reset/syscon-reboot.c b/drivers/power/reset/syscon-reboot.c
index 4d622c19bc48..d623d77e657e 100644
--- a/drivers/power/reset/syscon-reboot.c
+++ b/drivers/power/reset/syscon-reboot.c
@@ -61,7 +61,8 @@  static int syscon_reboot_probe(struct platform_device *pdev)
 		priority = 192;
 
 	if (of_property_read_u32(pdev->dev.of_node, "offset", &ctx->offset))
-		return -EINVAL;
+		if (of_property_read_u32(pdev->dev.of_node, "reg", &ctx->offset))
+			return -EINVAL;
 
 	value_err = of_property_read_u32(pdev->dev.of_node, "value", &ctx->value);
 	mask_err = of_property_read_u32(pdev->dev.of_node, "mask", &ctx->mask);