diff options
Diffstat (limited to 'drivers/power/reset/syscon-reboot.c')
-rw-r--r-- | drivers/power/reset/syscon-reboot.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/power/reset/syscon-reboot.c b/drivers/power/reset/syscon-reboot.c index 2dbb6c1ddc..61bea6169c 100644 --- a/drivers/power/reset/syscon-reboot.c +++ b/drivers/power/reset/syscon-reboot.c @@ -9,6 +9,7 @@ #include <init.h> #include <restart.h> #include <mfd/syscon.h> +#include <linux/regmap.h> struct syscon_reboot_context { struct regmap *map; @@ -32,7 +33,7 @@ static void __noreturn syscon_restart_handle(struct restart_handler *this) panic("Unable to restart system\n"); } -static int syscon_reboot_probe(struct device_d *dev) +static int syscon_reboot_probe(struct device *dev) { struct syscon_reboot_context *ctx; int mask_err, value_err; @@ -42,18 +43,18 @@ static int syscon_reboot_probe(struct device_d *dev) if (!ctx) return -ENOMEM; - ctx->map = syscon_regmap_lookup_by_phandle(dev->device_node, "regmap"); + ctx->map = syscon_regmap_lookup_by_phandle(dev->of_node, "regmap"); if (IS_ERR(ctx->map)) { - ctx->map = syscon_node_to_regmap(dev->parent->device_node); + ctx->map = syscon_node_to_regmap(dev->parent->of_node); if (IS_ERR(ctx->map)) return PTR_ERR(ctx->map); } - if (of_property_read_u32(dev->device_node, "offset", &ctx->offset)) + if (of_property_read_u32(dev->of_node, "offset", &ctx->offset)) return -EINVAL; - value_err = of_property_read_u32(dev->device_node, "value", &ctx->value); - mask_err = of_property_read_u32(dev->device_node, "mask", &ctx->mask); + value_err = of_property_read_u32(dev->of_node, "value", &ctx->value); + mask_err = of_property_read_u32(dev->of_node, "mask", &ctx->mask); if (value_err && mask_err) { dev_err(dev, "unable to read 'value' and 'mask'"); return -EINVAL; @@ -71,6 +72,7 @@ static int syscon_reboot_probe(struct device_d *dev) ctx->restart_handler.name = "syscon-reboot"; ctx->restart_handler.restart = syscon_restart_handle; ctx->restart_handler.priority = 192; + ctx->restart_handler.of_node = dev->of_node; err = restart_handler_register(&ctx->restart_handler); if (err) @@ -83,8 +85,9 @@ static const struct of_device_id syscon_reboot_of_match[] = { { .compatible = "syscon-reboot" }, {} }; +MODULE_DEVICE_TABLE(of, syscon_reboot_of_match); -static struct driver_d syscon_reboot_driver = { +static struct driver syscon_reboot_driver = { .probe = syscon_reboot_probe, .name = "syscon-reboot", .of_compatible = syscon_reboot_of_match, |