mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
mfd: Allow multiple MFD cells with the same name
Provide basic support for MFDs having multiple cells of a given type with different IDs by adding an id to the mfd_cell structure and then adding that to the id passed in to mfd_add_devices(). As it stands this approach requires that MFDs using this feature deal with ensuring that there aren't any ID collisions resulting from multiple MFDs of the same type being instantiated. This needs to happen with the existing code too, but with this approach there is a knock on effect on the IDs for non-duplicated devices. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
f078237bcf
commit
3bed6e415f
2 changed files with 2 additions and 1 deletions
|
@ -25,7 +25,7 @@ static int mfd_add_device(struct device *parent, int id,
|
|||
int ret = -ENOMEM;
|
||||
int r;
|
||||
|
||||
pdev = platform_device_alloc(cell->name, id);
|
||||
pdev = platform_device_alloc(cell->name, id + cell->id);
|
||||
if (!pdev)
|
||||
goto fail_alloc;
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
struct mfd_cell {
|
||||
const char *name;
|
||||
int id;
|
||||
|
||||
int (*enable)(struct platform_device *dev);
|
||||
int (*disable)(struct platform_device *dev);
|
||||
|
|
Loading…
Reference in a new issue