Skip to content

Commit

Permalink
ACPI: bay: use IS_ERR for return of register_platform_device_simple
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Henrique de Moraes Holschuh authored and Len Brown committed Feb 16, 2007
1 parent ecb5f75 commit 0539771
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/acpi/bay.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0539771

Please sign in to comment.