diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-04-28 04:38:34 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-04-28 04:38:34 (GMT) |
commit | 37aa48368f2508defb1976be62e1ed6ca4dde683 (patch) | |
tree | 59b606c740ddd10259fbf2248bb50498a319fa6d /drivers/power | |
parent | 1da4f83c0c43f25baf356c4cc719255877da6b1e (diff) | |
parent | d1db0eea852497762cab43b905b879dfcd3b8987 (diff) | |
download | linux-37aa48368f2508defb1976be62e1ed6ca4dde683.tar.xz |
Merge 3.15-rc3 into staging-next
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/reset/vexpress-poweroff.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/power/reset/vexpress-poweroff.c b/drivers/power/reset/vexpress-poweroff.c index 476aa49..b95cf71 100644 --- a/drivers/power/reset/vexpress-poweroff.c +++ b/drivers/power/reset/vexpress-poweroff.c @@ -11,7 +11,7 @@ * Copyright (C) 2012 ARM Limited */ -#include <linux/jiffies.h> +#include <linux/delay.h> #include <linux/of.h> #include <linux/of_device.h> #include <linux/platform_device.h> @@ -23,17 +23,12 @@ static void vexpress_reset_do(struct device *dev, const char *what) { int err = -ENOENT; - struct vexpress_config_func *func = - vexpress_config_func_get_by_dev(dev); + struct vexpress_config_func *func = dev_get_drvdata(dev); if (func) { - unsigned long timeout; - err = vexpress_config_write(func, 0, 0); - - timeout = jiffies + HZ; - while (time_before(jiffies, timeout)) - cpu_relax(); + if (!err) + mdelay(1000); } dev_emerg(dev, "Unable to %s (%d)\n", what, err); @@ -96,12 +91,18 @@ static int vexpress_reset_probe(struct platform_device *pdev) enum vexpress_reset_func func; const struct of_device_id *match = of_match_device(vexpress_reset_of_match, &pdev->dev); + struct vexpress_config_func *config_func; if (match) func = (enum vexpress_reset_func)match->data; else func = pdev->id_entry->driver_data; + config_func = vexpress_config_func_get_by_dev(&pdev->dev); + if (!config_func) + return -EINVAL; + dev_set_drvdata(&pdev->dev, config_func); + switch (func) { case FUNC_SHUTDOWN: vexpress_power_off_device = &pdev->dev; |