From: Johan Hovold Date: Fri, 26 Sep 2014 10:55:30 +0000 (+0200) Subject: mfd: core: Add helper function to register hotplug devices X-Git-Tag: v3.19-rc1~182^2~37^2~7 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=a7975473cc41773d9f6d8ea72b48c7656e6cd0f6;p=linux.git mfd: core: Add helper function to register hotplug devices 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 Signed-off-by: Lee Jones --- diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index 73e1709d4c09..a76bc100bf97 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -111,6 +111,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