ACPI: bay: use IS_ERR for return of register_platform_device_simple
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Wed, 14 Feb 2007 12:55:00 +0000 (10:55 -0200)
committerLen Brown <len.brown@intel.com>
Fri, 16 Feb 2007 23:35:23 +0000 (18:35 -0500)
register_platform_device_simple returns ERR_PTR(foo), so test it with
IS_ERR(foo).

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/bay.c

index 73dc10db4a8880833dbbf3f488a37db2c359e7c8..9c28081ba6a67b9036dcf3c4253207d0ddf0de26 100644 (file)
@@ -283,7 +283,7 @@ static int bay_add(acpi_handle handle, int id)
 
        /* initialize platform device stuff */
        pdev = platform_device_register_simple(ACPI_BAY_CLASS, id, NULL, 0);
-       if (pdev == NULL) {
+       if (IS_ERR(pdev)) {
                printk(KERN_ERR PREFIX "Error registering bay device\n");
                goto bay_add_err;
        }