Skip to content

Commit a797547

Browse files
jhovoldLee Jones
authored andcommitted
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 <johan@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
1 parent f114040 commit a797547

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎include/linux/mfd/core.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ extern int mfd_add_devices(struct device *parent, int id,
111111
struct resource *mem_base,
112112
int irq_base, struct irq_domain *irq_domain);
113113

114+
static inline int mfd_add_hotplug_devices(struct device *parent,
115+
const struct mfd_cell *cells, int n_devs)
116+
{
117+
return mfd_add_devices(parent, PLATFORM_DEVID_AUTO, cells, n_devs,
118+
NULL, 0, NULL);
119+
}
120+
114121
extern void mfd_remove_devices(struct device *parent);
115122

116123
#endif

0 commit comments

Comments
 (0)