Skip to content

Commit

Permalink
Merge tag 'mfd-fixes-4.9.1' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/lee/mfd

Pull MFD fixes from Lee Jones:
 "Received a copule of last minute fixes for v4.9.

  The patches from Viresh are fixing issues displayed in KernelCI"

* tag 'mfd-fixes-4.9.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd:
  mfd: wm8994-core: Don't use managed regulator bulk get API
  mfd: wm8994-core: Disable regulators before removing them
  mfd: syscon: Support native-endian regmaps
  • Loading branch information
torvalds committed Nov 25, 2016
2 parents ea9ea6c + 1a41741 commit f2051f8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion drivers/mfd/syscon.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ static struct syscon *of_syscon_register(struct device_node *np)
/* Parse the device's DT node for an endianness specification */
if (of_property_read_bool(np, "big-endian"))
syscon_config.val_format_endian = REGMAP_ENDIAN_BIG;
else if (of_property_read_bool(np, "little-endian"))
else if (of_property_read_bool(np, "little-endian"))
syscon_config.val_format_endian = REGMAP_ENDIAN_LITTLE;
else if (of_property_read_bool(np, "native-endian"))
syscon_config.val_format_endian = REGMAP_ENDIAN_NATIVE;

/*
* search for reg-io-width property in DT. If it is not provided,
Expand Down
16 changes: 12 additions & 4 deletions drivers/mfd/wm8994-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,13 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
BUG();
goto err;
}

ret = devm_regulator_bulk_get(wm8994->dev, wm8994->num_supplies,

/*
* Can't use devres helper here as some of the supplies are provided by
* wm8994->dev's children (regulators) and those regulators are
* unregistered by the devres core before the supplies are freed.
*/
ret = regulator_bulk_get(wm8994->dev, wm8994->num_supplies,
wm8994->supplies);
if (ret != 0) {
dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret);
Expand All @@ -405,7 +410,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
wm8994->supplies);
if (ret != 0) {
dev_err(wm8994->dev, "Failed to enable supplies: %d\n", ret);
goto err;
goto err_regulator_free;
}

ret = wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET);
Expand Down Expand Up @@ -596,6 +601,8 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
err_enable:
regulator_bulk_disable(wm8994->num_supplies,
wm8994->supplies);
err_regulator_free:
regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);
err:
mfd_remove_devices(wm8994->dev);
return ret;
Expand All @@ -604,10 +611,11 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
static void wm8994_device_exit(struct wm8994 *wm8994)
{
pm_runtime_disable(wm8994->dev);
mfd_remove_devices(wm8994->dev);
wm8994_irq_exit(wm8994);
regulator_bulk_disable(wm8994->num_supplies,
wm8994->supplies);
regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);
mfd_remove_devices(wm8994->dev);
}

static const struct of_device_id wm8994_of_match[] = {
Expand Down

0 comments on commit f2051f8

Please sign in to comment.