diff options
author | Guenter Roeck <linux@roeck-us.net> | 2014-09-30 13:48:30 -0400 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2014-11-16 21:07:09 -0500 |
commit | 43160718d95db9e2336cd787fa8fcad39660b883 (patch) | |
tree | ca55ca3074d5d70b47221db65757a2f43b9ab696 | |
parent | 22ecd65f4067461f0488bc9b1f2c26eb70f69fa5 (diff) |
power/reset: xgene: Use local variable dev instead of pdev->dev
Using a local variable dev to point to the device is simpler then repeatedly
dereferencing pdev->dev.
Cc: Loc Ho <lho@apm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/power/reset/xgene-reboot.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/power/reset/xgene-reboot.c b/drivers/power/reset/xgene-reboot.c index c49a3fee65e7..94f10ad4100c 100644 --- a/drivers/power/reset/xgene-reboot.c +++ b/drivers/power/reset/xgene-reboot.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include <asm/system_misc.h> | 33 | #include <asm/system_misc.h> |
34 | 34 | ||
35 | struct xgene_reboot_context { | 35 | struct xgene_reboot_context { |
36 | struct platform_device *pdev; | 36 | struct device *dev; |
37 | void *csr; | 37 | void *csr; |
38 | u32 mask; | 38 | u32 mask; |
39 | }; | 39 | }; |
@@ -53,27 +53,28 @@ static void xgene_restart(enum reboot_mode mode, const char *cmd) | |||
53 | while (time_before(jiffies, timeout)) | 53 | while (time_before(jiffies, timeout)) |
54 | cpu_relax(); | 54 | cpu_relax(); |
55 | 55 | ||
56 | dev_emerg(&ctx->pdev->dev, "Unable to restart system\n"); | 56 | dev_emerg(ctx->dev, "Unable to restart system\n"); |
57 | } | 57 | } |
58 | 58 | ||
59 | static int xgene_reboot_probe(struct platform_device *pdev) | 59 | static int xgene_reboot_probe(struct platform_device *pdev) |
60 | { | 60 | { |
61 | struct xgene_reboot_context *ctx; | 61 | struct xgene_reboot_context *ctx; |
62 | struct device *dev = &pdev->dev; | ||
62 | 63 | ||
63 | ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); | 64 | ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); |
64 | if (!ctx) | 65 | if (!ctx) |
65 | return -ENOMEM; | 66 | return -ENOMEM; |
66 | 67 | ||
67 | ctx->csr = of_iomap(pdev->dev.of_node, 0); | 68 | ctx->csr = of_iomap(dev->of_node, 0); |
68 | if (!ctx->csr) { | 69 | if (!ctx->csr) { |
69 | dev_err(&pdev->dev, "can not map resource\n"); | 70 | dev_err(dev, "can not map resource\n"); |
70 | return -ENODEV; | 71 | return -ENODEV; |
71 | } | 72 | } |
72 | 73 | ||
73 | if (of_property_read_u32(pdev->dev.of_node, "mask", &ctx->mask)) | 74 | if (of_property_read_u32(dev->of_node, "mask", &ctx->mask)) |
74 | ctx->mask = 0xFFFFFFFF; | 75 | ctx->mask = 0xFFFFFFFF; |
75 | 76 | ||
76 | ctx->pdev = pdev; | 77 | ctx->dev = dev; |
77 | arm_pm_restart = xgene_restart; | 78 | arm_pm_restart = xgene_restart; |
78 | xgene_restart_ctx = ctx; | 79 | xgene_restart_ctx = ctx; |
79 | 80 | ||