Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
9123f528
Commit
9123f528
authored
Feb 13, 2002
by
Greg Kroah-Hartman
Committed by
Paul Mackerras
Feb 13, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added mem_flags to usb_submit_urb().
This modifies the drivers in drivers/usb. Patch done by Oliver Neukum.
parent
e0b5c524
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
59 additions
and
58 deletions
+59
-58
drivers/usb/CDCEther.c
drivers/usb/CDCEther.c
+3
-3
drivers/usb/audio.c
drivers/usb/audio.c
+8
-8
drivers/usb/auerswald.c
drivers/usb/auerswald.c
+3
-3
drivers/usb/bluetooth.c
drivers/usb/bluetooth.c
+4
-4
drivers/usb/catc.c
drivers/usb/catc.c
+4
-4
drivers/usb/dabusb.c
drivers/usb/dabusb.c
+1
-1
drivers/usb/devio.c
drivers/usb/devio.c
+1
-1
drivers/usb/hid-core.c
drivers/usb/hid-core.c
+3
-3
drivers/usb/hpusbscsi.c
drivers/usb/hpusbscsi.c
+2
-2
drivers/usb/kaweth.c
drivers/usb/kaweth.c
+4
-4
drivers/usb/konicawc.c
drivers/usb/konicawc.c
+1
-1
drivers/usb/mdc800.c
drivers/usb/mdc800.c
+3
-3
drivers/usb/microtek.c
drivers/usb/microtek.c
+1
-1
drivers/usb/ov511.c
drivers/usb/ov511.c
+1
-1
drivers/usb/pegasus.c
drivers/usb/pegasus.c
+4
-4
drivers/usb/pwc-if.c
drivers/usb/pwc-if.c
+1
-1
drivers/usb/scanner.c
drivers/usb/scanner.c
+1
-1
drivers/usb/se401.c
drivers/usb/se401.c
+2
-2
drivers/usb/stv680.c
drivers/usb/stv680.c
+1
-1
drivers/usb/usb-skeleton.c
drivers/usb/usb-skeleton.c
+2
-1
drivers/usb/usbkbd.c
drivers/usb/usbkbd.c
+2
-2
drivers/usb/usbmouse.c
drivers/usb/usbmouse.c
+1
-1
drivers/usb/usbnet.c
drivers/usb/usbnet.c
+3
-3
drivers/usb/usbvideo.c
drivers/usb/usbvideo.c
+1
-1
drivers/usb/vicam.c
drivers/usb/vicam.c
+1
-1
drivers/usb/wacom.c
drivers/usb/wacom.c
+1
-1
No files found.
drivers/usb/CDCEther.c
View file @
9123f528
...
@@ -1144,18 +1144,18 @@ static void * CDCEther_probe( struct usb_device *usb, unsigned int ifnum,
...
@@ -1144,18 +1144,18 @@ static void * CDCEther_probe( struct usb_device *usb, unsigned int ifnum,
// Zero everything out.
// Zero everything out.
memset
(
ether_dev
,
0
,
sizeof
(
ether_dev_t
));
memset
(
ether_dev
,
0
,
sizeof
(
ether_dev_t
));
ether_dev
->
rx_urb
=
usb_alloc_urb
(
0
);
ether_dev
->
rx_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
ether_dev
->
rx_urb
)
{
if
(
!
ether_dev
->
rx_urb
)
{
kfree
(
ether_dev
);
kfree
(
ether_dev
);
return
NULL
;
return
NULL
;
}
}
ether_dev
->
tx_urb
=
usb_alloc_urb
(
0
);
ether_dev
->
tx_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
ether_dev
->
tx_urb
)
{
if
(
!
ether_dev
->
tx_urb
)
{
usb_free_urb
(
ether_dev
->
rx_urb
);
usb_free_urb
(
ether_dev
->
rx_urb
);
kfree
(
ether_dev
);
kfree
(
ether_dev
);
return
NULL
;
return
NULL
;
}
}
ether_dev
->
intr_urb
=
usb_alloc_urb
(
0
);
ether_dev
->
intr_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
ether_dev
->
intr_urb
)
{
if
(
!
ether_dev
->
intr_urb
)
{
usb_free_urb
(
ether_dev
->
tx_urb
);
usb_free_urb
(
ether_dev
->
tx_urb
);
usb_free_urb
(
ether_dev
->
rx_urb
);
usb_free_urb
(
ether_dev
->
rx_urb
);
...
...
drivers/usb/audio.c
View file @
9123f528
...
@@ -2829,14 +2829,14 @@ static void usb_audio_parsestreaming(struct usb_audio_state *s, unsigned char *b
...
@@ -2829,14 +2829,14 @@ static void usb_audio_parsestreaming(struct usb_audio_state *s, unsigned char *b
init_waitqueue_head
(
&
as
->
usbin
.
dma
.
wait
);
init_waitqueue_head
(
&
as
->
usbin
.
dma
.
wait
);
init_waitqueue_head
(
&
as
->
usbout
.
dma
.
wait
);
init_waitqueue_head
(
&
as
->
usbout
.
dma
.
wait
);
spin_lock_init
(
&
as
->
lock
);
spin_lock_init
(
&
as
->
lock
);
as
->
usbin
.
durb
[
0
].
urb
=
usb_alloc_urb
(
0
);
as
->
usbin
.
durb
[
0
].
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
as
->
usbin
.
durb
[
1
].
urb
=
usb_alloc_urb
(
0
);
as
->
usbin
.
durb
[
1
].
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
as
->
usbin
.
surb
[
0
].
urb
=
usb_alloc_urb
(
0
);
as
->
usbin
.
surb
[
0
].
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
as
->
usbin
.
surb
[
1
].
urb
=
usb_alloc_urb
(
0
);
as
->
usbin
.
surb
[
1
].
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
as
->
usbout
.
durb
[
0
].
urb
=
usb_alloc_urb
(
0
);
as
->
usbout
.
durb
[
0
].
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
as
->
usbout
.
durb
[
1
].
urb
=
usb_alloc_urb
(
0
);
as
->
usbout
.
durb
[
1
].
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
as
->
usbout
.
surb
[
0
].
urb
=
usb_alloc_urb
(
0
);
as
->
usbout
.
surb
[
0
].
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
as
->
usbout
.
surb
[
1
].
urb
=
usb_alloc_urb
(
0
);
as
->
usbout
.
surb
[
1
].
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
((
!
as
->
usbin
.
durb
[
0
].
urb
)
||
if
((
!
as
->
usbin
.
durb
[
0
].
urb
)
||
(
!
as
->
usbin
.
durb
[
1
].
urb
)
||
(
!
as
->
usbin
.
durb
[
1
].
urb
)
||
(
!
as
->
usbin
.
surb
[
0
].
urb
)
||
(
!
as
->
usbin
.
surb
[
0
].
urb
)
||
...
...
drivers/usb/auerswald.c
View file @
9123f528
...
@@ -699,7 +699,7 @@ static int auerchain_control_msg (pauerchain_t acp, struct usb_device *dev, unsi
...
@@ -699,7 +699,7 @@ static int auerchain_control_msg (pauerchain_t acp, struct usb_device *dev, unsi
dr
=
kmalloc
(
sizeof
(
struct
usb_ctrlrequest
),
GFP_KERNEL
);
dr
=
kmalloc
(
sizeof
(
struct
usb_ctrlrequest
),
GFP_KERNEL
);
if
(
!
dr
)
if
(
!
dr
)
return
-
ENOMEM
;
return
-
ENOMEM
;
urb
=
usb_alloc_urb
(
0
);
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
urb
)
{
if
(
!
urb
)
{
kfree
(
dr
);
kfree
(
dr
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -802,7 +802,7 @@ static int auerbuf_setup (pauerbufctl_t bcp, unsigned int numElements, unsigned
...
@@ -802,7 +802,7 @@ static int auerbuf_setup (pauerbufctl_t bcp, unsigned int numElements, unsigned
if
(
!
bep
->
bufp
)
goto
bl_fail
;
if
(
!
bep
->
bufp
)
goto
bl_fail
;
bep
->
dr
=
(
struct
usb_ctrlrequest
*
)
kmalloc
(
sizeof
(
struct
usb_ctrlrequest
),
GFP_KERNEL
);
bep
->
dr
=
(
struct
usb_ctrlrequest
*
)
kmalloc
(
sizeof
(
struct
usb_ctrlrequest
),
GFP_KERNEL
);
if
(
!
bep
->
dr
)
goto
bl_fail
;
if
(
!
bep
->
dr
)
goto
bl_fail
;
bep
->
urbp
=
usb_alloc_urb
(
0
);
bep
->
urbp
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
bep
->
urbp
)
goto
bl_fail
;
if
(
!
bep
->
urbp
)
goto
bl_fail
;
list_add_tail
(
&
bep
->
buff_list
,
&
bcp
->
free_buff_list
);
list_add_tail
(
&
bep
->
buff_list
,
&
bcp
->
free_buff_list
);
}
}
...
@@ -1130,7 +1130,7 @@ static int auerswald_int_open (pauerswald_t cp)
...
@@ -1130,7 +1130,7 @@ static int auerswald_int_open (pauerswald_t cp)
/* allocate the urb and data buffer */
/* allocate the urb and data buffer */
if
(
!
cp
->
inturbp
)
{
if
(
!
cp
->
inturbp
)
{
cp
->
inturbp
=
usb_alloc_urb
(
0
);
cp
->
inturbp
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
cp
->
inturbp
)
{
if
(
!
cp
->
inturbp
)
{
ret
=
-
ENOMEM
;
ret
=
-
ENOMEM
;
goto
intoend
;
goto
intoend
;
...
...
drivers/usb/bluetooth.c
View file @
9123f528
...
@@ -1123,7 +1123,7 @@ static void * usb_bluetooth_probe(struct usb_device *dev, unsigned int ifnum,
...
@@ -1123,7 +1123,7 @@ static void * usb_bluetooth_probe(struct usb_device *dev, unsigned int ifnum,
/* create our control out urb pool */
/* create our control out urb pool */
for
(
i
=
0
;
i
<
NUM_CONTROL_URBS
;
++
i
)
{
for
(
i
=
0
;
i
<
NUM_CONTROL_URBS
;
++
i
)
{
struct
urb
*
urb
=
usb_alloc_urb
(
0
);
struct
urb
*
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
urb
==
NULL
)
{
if
(
urb
==
NULL
)
{
err
(
"No free urbs available"
);
err
(
"No free urbs available"
);
goto
probe_error
;
goto
probe_error
;
...
@@ -1134,7 +1134,7 @@ static void * usb_bluetooth_probe(struct usb_device *dev, unsigned int ifnum,
...
@@ -1134,7 +1134,7 @@ static void * usb_bluetooth_probe(struct usb_device *dev, unsigned int ifnum,
/* set up the endpoint information */
/* set up the endpoint information */
endpoint
=
bulk_in_endpoint
[
0
];
endpoint
=
bulk_in_endpoint
[
0
];
bluetooth
->
read_urb
=
usb_alloc_urb
(
0
);
bluetooth
->
read_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
bluetooth
->
read_urb
)
{
if
(
!
bluetooth
->
read_urb
)
{
err
(
"No free urbs available"
);
err
(
"No free urbs available"
);
goto
probe_error
;
goto
probe_error
;
...
@@ -1154,7 +1154,7 @@ static void * usb_bluetooth_probe(struct usb_device *dev, unsigned int ifnum,
...
@@ -1154,7 +1154,7 @@ static void * usb_bluetooth_probe(struct usb_device *dev, unsigned int ifnum,
/* create our write urb pool */
/* create our write urb pool */
for
(
i
=
0
;
i
<
NUM_BULK_URBS
;
++
i
)
{
for
(
i
=
0
;
i
<
NUM_BULK_URBS
;
++
i
)
{
struct
urb
*
urb
=
usb_alloc_urb
(
0
);
struct
urb
*
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
urb
==
NULL
)
{
if
(
urb
==
NULL
)
{
err
(
"No free urbs available"
);
err
(
"No free urbs available"
);
goto
probe_error
;
goto
probe_error
;
...
@@ -1170,7 +1170,7 @@ static void * usb_bluetooth_probe(struct usb_device *dev, unsigned int ifnum,
...
@@ -1170,7 +1170,7 @@ static void * usb_bluetooth_probe(struct usb_device *dev, unsigned int ifnum,
bluetooth
->
bulk_out_buffer_size
=
endpoint
->
wMaxPacketSize
*
2
;
bluetooth
->
bulk_out_buffer_size
=
endpoint
->
wMaxPacketSize
*
2
;
endpoint
=
interrupt_in_endpoint
[
0
];
endpoint
=
interrupt_in_endpoint
[
0
];
bluetooth
->
interrupt_in_urb
=
usb_alloc_urb
(
0
);
bluetooth
->
interrupt_in_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
bluetooth
->
interrupt_in_urb
)
{
if
(
!
bluetooth
->
interrupt_in_urb
)
{
err
(
"No free urbs available"
);
err
(
"No free urbs available"
);
goto
probe_error
;
goto
probe_error
;
...
...
drivers/usb/catc.c
View file @
9123f528
...
@@ -694,10 +694,10 @@ static void *catc_probe(struct usb_device *usbdev, unsigned int ifnum, const str
...
@@ -694,10 +694,10 @@ static void *catc_probe(struct usb_device *usbdev, unsigned int ifnum, const str
catc
->
timer
.
data
=
(
long
)
catc
;
catc
->
timer
.
data
=
(
long
)
catc
;
catc
->
timer
.
function
=
catc_stats_timer
;
catc
->
timer
.
function
=
catc_stats_timer
;
catc
->
ctrl_urb
=
usb_alloc_urb
(
0
);
catc
->
ctrl_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
catc
->
tx_urb
=
usb_alloc_urb
(
0
);
catc
->
tx_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
catc
->
rx_urb
=
usb_alloc_urb
(
0
);
catc
->
rx_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
catc
->
irq_urb
=
usb_alloc_urb
(
0
);
catc
->
irq_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
((
!
catc
->
ctrl_urb
)
||
(
!
catc
->
tx_urb
)
||
if
((
!
catc
->
ctrl_urb
)
||
(
!
catc
->
tx_urb
)
||
(
!
catc
->
rx_urb
)
||
(
!
catc
->
irq_urb
))
{
(
!
catc
->
rx_urb
)
||
(
!
catc
->
irq_urb
))
{
err
(
"No free urbs available."
);
err
(
"No free urbs available."
);
...
...
drivers/usb/dabusb.c
View file @
9123f528
...
@@ -226,7 +226,7 @@ static int dabusb_alloc_buffers (pdabusb_t s)
...
@@ -226,7 +226,7 @@ static int dabusb_alloc_buffers (pdabusb_t s)
}
}
memset
(
b
,
0
,
sizeof
(
buff_t
));
memset
(
b
,
0
,
sizeof
(
buff_t
));
b
->
s
=
s
;
b
->
s
=
s
;
b
->
purb
=
usb_alloc_urb
(
packets
);
b
->
purb
=
usb_alloc_urb
(
packets
,
GFP_KERNEL
);
if
(
!
b
->
purb
)
{
if
(
!
b
->
purb
)
{
err
(
"usb_alloc_urb == NULL"
);
err
(
"usb_alloc_urb == NULL"
);
kfree
(
b
);
kfree
(
b
);
...
...
drivers/usb/devio.c
View file @
9123f528
...
@@ -181,7 +181,7 @@ static struct async *alloc_async(unsigned int numisoframes)
...
@@ -181,7 +181,7 @@ static struct async *alloc_async(unsigned int numisoframes)
if
(
!
as
)
if
(
!
as
)
return
NULL
;
return
NULL
;
memset
(
as
,
0
,
assize
);
memset
(
as
,
0
,
assize
);
as
->
urb
=
usb_alloc_urb
(
numisoframes
);
as
->
urb
=
usb_alloc_urb
(
numisoframes
,
GFP_KERNEL
);
if
(
!
as
->
urb
)
{
if
(
!
as
->
urb
)
{
kfree
(
as
);
kfree
(
as
);
return
NULL
;
return
NULL
;
...
...
drivers/usb/hid-core.c
View file @
9123f528
...
@@ -1311,14 +1311,14 @@ static struct hid_device *usb_hid_configure(struct usb_device *dev, int ifnum)
...
@@ -1311,14 +1311,14 @@ static struct hid_device *usb_hid_configure(struct usb_device *dev, int ifnum)
if
(
endpoint
->
bEndpointAddress
&
USB_DIR_IN
)
{
if
(
endpoint
->
bEndpointAddress
&
USB_DIR_IN
)
{
if
(
hid
->
urbin
)
if
(
hid
->
urbin
)
continue
;
continue
;
if
(
!
(
hid
->
urbin
=
usb_alloc_urb
(
0
)))
if
(
!
(
hid
->
urbin
=
usb_alloc_urb
(
0
,
GFP_KERNEL
)))
goto
fail
;
goto
fail
;
pipe
=
usb_rcvintpipe
(
dev
,
endpoint
->
bEndpointAddress
);
pipe
=
usb_rcvintpipe
(
dev
,
endpoint
->
bEndpointAddress
);
FILL_INT_URB
(
hid
->
urbin
,
dev
,
pipe
,
hid
->
inbuf
,
0
,
hid_irq_in
,
hid
,
endpoint
->
bInterval
);
FILL_INT_URB
(
hid
->
urbin
,
dev
,
pipe
,
hid
->
inbuf
,
0
,
hid_irq_in
,
hid
,
endpoint
->
bInterval
);
}
else
{
}
else
{
if
(
hid
->
urbout
)
if
(
hid
->
urbout
)
continue
;
continue
;
if
(
!
(
hid
->
urbout
=
usb_alloc_urb
(
0
)))
if
(
!
(
hid
->
urbout
=
usb_alloc_urb
(
0
,
GFP_KERNEL
)))
goto
fail
;
goto
fail
;
pipe
=
usb_sndbulkpipe
(
dev
,
endpoint
->
bEndpointAddress
);
pipe
=
usb_sndbulkpipe
(
dev
,
endpoint
->
bEndpointAddress
);
FILL_BULK_URB
(
hid
->
urbout
,
dev
,
pipe
,
hid
->
outbuf
,
0
,
hid_irq_out
,
hid
);
FILL_BULK_URB
(
hid
->
urbout
,
dev
,
pipe
,
hid
->
outbuf
,
0
,
hid_irq_out
,
hid
);
...
@@ -1360,7 +1360,7 @@ static struct hid_device *usb_hid_configure(struct usb_device *dev, int ifnum)
...
@@ -1360,7 +1360,7 @@ static struct hid_device *usb_hid_configure(struct usb_device *dev, int ifnum)
kfree
(
buf
);
kfree
(
buf
);
hid
->
urbctrl
=
usb_alloc_urb
(
0
);
hid
->
urbctrl
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
FILL_CONTROL_URB
(
hid
->
urbctrl
,
dev
,
0
,
(
void
*
)
&
hid
->
cr
,
hid
->
ctrlbuf
,
1
,
hid_ctrl
,
hid
);
FILL_CONTROL_URB
(
hid
->
urbctrl
,
dev
,
0
,
(
void
*
)
&
hid
->
cr
,
hid
->
ctrlbuf
,
1
,
hid_ctrl
,
hid
);
return
hid
;
return
hid
;
...
...
drivers/usb/hpusbscsi.c
View file @
9123f528
...
@@ -56,12 +56,12 @@ hpusbscsi_usb_probe (struct usb_device *dev, unsigned int interface,
...
@@ -56,12 +56,12 @@ hpusbscsi_usb_probe (struct usb_device *dev, unsigned int interface,
return
NULL
;
return
NULL
;
DEBUG
(
"Allocated memory
\n
"
);
DEBUG
(
"Allocated memory
\n
"
);
memset
(
new
,
0
,
sizeof
(
struct
hpusbscsi
));
memset
(
new
,
0
,
sizeof
(
struct
hpusbscsi
));
new
->
dataurb
=
usb_alloc_urb
(
0
);
new
->
dataurb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
new
->
dataurb
)
{
if
(
!
new
->
dataurb
)
{
kfree
(
new
);
kfree
(
new
);
return
NULL
;
return
NULL
;
}
}
new
->
controlurb
=
usb_alloc_urb
(
0
);
new
->
controlurb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
new
->
controlurb
)
{
if
(
!
new
->
controlurb
)
{
usb_free_urb
(
new
->
dataurb
);
usb_free_urb
(
new
->
dataurb
);
kfree
(
new
);
kfree
(
new
);
...
...
drivers/usb/kaweth.c
View file @
9123f528
...
@@ -873,8 +873,8 @@ static void *kaweth_probe(
...
@@ -873,8 +873,8 @@ static void *kaweth_probe(
kaweth_dbg
(
"Initializing net device."
);
kaweth_dbg
(
"Initializing net device."
);
kaweth
->
tx_urb
=
usb_alloc_urb
(
0
);
kaweth
->
tx_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
kaweth
->
rx_urb
=
usb_alloc_urb
(
0
);
kaweth
->
rx_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
kaweth
->
net
=
init_etherdev
(
0
,
0
);
kaweth
->
net
=
init_etherdev
(
0
,
0
);
if
(
!
kaweth
->
net
)
{
if
(
!
kaweth
->
net
)
{
...
@@ -977,7 +977,7 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length)
...
@@ -977,7 +977,7 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length)
set_current_state
(
TASK_INTERRUPTIBLE
);
set_current_state
(
TASK_INTERRUPTIBLE
);
add_wait_queue
(
&
awd
.
wqh
,
&
wait
);
add_wait_queue
(
&
awd
.
wqh
,
&
wait
);
urb
->
context
=
&
awd
;
urb
->
context
=
&
awd
;
status
=
usb_submit_urb
(
urb
,
GFP_
KERNEL
);
status
=
usb_submit_urb
(
urb
,
GFP_
ATOMIC
);
if
(
status
)
{
if
(
status
)
{
// something went wrong
// something went wrong
usb_free_urb
(
urb
);
usb_free_urb
(
urb
);
...
@@ -1020,7 +1020,7 @@ int kaweth_internal_control_msg(struct usb_device *usb_dev, unsigned int pipe,
...
@@ -1020,7 +1020,7 @@ int kaweth_internal_control_msg(struct usb_device *usb_dev, unsigned int pipe,
int
retv
;
int
retv
;
int
length
;
int
length
;
urb
=
usb_alloc_urb
(
0
);
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
urb
)
if
(
!
urb
)
return
-
ENOMEM
;
return
-
ENOMEM
;
...
...
drivers/usb/konicawc.c
View file @
9123f528
...
@@ -629,7 +629,7 @@ static void *konicawc_probe(struct usb_device *dev, unsigned int ifnum ,const st
...
@@ -629,7 +629,7 @@ static void *konicawc_probe(struct usb_device *dev, unsigned int ifnum ,const st
/* Here uvd is a fully allocated uvd_t object */
/* Here uvd is a fully allocated uvd_t object */
for
(
i
=
0
;
i
<
USBVIDEO_NUMSBUF
;
i
++
)
{
for
(
i
=
0
;
i
<
USBVIDEO_NUMSBUF
;
i
++
)
{
konicawc_data
->
sts_urb
[
i
]
=
usb_alloc_urb
(
FRAMES_PER_DESC
);
konicawc_data
->
sts_urb
[
i
]
=
usb_alloc_urb
(
FRAMES_PER_DESC
,
GFP_KERNEL
);
}
}
switch
(
size
)
{
switch
(
size
)
{
...
...
drivers/usb/mdc800.c
View file @
9123f528
...
@@ -969,9 +969,9 @@ int __init usb_mdc800_init (void)
...
@@ -969,9 +969,9 @@ int __init usb_mdc800_init (void)
try
(
mdc800
->
write_urb_buffer
=
kmalloc
(
8
,
GFP_KERNEL
));
try
(
mdc800
->
write_urb_buffer
=
kmalloc
(
8
,
GFP_KERNEL
));
try
(
mdc800
->
download_urb_buffer
=
kmalloc
(
64
,
GFP_KERNEL
));
try
(
mdc800
->
download_urb_buffer
=
kmalloc
(
64
,
GFP_KERNEL
));
try
(
mdc800
->
irq_urb
=
usb_alloc_urb
(
0
));
try
(
mdc800
->
irq_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
));
try
(
mdc800
->
download_urb
=
usb_alloc_urb
(
0
));
try
(
mdc800
->
download_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
));
try
(
mdc800
->
write_urb
=
usb_alloc_urb
(
0
));
try
(
mdc800
->
write_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
));
/* Register the driver */
/* Register the driver */
if
(
usb_register
(
&
mdc800_usb_driver
)
<
0
)
if
(
usb_register
(
&
mdc800_usb_driver
)
<
0
)
...
...
drivers/usb/microtek.c
View file @
9123f528
...
@@ -936,7 +936,7 @@ static void * mts_usb_probe (struct usb_device *dev, unsigned int interface,
...
@@ -936,7 +936,7 @@ static void * mts_usb_probe (struct usb_device *dev, unsigned int interface,
}
}
memset
(
new_desc
,
0
,
sizeof
(
*
new_desc
)
);
memset
(
new_desc
,
0
,
sizeof
(
*
new_desc
)
);
new_desc
->
urb
=
usb_alloc_urb
(
0
);
new_desc
->
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
new_desc
->
urb
)
{
if
(
!
new_desc
->
urb
)
{
kfree
(
new_desc
);
kfree
(
new_desc
);
return
NULL
;
return
NULL
;
...
...
drivers/usb/ov511.c
View file @
9123f528
...
@@ -4426,7 +4426,7 @@ ov511_init_isoc(struct usb_ov511 *ov511)
...
@@ -4426,7 +4426,7 @@ ov511_init_isoc(struct usb_ov511 *ov511)
}
}
for
(
n
=
0
;
n
<
OV511_NUMSBUF
;
n
++
)
{
for
(
n
=
0
;
n
<
OV511_NUMSBUF
;
n
++
)
{
urb
=
usb_alloc_urb
(
FRAMES_PER_DESC
);
urb
=
usb_alloc_urb
(
FRAMES_PER_DESC
,
GFP_KERNEL
);
if
(
!
urb
)
{
if
(
!
urb
)
{
err
(
"init isoc: usb_alloc_urb ret. NULL"
);
err
(
"init isoc: usb_alloc_urb ret. NULL"
);
...
...
drivers/usb/pegasus.c
View file @
9123f528
...
@@ -858,25 +858,25 @@ static void * pegasus_probe( struct usb_device *dev, unsigned int ifnum,
...
@@ -858,25 +858,25 @@ static void * pegasus_probe( struct usb_device *dev, unsigned int ifnum,
pegasus
->
dev_index
=
dev_index
;
pegasus
->
dev_index
=
dev_index
;
init_waitqueue_head
(
&
pegasus
->
ctrl_wait
);
init_waitqueue_head
(
&
pegasus
->
ctrl_wait
);
pegasus
->
ctrl_urb
=
usb_alloc_urb
(
0
);
pegasus
->
ctrl_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
pegasus
->
ctrl_urb
)
{
if
(
!
pegasus
->
ctrl_urb
)
{
kfree
(
pegasus
);
kfree
(
pegasus
);
return
NULL
;
return
NULL
;
}
}
pegasus
->
rx_urb
=
usb_alloc_urb
(
0
);
pegasus
->
rx_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
pegasus
->
rx_urb
)
{
if
(
!
pegasus
->
rx_urb
)
{
usb_free_urb
(
pegasus
->
ctrl_urb
);
usb_free_urb
(
pegasus
->
ctrl_urb
);
kfree
(
pegasus
);
kfree
(
pegasus
);
return
NULL
;
return
NULL
;
}
}
pegasus
->
tx_urb
=
usb_alloc_urb
(
0
);
pegasus
->
tx_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
pegasus
->
tx_urb
)
{
if
(
!
pegasus
->
tx_urb
)
{
usb_free_urb
(
pegasus
->
rx_urb
);
usb_free_urb
(
pegasus
->
rx_urb
);
usb_free_urb
(
pegasus
->
ctrl_urb
);
usb_free_urb
(
pegasus
->
ctrl_urb
);
kfree
(
pegasus
);
kfree
(
pegasus
);
return
NULL
;
return
NULL
;
}
}
pegasus
->
intr_urb
=
usb_alloc_urb
(
0
);
pegasus
->
intr_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
pegasus
->
intr_urb
)
{
if
(
!
pegasus
->
intr_urb
)
{
usb_free_urb
(
pegasus
->
tx_urb
);
usb_free_urb
(
pegasus
->
tx_urb
);
usb_free_urb
(
pegasus
->
rx_urb
);
usb_free_urb
(
pegasus
->
rx_urb
);
...
...
drivers/usb/pwc-if.c
View file @
9123f528
...
@@ -827,7 +827,7 @@ static int pwc_isoc_init(struct pwc_device *pdev)
...
@@ -827,7 +827,7 @@ static int pwc_isoc_init(struct pwc_device *pdev)
ret
=
0
;
ret
=
0
;
for
(
i
=
0
;
i
<
MAX_ISO_BUFS
;
i
++
)
{
for
(
i
=
0
;
i
<
MAX_ISO_BUFS
;
i
++
)
{
urb
=
usb_alloc_urb
(
ISO_FRAMES_PER_DESC
);
urb
=
usb_alloc_urb
(
ISO_FRAMES_PER_DESC
,
GFP_KERNEL
);
if
(
urb
==
NULL
)
{
if
(
urb
==
NULL
)
{
Err
(
"Failed to allocate urb %d
\n
"
,
i
);
Err
(
"Failed to allocate urb %d
\n
"
,
i
);
ret
=
-
ENOMEM
;
ret
=
-
ENOMEM
;
...
...
drivers/usb/scanner.c
View file @
9123f528
...
@@ -974,7 +974,7 @@ probe_scanner(struct usb_device *dev, unsigned int ifnum,
...
@@ -974,7 +974,7 @@ probe_scanner(struct usb_device *dev, unsigned int ifnum,
}
}
memset
(
scn
,
0
,
sizeof
(
struct
scn_usb_data
));
memset
(
scn
,
0
,
sizeof
(
struct
scn_usb_data
));
scn
->
scn_irq
=
usb_alloc_urb
(
0
);
scn
->
scn_irq
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
scn
->
scn_irq
)
{
if
(
!
scn
->
scn_irq
)
{
kfree
(
scn
);
kfree
(
scn
);
up
(
&
scn_mutex
);
up
(
&
scn_mutex
);
...
...
drivers/usb/se401.c
View file @
9123f528
...
@@ -644,7 +644,7 @@ static int se401_start_stream(struct usb_se401 *se401)
...
@@ -644,7 +644,7 @@ static int se401_start_stream(struct usb_se401 *se401)
}
}
for
(
i
=
0
;
i
<
SE401_NUMSBUF
;
i
++
)
{
for
(
i
=
0
;
i
<
SE401_NUMSBUF
;
i
++
)
{
urb
=
usb_alloc_urb
(
0
);
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
urb
)
if
(
!
urb
)
return
ENOMEM
;
return
ENOMEM
;
...
@@ -1465,7 +1465,7 @@ static int se401_init(struct usb_se401 *se401)
...
@@ -1465,7 +1465,7 @@ static int se401_init(struct usb_se401 *se401)
se401
->
readcount
=
0
;
se401
->
readcount
=
0
;
/* Start interrupt transfers for snapshot button */
/* Start interrupt transfers for snapshot button */
se401
->
inturb
=
usb_alloc_urb
(
0
);
se401
->
inturb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
se401
->
inturb
)
{
if
(
!
se401
->
inturb
)
{
info
(
"Allocation of inturb failed"
);
info
(
"Allocation of inturb failed"
);
return
1
;
return
1
;
...
...
drivers/usb/stv680.c
View file @
9123f528
...
@@ -804,7 +804,7 @@ static int stv680_start_stream (struct usb_stv *stv680)
...
@@ -804,7 +804,7 @@ static int stv680_start_stream (struct usb_stv *stv680)
}
}
for
(
i
=
0
;
i
<
STV680_NUMSBUF
;
i
++
)
{
for
(
i
=
0
;
i
<
STV680_NUMSBUF
;
i
++
)
{
urb
=
usb_alloc_urb
(
0
);
urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
urb
)
if
(
!
urb
)
return
ENOMEM
;
return
ENOMEM
;
...
...
drivers/usb/usb-skeleton.c
View file @
9123f528
...
@@ -573,7 +573,8 @@ static void * skel_probe(struct usb_device *udev, unsigned int ifnum, const stru
...
@@ -573,7 +573,8 @@ static void * skel_probe(struct usb_device *udev, unsigned int ifnum, const stru
if
(((
endpoint
->
bEndpointAddress
&
0x80
)
==
0x00
)
&&
if
(((
endpoint
->
bEndpointAddress
&
0x80
)
==
0x00
)
&&
((
endpoint
->
bmAttributes
&
3
)
==
0x02
))
{
((
endpoint
->
bmAttributes
&
3
)
==
0x02
))
{
/* we found a bulk out endpoint */
/* we found a bulk out endpoint */
dev
->
write_urb
=
usb_alloc_urb
(
0
);
/* a probe() may sleep and has no restrictions on memory allocations */
dev
->
write_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
dev
->
write_urb
)
{
if
(
!
dev
->
write_urb
)
{
err
(
"No free urbs available"
);
err
(
"No free urbs available"
);
goto
error
;
goto
error
;
...
...
drivers/usb/usbkbd.c
View file @
9123f528
...
@@ -196,12 +196,12 @@ static void *usb_kbd_probe(struct usb_device *dev, unsigned int ifnum,
...
@@ -196,12 +196,12 @@ static void *usb_kbd_probe(struct usb_device *dev, unsigned int ifnum,
if
(
!
(
kbd
=
kmalloc
(
sizeof
(
struct
usb_kbd
),
GFP_KERNEL
)))
return
NULL
;
if
(
!
(
kbd
=
kmalloc
(
sizeof
(
struct
usb_kbd
),
GFP_KERNEL
)))
return
NULL
;
memset
(
kbd
,
0
,
sizeof
(
struct
usb_kbd
));
memset
(
kbd
,
0
,
sizeof
(
struct
usb_kbd
));
kbd
->
irq
=
usb_alloc_urb
(
0
);
kbd
->
irq
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
kbd
->
irq
)
{
if
(
!
kbd
->
irq
)
{
kfree
(
kbd
);
kfree
(
kbd
);
return
NULL
;
return
NULL
;
}
}
kbd
->
led
=
usb_alloc_urb
(
0
);
kbd
->
led
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
kbd
->
led
)
{
if
(
!
kbd
->
led
)
{
usb_free_urb
(
kbd
->
irq
);
usb_free_urb
(
kbd
->
irq
);
kfree
(
kbd
);
kfree
(
kbd
);
...
...
drivers/usb/usbmouse.c
View file @
9123f528
...
@@ -122,7 +122,7 @@ static void *usb_mouse_probe(struct usb_device *dev, unsigned int ifnum,
...
@@ -122,7 +122,7 @@ static void *usb_mouse_probe(struct usb_device *dev, unsigned int ifnum,
if
(
!
(
mouse
=
kmalloc
(
sizeof
(
struct
usb_mouse
),
GFP_KERNEL
)))
return
NULL
;
if
(
!
(
mouse
=
kmalloc
(
sizeof
(
struct
usb_mouse
),
GFP_KERNEL
)))
return
NULL
;
memset
(
mouse
,
0
,
sizeof
(
struct
usb_mouse
));
memset
(
mouse
,
0
,
sizeof
(
struct
usb_mouse
));
mouse
->
irq
=
usb_alloc_urb
(
0
);
mouse
->
irq
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
mouse
->
irq
)
{
if
(
!
mouse
->
irq
)
{
kfree
(
mouse
);
kfree
(
mouse
);
return
NULL
;
return
NULL
;
...
...
drivers/usb/usbnet.c
View file @
9123f528
...
@@ -420,7 +420,7 @@ static int genelink_init (struct usbnet *dev)
...
@@ -420,7 +420,7 @@ static int genelink_init (struct usbnet *dev)
}
}
// allocate irq urb
// allocate irq urb
if
((
priv
->
irq_urb
=
usb_alloc_urb
(
0
))
==
0
)
{
if
((
priv
->
irq_urb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
))
==
0
)
{
dbg
(
"%s: cannot allocate private irq urb per device"
,
dbg
(
"%s: cannot allocate private irq urb per device"
,
dev
->
net
.
name
);
dev
->
net
.
name
);
kfree
(
priv
);
kfree
(
priv
);
...
@@ -1589,7 +1589,7 @@ static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net)
...
@@ -1589,7 +1589,7 @@ static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net)
}
}
}
}
if
(
!
(
urb
=
usb_alloc_urb
(
0
)))
{
if
(
!
(
urb
=
usb_alloc_urb
(
0
,
GFP_ATOMIC
)))
{
dbg
(
"no urb"
);
dbg
(
"no urb"
);
goto
drop
;
goto
drop
;
}
}
...
@@ -1723,7 +1723,7 @@ static void usbnet_bh (unsigned long param)
...
@@ -1723,7 +1723,7 @@ static void usbnet_bh (unsigned long param)
struct
urb
*
urb
;
struct
urb
*
urb
;
int
i
;
int
i
;
for
(
i
=
0
;
i
<
3
&&
dev
->
rxq
.
qlen
<
RX_QLEN
;
i
++
)
{
for
(
i
=
0
;
i
<
3
&&
dev
->
rxq
.
qlen
<
RX_QLEN
;
i
++
)
{
if
((
urb
=
usb_alloc_urb
(
0
))
!=
0
)
if
((
urb
=
usb_alloc_urb
(
0
,
GFP_ATOMIC
))
!=
0
)
rx_submit
(
dev
,
urb
,
GFP_ATOMIC
);
rx_submit
(
dev
,
urb
,
GFP_ATOMIC
);
}
}
if
(
temp
!=
dev
->
rxq
.
qlen
)
if
(
temp
!=
dev
->
rxq
.
qlen
)
...
...
drivers/usb/usbvideo.c
View file @
9123f528
...
@@ -1077,7 +1077,7 @@ uvd_t *usbvideo_AllocateDevice(usbvideo_t *cams)
...
@@ -1077,7 +1077,7 @@ uvd_t *usbvideo_AllocateDevice(usbvideo_t *cams)
down
(
&
uvd
->
lock
);
down
(
&
uvd
->
lock
);
for
(
i
=
0
;
i
<
USBVIDEO_NUMSBUF
;
i
++
)
{
for
(
i
=
0
;
i
<
USBVIDEO_NUMSBUF
;
i
++
)
{
uvd
->
sbuf
[
i
].
urb
=
usb_alloc_urb
(
FRAMES_PER_DESC
);
uvd
->
sbuf
[
i
].
urb
=
usb_alloc_urb
(
FRAMES_PER_DESC
,
GFP_KERNEL
);
if
(
uvd
->
sbuf
[
i
].
urb
==
NULL
)
{
if
(
uvd
->
sbuf
[
i
].
urb
==
NULL
)
{
err
(
"usb_alloc_urb(%d.) failed."
,
FRAMES_PER_DESC
);
err
(
"usb_alloc_urb(%d.) failed."
,
FRAMES_PER_DESC
);
uvd
->
uvd_used
=
0
;
uvd
->
uvd_used
=
0
;
...
...
drivers/usb/vicam.c
View file @
9123f528
...
@@ -884,7 +884,7 @@ static void * __devinit vicam_probe(struct usb_device *udev, unsigned int ifnum,
...
@@ -884,7 +884,7 @@ static void * __devinit vicam_probe(struct usb_device *udev, unsigned int ifnum,
}
}
memset
(
vicam
,
0
,
sizeof
(
*
vicam
));
memset
(
vicam
,
0
,
sizeof
(
*
vicam
));
vicam
->
readurb
=
usb_alloc_urb
(
0
);
vicam
->
readurb
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
vicam
->
readurb
)
{
if
(
!
vicam
->
readurb
)
{
kfree
(
vicam
);
kfree
(
vicam
);
return
NULL
;
return
NULL
;
...
...
drivers/usb/wacom.c
View file @
9123f528
...
@@ -359,7 +359,7 @@ static void *wacom_probe(struct usb_device *dev, unsigned int ifnum, const struc
...
@@ -359,7 +359,7 @@ static void *wacom_probe(struct usb_device *dev, unsigned int ifnum, const struc
if
(
!
(
wacom
=
kmalloc
(
sizeof
(
struct
wacom
),
GFP_KERNEL
)))
return
NULL
;
if
(
!
(
wacom
=
kmalloc
(
sizeof
(
struct
wacom
),
GFP_KERNEL
)))
return
NULL
;
memset
(
wacom
,
0
,
sizeof
(
struct
wacom
));
memset
(
wacom
,
0
,
sizeof
(
struct
wacom
));
wacom
->
irq
=
usb_alloc_urb
(
0
);
wacom
->
irq
=
usb_alloc_urb
(
0
,
GFP_KERNEL
);
if
(
!
wacom
->
irq
)
{
if
(
!
wacom
->
irq
)
{
kfree
(
wacom
);
kfree
(
wacom
);
return
NULL
;
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment