diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2005-10-25 15:34:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 19:47:50 -0400 |
commit | 72129cd6577793408ff546b0ddd5794c33f32399 (patch) | |
tree | c60564a0cd92d95d1c6d3830fee8c034df112abf /drivers/usb | |
parent | 3f13e66e219238e025ff561d69826da9342c3f4a (diff) |
[PATCH] mdc800: remove embrions of C++ exceptions
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/image/mdc800.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c index e4ec133ee74a..1d973bcf56aa 100644 --- a/drivers/usb/image/mdc800.c +++ b/drivers/usb/image/mdc800.c | |||
@@ -975,13 +975,13 @@ static struct usb_driver mdc800_usb_driver = | |||
975 | Init and Cleanup this driver (Main Functions) | 975 | Init and Cleanup this driver (Main Functions) |
976 | *************************************************************************/ | 976 | *************************************************************************/ |
977 | 977 | ||
978 | #define try(A) if (!(A)) goto cleanup_on_fail; | ||
979 | |||
980 | static int __init usb_mdc800_init (void) | 978 | static int __init usb_mdc800_init (void) |
981 | { | 979 | { |
982 | int retval = -ENODEV; | 980 | int retval = -ENODEV; |
983 | /* Allocate Memory */ | 981 | /* Allocate Memory */ |
984 | try (mdc800=kmalloc (sizeof (struct mdc800_data), GFP_KERNEL)); | 982 | mdc800=kmalloc (sizeof (struct mdc800_data), GFP_KERNEL); |
983 | if (!mdc800) | ||
984 | goto cleanup_on_fail; | ||
985 | 985 | ||
986 | memset(mdc800, 0, sizeof(struct mdc800_data)); | 986 | memset(mdc800, 0, sizeof(struct mdc800_data)); |
987 | mdc800->dev = NULL; | 987 | mdc800->dev = NULL; |
@@ -997,13 +997,25 @@ static int __init usb_mdc800_init (void) | |||
997 | mdc800->downloaded = 0; | 997 | mdc800->downloaded = 0; |
998 | mdc800->written = 0; | 998 | mdc800->written = 0; |
999 | 999 | ||
1000 | try (mdc800->irq_urb_buffer=kmalloc (8, GFP_KERNEL)); | 1000 | mdc800->irq_urb_buffer=kmalloc (8, GFP_KERNEL); |
1001 | try (mdc800->write_urb_buffer=kmalloc (8, GFP_KERNEL)); | 1001 | if (!mdc800->irq_urb_buffer) |
1002 | try (mdc800->download_urb_buffer=kmalloc (64, GFP_KERNEL)); | 1002 | goto cleanup_on_fail; |
1003 | mdc800->write_urb_buffer=kmalloc (8, GFP_KERNEL); | ||
1004 | if (!mdc800->write_urb_buffer) | ||
1005 | goto cleanup_on_fail; | ||
1006 | mdc800->download_urb_buffer=kmalloc (64, GFP_KERNEL); | ||
1007 | if (!mdc800->download_urb_buffer) | ||
1008 | goto cleanup_on_fail; | ||
1003 | 1009 | ||
1004 | try (mdc800->irq_urb=usb_alloc_urb (0, GFP_KERNEL)); | 1010 | mdc800->irq_urb=usb_alloc_urb (0, GFP_KERNEL); |
1005 | try (mdc800->download_urb=usb_alloc_urb (0, GFP_KERNEL)); | 1011 | if (!mdc800->irq_urb) |
1006 | try (mdc800->write_urb=usb_alloc_urb (0, GFP_KERNEL)); | 1012 | goto cleanup_on_fail; |
1013 | mdc800->download_urb=usb_alloc_urb (0, GFP_KERNEL); | ||
1014 | if (!mdc800->download_urb) | ||
1015 | goto cleanup_on_fail; | ||
1016 | mdc800->write_urb=usb_alloc_urb (0, GFP_KERNEL); | ||
1017 | if (!mdc800->write_urb) | ||
1018 | goto cleanup_on_fail; | ||
1007 | 1019 | ||
1008 | /* Register the driver */ | 1020 | /* Register the driver */ |
1009 | retval = usb_register(&mdc800_usb_driver); | 1021 | retval = usb_register(&mdc800_usb_driver); |