diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-02-27 15:29:43 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-20 17:49:59 -0500 |
commit | 80b6ca48321974a6566a1c9048ba34f60420bca6 (patch) | |
tree | a350e3cf6b794081c13c89d5b1913b2c1207570d /drivers/usb/media | |
parent | d54a5cb6484705f7808b337917cc7598f2f971c3 (diff) |
[PATCH] USB: kzalloc() conversion for rest of drivers/usb
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/media')
-rw-r--r-- | drivers/usb/media/ov511.c | 4 | ||||
-rw-r--r-- | drivers/usb/media/pwc/pwc-if.c | 3 | ||||
-rw-r--r-- | drivers/usb/media/se401.c | 4 | ||||
-rw-r--r-- | drivers/usb/media/stv680.c | 7 |
4 files changed, 5 insertions, 13 deletions
diff --git a/drivers/usb/media/ov511.c b/drivers/usb/media/ov511.c index 1d887ec06080..da44579d6f29 100644 --- a/drivers/usb/media/ov511.c +++ b/drivers/usb/media/ov511.c | |||
@@ -5686,13 +5686,11 @@ ov51x_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
5686 | if (idesc->bInterfaceSubClass != 0x00) | 5686 | if (idesc->bInterfaceSubClass != 0x00) |
5687 | return -ENODEV; | 5687 | return -ENODEV; |
5688 | 5688 | ||
5689 | if ((ov = kmalloc(sizeof(*ov), GFP_KERNEL)) == NULL) { | 5689 | if ((ov = kzalloc(sizeof(*ov), GFP_KERNEL)) == NULL) { |
5690 | err("couldn't kmalloc ov struct"); | 5690 | err("couldn't kmalloc ov struct"); |
5691 | goto error_out; | 5691 | goto error_out; |
5692 | } | 5692 | } |
5693 | 5693 | ||
5694 | memset(ov, 0, sizeof(*ov)); | ||
5695 | |||
5696 | ov->dev = dev; | 5694 | ov->dev = dev; |
5697 | ov->iface = idesc->bInterfaceNumber; | 5695 | ov->iface = idesc->bInterfaceNumber; |
5698 | ov->led_policy = led; | 5696 | ov->led_policy = led; |
diff --git a/drivers/usb/media/pwc/pwc-if.c b/drivers/usb/media/pwc/pwc-if.c index db6753dc5ba5..90eb26042817 100644 --- a/drivers/usb/media/pwc/pwc-if.c +++ b/drivers/usb/media/pwc/pwc-if.c | |||
@@ -1867,12 +1867,11 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id | |||
1867 | Info("Warning: more than 1 configuration available.\n"); | 1867 | Info("Warning: more than 1 configuration available.\n"); |
1868 | 1868 | ||
1869 | /* Allocate structure, initialize pointers, mutexes, etc. and link it to the usb_device */ | 1869 | /* Allocate structure, initialize pointers, mutexes, etc. and link it to the usb_device */ |
1870 | pdev = kmalloc(sizeof(struct pwc_device), GFP_KERNEL); | 1870 | pdev = kzalloc(sizeof(struct pwc_device), GFP_KERNEL); |
1871 | if (pdev == NULL) { | 1871 | if (pdev == NULL) { |
1872 | Err("Oops, could not allocate memory for pwc_device.\n"); | 1872 | Err("Oops, could not allocate memory for pwc_device.\n"); |
1873 | return -ENOMEM; | 1873 | return -ENOMEM; |
1874 | } | 1874 | } |
1875 | memset(pdev, 0, sizeof(struct pwc_device)); | ||
1876 | pdev->type = type_id; | 1875 | pdev->type = type_id; |
1877 | pdev->vsize = default_size; | 1876 | pdev->vsize = default_size; |
1878 | pdev->vframes = default_fps; | 1877 | pdev->vframes = default_fps; |
diff --git a/drivers/usb/media/se401.c b/drivers/usb/media/se401.c index 8c3b1ad8a8fd..f03ea7f89596 100644 --- a/drivers/usb/media/se401.c +++ b/drivers/usb/media/se401.c | |||
@@ -1345,13 +1345,11 @@ static int se401_probe(struct usb_interface *intf, | |||
1345 | /* We found one */ | 1345 | /* We found one */ |
1346 | info("SE401 camera found: %s", camera_name); | 1346 | info("SE401 camera found: %s", camera_name); |
1347 | 1347 | ||
1348 | if ((se401 = kmalloc(sizeof(*se401), GFP_KERNEL)) == NULL) { | 1348 | if ((se401 = kzalloc(sizeof(*se401), GFP_KERNEL)) == NULL) { |
1349 | err("couldn't kmalloc se401 struct"); | 1349 | err("couldn't kmalloc se401 struct"); |
1350 | return -ENOMEM; | 1350 | return -ENOMEM; |
1351 | } | 1351 | } |
1352 | 1352 | ||
1353 | memset(se401, 0, sizeof(*se401)); | ||
1354 | |||
1355 | se401->dev = dev; | 1353 | se401->dev = dev; |
1356 | se401->iface = interface->bInterfaceNumber; | 1354 | se401->iface = interface->bInterfaceNumber; |
1357 | se401->camera_name = camera_name; | 1355 | se401->camera_name = camera_name; |
diff --git a/drivers/usb/media/stv680.c b/drivers/usb/media/stv680.c index b1a6be2958ed..9636da20748d 100644 --- a/drivers/usb/media/stv680.c +++ b/drivers/usb/media/stv680.c | |||
@@ -318,12 +318,11 @@ static int stv_init (struct usb_stv *stv680) | |||
318 | unsigned char *buffer; | 318 | unsigned char *buffer; |
319 | unsigned long int bufsize; | 319 | unsigned long int bufsize; |
320 | 320 | ||
321 | buffer = kmalloc (40, GFP_KERNEL); | 321 | buffer = kzalloc (40, GFP_KERNEL); |
322 | if (buffer == NULL) { | 322 | if (buffer == NULL) { |
323 | PDEBUG (0, "STV(e): Out of (small buf) memory"); | 323 | PDEBUG (0, "STV(e): Out of (small buf) memory"); |
324 | return -1; | 324 | return -1; |
325 | } | 325 | } |
326 | memset (buffer, 0, 40); | ||
327 | udelay (100); | 326 | udelay (100); |
328 | 327 | ||
329 | /* set config 1, interface 0, alternate 0 */ | 328 | /* set config 1, interface 0, alternate 0 */ |
@@ -1388,14 +1387,12 @@ static int stv680_probe (struct usb_interface *intf, const struct usb_device_id | |||
1388 | goto error; | 1387 | goto error; |
1389 | } | 1388 | } |
1390 | /* We found one */ | 1389 | /* We found one */ |
1391 | if ((stv680 = kmalloc (sizeof (*stv680), GFP_KERNEL)) == NULL) { | 1390 | if ((stv680 = kzalloc (sizeof (*stv680), GFP_KERNEL)) == NULL) { |
1392 | PDEBUG (0, "STV(e): couldn't kmalloc stv680 struct."); | 1391 | PDEBUG (0, "STV(e): couldn't kmalloc stv680 struct."); |
1393 | retval = -ENOMEM; | 1392 | retval = -ENOMEM; |
1394 | goto error; | 1393 | goto error; |
1395 | } | 1394 | } |
1396 | 1395 | ||
1397 | memset (stv680, 0, sizeof (*stv680)); | ||
1398 | |||
1399 | stv680->udev = dev; | 1396 | stv680->udev = dev; |
1400 | stv680->camera_name = camera_name; | 1397 | stv680->camera_name = camera_name; |
1401 | 1398 | ||