|
@@ -33,7 +33,7 @@
|
|
#include <asm/system_misc.h>
|
|
#include <asm/system_misc.h>
|
|
|
|
|
|
struct xgene_reboot_context {
|
|
struct xgene_reboot_context {
|
|
- struct platform_device *pdev;
|
|
|
|
|
|
+ struct device *dev;
|
|
void *csr;
|
|
void *csr;
|
|
u32 mask;
|
|
u32 mask;
|
|
};
|
|
};
|
|
@@ -53,27 +53,28 @@ static void xgene_restart(enum reboot_mode mode, const char *cmd)
|
|
while (time_before(jiffies, timeout))
|
|
while (time_before(jiffies, timeout))
|
|
cpu_relax();
|
|
cpu_relax();
|
|
|
|
|
|
- dev_emerg(&ctx->pdev->dev, "Unable to restart system\n");
|
|
|
|
|
|
+ dev_emerg(ctx->dev, "Unable to restart system\n");
|
|
}
|
|
}
|
|
|
|
|
|
static int xgene_reboot_probe(struct platform_device *pdev)
|
|
static int xgene_reboot_probe(struct platform_device *pdev)
|
|
{
|
|
{
|
|
struct xgene_reboot_context *ctx;
|
|
struct xgene_reboot_context *ctx;
|
|
|
|
+ struct device *dev = &pdev->dev;
|
|
|
|
|
|
- ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
|
|
|
|
|
|
+ ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
|
|
if (!ctx)
|
|
if (!ctx)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
|
|
|
|
- ctx->csr = of_iomap(pdev->dev.of_node, 0);
|
|
|
|
|
|
+ ctx->csr = of_iomap(dev->of_node, 0);
|
|
if (!ctx->csr) {
|
|
if (!ctx->csr) {
|
|
- dev_err(&pdev->dev, "can not map resource\n");
|
|
|
|
|
|
+ dev_err(dev, "can not map resource\n");
|
|
return -ENODEV;
|
|
return -ENODEV;
|
|
}
|
|
}
|
|
|
|
|
|
- if (of_property_read_u32(pdev->dev.of_node, "mask", &ctx->mask))
|
|
|
|
|
|
+ if (of_property_read_u32(dev->of_node, "mask", &ctx->mask))
|
|
ctx->mask = 0xFFFFFFFF;
|
|
ctx->mask = 0xFFFFFFFF;
|
|
|
|
|
|
- ctx->pdev = pdev;
|
|
|
|
|
|
+ ctx->dev = dev;
|
|
arm_pm_restart = xgene_restart;
|
|
arm_pm_restart = xgene_restart;
|
|
xgene_restart_ctx = ctx;
|
|
xgene_restart_ctx = ctx;
|
|
|
|
|