Commit e6333293 authored by Pali Rohár's avatar Pali Rohár Committed by Sebastian Reichel

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: default avatarPali Rohár <pali@kernel.org>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent d7544cbe
...@@ -44,6 +44,7 @@ static int syscon_reboot_probe(struct platform_device *pdev) ...@@ -44,6 +44,7 @@ static int syscon_reboot_probe(struct platform_device *pdev)
struct syscon_reboot_context *ctx; struct syscon_reboot_context *ctx;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
int mask_err, value_err; int mask_err, value_err;
int priority;
int err; int err;
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
...@@ -57,6 +58,9 @@ static int syscon_reboot_probe(struct platform_device *pdev) ...@@ -57,6 +58,9 @@ static int syscon_reboot_probe(struct platform_device *pdev)
return PTR_ERR(ctx->map); return PTR_ERR(ctx->map);
} }
if (of_property_read_s32(pdev->dev.of_node, "priority", &priority))
priority = 192;
if (of_property_read_u32(pdev->dev.of_node, "offset", &ctx->offset)) if (of_property_read_u32(pdev->dev.of_node, "offset", &ctx->offset))
return -EINVAL; return -EINVAL;
...@@ -77,7 +81,7 @@ static int syscon_reboot_probe(struct platform_device *pdev) ...@@ -77,7 +81,7 @@ static int syscon_reboot_probe(struct platform_device *pdev)
} }
ctx->restart_handler.notifier_call = syscon_restart_handle; ctx->restart_handler.notifier_call = syscon_restart_handle;
ctx->restart_handler.priority = 192; ctx->restart_handler.priority = priority;
err = register_restart_handler(&ctx->restart_handler); err = register_restart_handler(&ctx->restart_handler);
if (err) if (err)
dev_err(dev, "can't register restart notifier (err=%d)\n", err); dev_err(dev, "can't register restart notifier (err=%d)\n", err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment