Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345048
b: refs/heads/master
c: 62d62b5
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed Dec 2, 2012
1 parent f31830c commit 09ef36c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0582c0fafc36e4a1f2067ea8377c9902cc7997bf
refs/heads/master: 62d62b59bd100b8f146ea941dad273656371a386
17 changes: 12 additions & 5 deletions trunk/drivers/mfd/arizona-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ int __devinit arizona_dev_init(struct arizona *arizona)
struct device *dev = arizona->dev;
const char *type_name;
unsigned int reg, val;
int (*apply_patch)(struct arizona *) = NULL;
int ret, i;

dev_set_drvdata(arizona->dev, arizona);
Expand Down Expand Up @@ -391,7 +392,7 @@ int __devinit arizona_dev_init(struct arizona *arizona)
arizona->type);
arizona->type = WM5102;
}
ret = wm5102_patch(arizona);
apply_patch = wm5102_patch;
break;
#endif
#ifdef CONFIG_MFD_WM5110
Expand All @@ -402,7 +403,7 @@ int __devinit arizona_dev_init(struct arizona *arizona)
arizona->type);
arizona->type = WM5110;
}
ret = wm5110_patch(arizona);
apply_patch = wm5110_patch;
break;
#endif
default:
Expand All @@ -412,9 +413,6 @@ int __devinit arizona_dev_init(struct arizona *arizona)

dev_info(dev, "%s revision %c\n", type_name, arizona->rev + 'A');

if (ret != 0)
dev_err(arizona->dev, "Failed to apply patch: %d\n", ret);

/* If we have a /RESET GPIO we'll already be reset */
if (!arizona->pdata.reset) {
ret = regmap_write(arizona->regmap, ARIZONA_SOFTWARE_RESET, 0);
Expand All @@ -430,6 +428,15 @@ int __devinit arizona_dev_init(struct arizona *arizona)
goto err_reset;
}

if (apply_patch) {
ret = apply_patch(arizona);
if (ret != 0) {
dev_err(arizona->dev, "Failed to apply patch: %d\n",
ret);
goto err_reset;
}
}

for (i = 0; i < ARRAY_SIZE(arizona->pdata.gpio_defaults); i++) {
if (!arizona->pdata.gpio_defaults[i])
continue;
Expand Down

0 comments on commit 09ef36c

Please sign in to comment.