Skip to content

Commit e633329

Browse files
palisre
authored andcommitted
power: reset: syscon-reboot: Add support for specifying priority
Read new optional device tree property priority for specifying priority level of reset handler. Default value is 192 as before. Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent d7544cb commit e633329

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/power/reset/syscon-reboot.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ static int syscon_reboot_probe(struct platform_device *pdev)
4444
struct syscon_reboot_context *ctx;
4545
struct device *dev = &pdev->dev;
4646
int mask_err, value_err;
47+
int priority;
4748
int err;
4849

4950
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
@@ -57,6 +58,9 @@ static int syscon_reboot_probe(struct platform_device *pdev)
5758
return PTR_ERR(ctx->map);
5859
}
5960

61+
if (of_property_read_s32(pdev->dev.of_node, "priority", &priority))
62+
priority = 192;
63+
6064
if (of_property_read_u32(pdev->dev.of_node, "offset", &ctx->offset))
6165
return -EINVAL;
6266

@@ -77,7 +81,7 @@ static int syscon_reboot_probe(struct platform_device *pdev)
7781
}
7882

7983
ctx->restart_handler.notifier_call = syscon_restart_handle;
80-
ctx->restart_handler.priority = 192;
84+
ctx->restart_handler.priority = priority;
8185
err = register_restart_handler(&ctx->restart_handler);
8286
if (err)
8387
dev_err(dev, "can't register restart notifier (err=%d)\n", err);

0 commit comments

Comments
 (0)