Skip to content

Commit f2051f8

Browse files
committed
Merge tag 'mfd-fixes-4.9.1' of git://git.kernel.org/pub/scm/linux/kernel/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
2 parents ea9ea6c + 1a41741 commit f2051f8

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

drivers/mfd/syscon.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ static struct syscon *of_syscon_register(struct device_node *np)
7373
/* Parse the device's DT node for an endianness specification */
7474
if (of_property_read_bool(np, "big-endian"))
7575
syscon_config.val_format_endian = REGMAP_ENDIAN_BIG;
76-
else if (of_property_read_bool(np, "little-endian"))
76+
else if (of_property_read_bool(np, "little-endian"))
7777
syscon_config.val_format_endian = REGMAP_ENDIAN_LITTLE;
78+
else if (of_property_read_bool(np, "native-endian"))
79+
syscon_config.val_format_endian = REGMAP_ENDIAN_NATIVE;
7880

7981
/*
8082
* search for reg-io-width property in DT. If it is not provided,

drivers/mfd/wm8994-core.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,13 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
393393
BUG();
394394
goto err;
395395
}
396-
397-
ret = devm_regulator_bulk_get(wm8994->dev, wm8994->num_supplies,
396+
397+
/*
398+
* Can't use devres helper here as some of the supplies are provided by
399+
* wm8994->dev's children (regulators) and those regulators are
400+
* unregistered by the devres core before the supplies are freed.
401+
*/
402+
ret = regulator_bulk_get(wm8994->dev, wm8994->num_supplies,
398403
wm8994->supplies);
399404
if (ret != 0) {
400405
dev_err(wm8994->dev, "Failed to get supplies: %d\n", ret);
@@ -405,7 +410,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
405410
wm8994->supplies);
406411
if (ret != 0) {
407412
dev_err(wm8994->dev, "Failed to enable supplies: %d\n", ret);
408-
goto err;
413+
goto err_regulator_free;
409414
}
410415

411416
ret = wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET);
@@ -596,6 +601,8 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
596601
err_enable:
597602
regulator_bulk_disable(wm8994->num_supplies,
598603
wm8994->supplies);
604+
err_regulator_free:
605+
regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);
599606
err:
600607
mfd_remove_devices(wm8994->dev);
601608
return ret;
@@ -604,10 +611,11 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
604611
static void wm8994_device_exit(struct wm8994 *wm8994)
605612
{
606613
pm_runtime_disable(wm8994->dev);
607-
mfd_remove_devices(wm8994->dev);
608614
wm8994_irq_exit(wm8994);
609615
regulator_bulk_disable(wm8994->num_supplies,
610616
wm8994->supplies);
617+
regulator_bulk_free(wm8994->num_supplies, wm8994->supplies);
618+
mfd_remove_devices(wm8994->dev);
611619
}
612620

613621
static const struct of_device_id wm8994_of_match[] = {

0 commit comments

Comments
 (0)