[PATCH] Driver Core: Fix platform_device_add to use device_add
authorRussell King <rmk+lkml@arm.linux.org.uk>
Sat, 6 May 2006 07:15:26 +0000 (08:15 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 21 Jun 2006 19:40:48 +0000 (12:40 -0700)
platform_device_add() should be using device_add() rather
than device_register() - any platform device passed to
platform_device_add() should have already been initialised,
either by platform_device_alloc() or platform_device_register().

Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/platform.c

index f8071976fe07591c0def1cb2a8d4de18d94b219d..2b8755db76c6e65f48b7784cb463d6a213238453 100644 (file)
@@ -275,7 +275,7 @@ int platform_device_add(struct platform_device *pdev)
        pr_debug("Registering platform device '%s'. Parent at %s\n",
                 pdev->dev.bus_id, pdev->dev.parent->bus_id);
 
-       ret = device_register(&pdev->dev);
+       ret = device_add(&pdev->dev);
        if (ret == 0)
                return ret;