diff mbox

[3/6] mfd: core: add helper function to register hotplug devices

Message ID 1411728933-13351-4-git-send-email-johan@kernel.org (mailing list archive)
State New, archived
Headers show

Commit Message

Johan Hovold Sept. 26, 2014, 10:55 a.m. UTC
Hot-pluggable multi-function devices should always be registered with
PLATFORM_DEVID_AUTO to avoid name collisions on the platform bus. This
helper also hides the memory map and irq parameters, which aren't used
by hot-pluggable (e.g. USB-based) devices.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 include/linux/mfd/core.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Lee Jones Oct. 7, 2014, 9:24 a.m. UTC | #1
On Fri, 26 Sep 2014, Johan Hovold wrote:

> Hot-pluggable multi-function devices should always be registered with
> PLATFORM_DEVID_AUTO to avoid name collisions on the platform bus. This
> helper also hides the memory map and irq parameters, which aren't used
> by hot-pluggable (e.g. USB-based) devices.
> 
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
>  include/linux/mfd/core.h | 7 +++++++
>  1 file changed, 7 insertions(+)

Applied for v3.19.

> diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
> index f543de91ce19..1e47262a1c63 100644
> --- a/include/linux/mfd/core.h
> +++ b/include/linux/mfd/core.h
> @@ -108,6 +108,13 @@ extern int mfd_add_devices(struct device *parent, int id,
>  			   struct resource *mem_base,
>  			   int irq_base, struct irq_domain *irq_domain);
>  
> +static inline int mfd_add_hotplug_devices(struct device *parent,
> +		const struct mfd_cell *cells, int n_devs)
> +{
> +	return mfd_add_devices(parent, PLATFORM_DEVID_AUTO, cells, n_devs,
> +			NULL, 0, NULL);
> +}
> +
>  extern void mfd_remove_devices(struct device *parent);
>  
>  #endif
diff mbox

Patch

diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index f543de91ce19..1e47262a1c63 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -108,6 +108,13 @@  extern int mfd_add_devices(struct device *parent, int id,
 			   struct resource *mem_base,
 			   int irq_base, struct irq_domain *irq_domain);
 
+static inline int mfd_add_hotplug_devices(struct device *parent,
+		const struct mfd_cell *cells, int n_devs)
+{
+	return mfd_add_devices(parent, PLATFORM_DEVID_AUTO, cells, n_devs,
+			NULL, 0, NULL);
+}
+
 extern void mfd_remove_devices(struct device *parent);
 
 #endif