Merge branch 'x86/vt-d' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu...
[cascardo/linux.git] / drivers / mfd / mfd-core.c
index f3338fe..2a87f69 100644 (file)
@@ -125,9 +125,15 @@ static int mfd_add_device(struct device *parent, int id,
        struct platform_device *pdev;
        struct device_node *np = NULL;
        int ret = -ENOMEM;
+       int platform_id;
        int r;
 
-       pdev = platform_device_alloc(cell->name, id + cell->id);
+       if (id < 0)
+               platform_id = id;
+       else
+               platform_id = id + cell->id;
+
+       pdev = platform_device_alloc(cell->name, platform_id);
        if (!pdev)
                goto fail_alloc;