diff options
author | Devendra Naga <devendra.aaru@gmail.com> | 2013-06-04 01:16:20 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-06 02:25:41 +0400 |
commit | 55fa328aecb1daf9134278b0eb660502627bf60e (patch) | |
tree | 4832f9f128c6f91d7b986784e5291d74947072e6 /drivers/staging/octeon-usb/octeon-hcd.c | |
parent | 3fa98f34b8e39bbadb8bc723c0773b73b262663c (diff) | |
download | linux-55fa328aecb1daf9134278b0eb660502627bf60e.tar.xz |
staging: octeon-usb: check return value of platform_device_register_simple
the return value is a pointer having an error set. we have to check for
IS_ERR and return PTR_ERR when appropriate
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: David Daney <ddaney.cavm@gmail.com>
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/octeon-usb/octeon-hcd.c')
-rw-r--r-- | drivers/staging/octeon-usb/octeon-hcd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c index 987e6a90cbbc..f3a096be2aba 100644 --- a/drivers/staging/octeon-usb/octeon-hcd.c +++ b/drivers/staging/octeon-usb/octeon-hcd.c @@ -23,6 +23,8 @@ #include <linux/usb/hcd.h> +#include <linux/err.h> + //#define DEBUG_CALL(format, ...) printk(format, ##__VA_ARGS__) #define DEBUG_CALL(format, ...) do {} while (0) //#define DEBUG_SUBMIT(format, ...) printk(format, ##__VA_ARGS__) @@ -781,9 +783,9 @@ static int __init octeon_usb_module_init(void) irq_resource.end = irq_resource.start; irq_resource.flags = IORESOURCE_IRQ; pdev = platform_device_register_simple((char*)octeon_usb_driver.name, device, &irq_resource, 1); - if (!pdev) { + if (IS_ERR(pdev)) { DEBUG_FATAL("OcteonUSB: Failed to allocate platform device for USB%d\n", device); - return -ENOMEM; + return PTR_ERR(pdev); } if (device < MAX_USB_PORTS) pdev_glob[device] = pdev; |