[ patch -mm1 02/11 ] gpio-patchset-fixups: ENOMEM on device_add failure

From: Jim Cromie
Date: Thu Jun 22 2006 - 14:49:19 EST



If platform_device_alloc fails, return -ENOMEM, not ENODEV.

Signed-off-by: Jim Cromie <jim.cromie@xxxxxxxxx>


diff -ruNp -X dontdiff -X exclude-diffs aa-1/drivers/char/scx200_gpio.c aa-2/drivers/char/scx200_gpio.c
--- aa-1/drivers/char/scx200_gpio.c 2006-06-22 09:29:24.000000000 -0600
+++ aa-2/drivers/char/scx200_gpio.c 2006-06-22 09:43:16.000000000 -0600
@@ -87,7 +87,7 @@ static int __init scx200_gpio_init(void)
/* support dev_dbg() with pdev->dev */
pdev = platform_device_alloc(DEVNAME, 0);
if (!pdev)
- return -ENODEV;
+ return -ENOMEM;

rc = platform_device_add(pdev);
if (rc)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/