summaryrefslogtreecommitdiff
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/pm-rcar-gen2.c2
-rw-r--r--arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c18
2 files changed, 6 insertions, 14 deletions
diff --git a/arch/arm/mach-shmobile/pm-rcar-gen2.c b/arch/arm/mach-shmobile/pm-rcar-gen2.c
index 907a4f8c5aed..46654d196f8d 100644
--- a/arch/arm/mach-shmobile/pm-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/pm-rcar-gen2.c
@@ -81,7 +81,7 @@ void __init rcar_gen2_pm_init(void)
map:
/* RAM for jump stub, because BAR requires 256KB aligned address */
- if (res.start & (256 * 1024 - 1) ||
+ if (res.start & (SZ_256K - 1) ||
resource_size(&res) < shmobile_boot_size) {
pr_err("Invalid smp-sram region\n");
return;
diff --git a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
index 117e7b07995b..747a96c58df1 100644
--- a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
@@ -141,7 +141,7 @@ static struct notifier_block regulator_quirk_nb = {
static int __init rcar_gen2_regulator_quirk(void)
{
struct regulator_quirk *quirk, *pos, *tmp;
- struct of_phandle_args *argsa, *argsb;
+ struct of_phandle_args *args;
const struct of_device_id *id;
struct device_node *np;
u32 mon, addr;
@@ -164,21 +164,21 @@ static int __init rcar_gen2_regulator_quirk(void)
if (ret) /* Skip invalid entry and continue */
continue;
- quirk = kzalloc(sizeof(*quirk), GFP_KERNEL);
+ quirk = kzalloc_obj(*quirk);
if (!quirk) {
ret = -ENOMEM;
of_node_put(np);
goto err_mem;
}
- argsa = &quirk->irq_args;
+ args = &quirk->irq_args;
memcpy(&quirk->i2c_msg, id->data, sizeof(quirk->i2c_msg));
quirk->id = id;
quirk->np = of_node_get(np);
quirk->i2c_msg.addr = addr;
- ret = of_irq_parse_one(np, 0, argsa);
+ ret = of_irq_parse_one(np, 0, args);
if (ret) { /* Skip invalid entry and continue */
of_node_put(np);
kfree(quirk);
@@ -186,15 +186,7 @@ static int __init rcar_gen2_regulator_quirk(void)
}
list_for_each_entry(pos, &quirk_list, list) {
- argsb = &pos->irq_args;
-
- if (argsa->args_count != argsb->args_count)
- continue;
-
- ret = memcmp(argsa->args, argsb->args,
- argsa->args_count *
- sizeof(argsa->args[0]));
- if (!ret) {
+ if (of_phandle_args_equal(args, &pos->irq_args)) {
pos->shared = true;
quirk->shared = true;
}