Skip to content

Commit

Permalink
mfd: core: Add helper function to register hotplug devices
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hovold authored and Lee Jones committed Nov 10, 2014
1 parent f114040 commit a797547
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/linux/mfd/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a797547

Please sign in to comment.