diff options
Diffstat (limited to 'drivers/mfd/wm8994-core.c')
-rw-r--r-- | drivers/mfd/wm8994-core.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c index ac0b8f91f815..4b36f021413f 100644 --- a/drivers/mfd/wm8994-core.c +++ b/drivers/mfd/wm8994-core.c | |||
@@ -387,7 +387,7 @@ static __devinit int wm8994_device_init(struct wm8994 *wm8994, int irq) | |||
387 | NULL, 0); | 387 | NULL, 0); |
388 | if (ret != 0) { | 388 | if (ret != 0) { |
389 | dev_err(wm8994->dev, "Failed to add children: %d\n", ret); | 389 | dev_err(wm8994->dev, "Failed to add children: %d\n", ret); |
390 | goto err_regmap; | 390 | goto err; |
391 | } | 391 | } |
392 | 392 | ||
393 | switch (wm8994->type) { | 393 | switch (wm8994->type) { |
@@ -402,7 +402,7 @@ static __devinit int wm8994_device_init(struct wm8994 *wm8994, int irq) | |||
402 | break; | 402 | break; |
403 | default: | 403 | default: |
404 | BUG(); | 404 | BUG(); |
405 | goto err_regmap; | 405 | goto err; |
406 | } | 406 | } |
407 | 407 | ||
408 | wm8994->supplies = devm_kzalloc(wm8994->dev, | 408 | wm8994->supplies = devm_kzalloc(wm8994->dev, |
@@ -410,7 +410,7 @@ static __devinit int wm8994_device_init(struct wm8994 *wm8994, int irq) | |||
410 | wm8994->num_supplies, GFP_KERNEL); | 410 | wm8994->num_supplies, GFP_KERNEL); |
411 | if (!wm8994->supplies) { | 411 | if (!wm8994->supplies) { |
412 | ret = -ENOMEM; | 412 | ret = -ENOMEM; |
413 | goto err_regmap; | 413 | goto err; |
414 | } | 414 | } |
415 | 415 | ||
416 | switch (wm8994->type) { | 416 | switch (wm8994->type) { |
@@ -428,14 +428,14 @@ static __devinit int wm8994_device_init(struct wm8994 *wm8994, int irq) | |||
428 | break; | 428 | break; |
429 | default: | 429 | default: |
430 | BUG(); | 430 | BUG(); |
431 | goto err_regmap; | 431 | goto err; |
432 | } | 432 | } |
433 | 433 | ||
434 | ret = regulator_bulk_get(wm8994->dev, wm8994->num_supplies, | 434 | ret = regulator_bulk_get(wm8994->dev, wm8994->num_supplies, |
435 | wm8994->supplies); | 435 | wm8994->supplies); |
436 | if (ret != 0) { | 436 | if (ret != 0) { |
437 | dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret); | 437 | dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret); |
438 | goto err_regmap; | 438 | goto err; |
439 | } | 439 | } |
440 | 440 | ||
441 | ret = regulator_bulk_enable(wm8994->num_supplies, | 441 | ret = regulator_bulk_enable(wm8994->num_supplies, |
@@ -567,7 +567,7 @@ static __devinit int wm8994_device_init(struct wm8994 *wm8994, int irq) | |||
567 | if (ret != 0) { | 567 | if (ret != 0) { |
568 | dev_err(wm8994->dev, "Failed to register patch: %d\n", | 568 | dev_err(wm8994->dev, "Failed to register patch: %d\n", |
569 | ret); | 569 | ret); |
570 | goto err_regmap; | 570 | goto err; |
571 | } | 571 | } |
572 | } | 572 | } |
573 | 573 | ||
@@ -633,8 +633,7 @@ err_enable: | |||
633 | wm8994->supplies); | 633 | wm8994->supplies); |
634 | err_get: | 634 | err_get: |
635 | regulator_bulk_free(wm8994->num_supplies, wm8994->supplies); | 635 | regulator_bulk_free(wm8994->num_supplies, wm8994->supplies); |
636 | err_regmap: | 636 | err: |
637 | regmap_exit(wm8994->regmap); | ||
638 | mfd_remove_devices(wm8994->dev); | 637 | mfd_remove_devices(wm8994->dev); |
639 | return ret; | 638 | return ret; |
640 | } | 639 | } |
@@ -647,7 +646,6 @@ static __devexit void wm8994_device_exit(struct wm8994 *wm8994) | |||
647 | regulator_bulk_disable(wm8994->num_supplies, | 646 | regulator_bulk_disable(wm8994->num_supplies, |
648 | wm8994->supplies); | 647 | wm8994->supplies); |
649 | regulator_bulk_free(wm8994->num_supplies, wm8994->supplies); | 648 | regulator_bulk_free(wm8994->num_supplies, wm8994->supplies); |
650 | regmap_exit(wm8994->regmap); | ||
651 | } | 649 | } |
652 | 650 | ||
653 | static const struct of_device_id wm8994_of_match[] = { | 651 | static const struct of_device_id wm8994_of_match[] = { |
@@ -673,7 +671,7 @@ static __devinit int wm8994_i2c_probe(struct i2c_client *i2c, | |||
673 | wm8994->irq = i2c->irq; | 671 | wm8994->irq = i2c->irq; |
674 | wm8994->type = id->driver_data; | 672 | wm8994->type = id->driver_data; |
675 | 673 | ||
676 | wm8994->regmap = regmap_init_i2c(i2c, &wm8994_base_regmap_config); | 674 | wm8994->regmap = devm_regmap_init_i2c(i2c, &wm8994_base_regmap_config); |
677 | if (IS_ERR(wm8994->regmap)) { | 675 | if (IS_ERR(wm8994->regmap)) { |
678 | ret = PTR_ERR(wm8994->regmap); | 676 | ret = PTR_ERR(wm8994->regmap); |
679 | dev_err(wm8994->dev, "Failed to allocate register map: %d\n", | 677 | dev_err(wm8994->dev, "Failed to allocate register map: %d\n", |