diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-10-29 13:03:04 +0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2013-11-11 15:22:15 +0400 |
commit | 03e361b25ee8dfb1fd9b890072c23c4aae01c6c7 (patch) | |
tree | 6adc9cb64eb9c7e7b84cb24880786aa0b9094d5a /include/linux/mfd | |
parent | 24f76f37aab7cfd97e17976b41182817e887f0e1 (diff) | |
download | linux-03e361b25ee8dfb1fd9b890072c23c4aae01c6c7.tar.xz |
mfd: Stop setting refcounting pointers in original mfd_cell arrays
Commit 1e29af62f2b285bd18685da93c3ce8c33ca2d1db ("mfd: Add refcounting
support to mfd_cells") had to drop the "const" keyword on the "cell"
parameter of mfd_add_devices(), as it added the refcounting pointers
to the objects of the passed mfd_cell array itself.
However, the mfd core code operates on copies of the mfd_cell objects,
so there's no need to modify the originally passed objects.
Hence, move the setting of the refcounting pointers from mfd_add_devices()
to mfd_platform_add_cell(), where the copy of the mfd_cell objects is made.
mfd_clone_cell() can just pass (a copy of) the original usage_count
pointer.
This allows to make the "cell" parameter of mfd_add_devices() "const"
again, and avoids future race conditions when registering multiple
instances of the same device in parallel.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'include/linux/mfd')
-rw-r--r-- | include/linux/mfd/core.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index cebe97ee98b8..60ced604664f 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -98,7 +98,7 @@ static inline const struct mfd_cell *mfd_get_cell(struct platform_device *pdev) } extern int mfd_add_devices(struct device *parent, int id, - struct mfd_cell *cells, int n_devs, + const struct mfd_cell *cells, int n_devs, struct resource *mem_base, int irq_base, struct irq_domain *irq_domain); |