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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




If platform_device_alloc fails, return -ENOMEM, not ENODEV.

Signed-off-by:   Jim Cromie <[email protected]>


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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux