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
Kirill Smelkov
linux
Commits
a64bc8b4
Commit
a64bc8b4
authored
Sep 16, 2002
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
USB: convert the USB drivers that live outside of drivers/usb to the new USB driver model.
parent
93ef8026
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
43 deletions
+66
-43
drivers/bluetooth/hci_usb.c
drivers/bluetooth/hci_usb.c
+13
-9
drivers/input/joystick/iforce/iforce-usb.c
drivers/input/joystick/iforce/iforce-usb.c
+17
-12
drivers/isdn/hisax/st5481_init.c
drivers/isdn/hisax/st5481_init.c
+16
-11
drivers/media/video/cpia_usb.c
drivers/media/video/cpia_usb.c
+20
-11
No files found.
drivers/bluetooth/hci_usb.c
View file @
a64bc8b4
...
@@ -656,8 +656,9 @@ static int hci_usb_fw_load(struct usb_device *udev)
...
@@ -656,8 +656,9 @@ static int hci_usb_fw_load(struct usb_device *udev)
#endif
/* CONFIG_BLUEZ_USB_FW_LOAD */
#endif
/* CONFIG_BLUEZ_USB_FW_LOAD */
static
void
*
hci_usb_probe
(
struct
usb_device
*
udev
,
unsigned
int
ifnum
,
const
struct
usb_device_id
*
id
)
static
int
hci_usb_probe
(
struct
usb_interface
*
intf
,
const
struct
usb_device_id
*
id
)
{
{
struct
usb_device
*
udev
=
interface_to_usbdev
(
intf
);
struct
usb_endpoint_descriptor
*
bulk_out_ep
[
HCI_MAX_IFACE_NUM
];
struct
usb_endpoint_descriptor
*
bulk_out_ep
[
HCI_MAX_IFACE_NUM
];
struct
usb_endpoint_descriptor
*
isoc_out_ep
[
HCI_MAX_IFACE_NUM
];
struct
usb_endpoint_descriptor
*
isoc_out_ep
[
HCI_MAX_IFACE_NUM
];
struct
usb_endpoint_descriptor
*
bulk_in_ep
[
HCI_MAX_IFACE_NUM
];
struct
usb_endpoint_descriptor
*
bulk_in_ep
[
HCI_MAX_IFACE_NUM
];
...
@@ -670,11 +671,11 @@ static void * hci_usb_probe(struct usb_device *udev, unsigned int ifnum, const s
...
@@ -670,11 +671,11 @@ static void * hci_usb_probe(struct usb_device *udev, unsigned int ifnum, const s
struct
hci_dev
*
hdev
;
struct
hci_dev
*
hdev
;
int
i
,
a
,
e
,
size
,
ifn
,
isoc_ifnum
,
isoc_alts
;
int
i
,
a
,
e
,
size
,
ifn
,
isoc_ifnum
,
isoc_alts
;
BT_DBG
(
"
udev %p ifnum %d"
,
udev
,
ifnum
);
BT_DBG
(
"
intf %p"
,
intf
);
/* Check number of endpoints */
/* Check number of endpoints */
if
(
udev
->
actconfig
->
interface
[
ifnum
].
altsetting
[
0
].
bNumEndpoints
<
3
)
if
(
intf
->
altsetting
[
0
].
bNumEndpoints
<
3
)
return
NULL
;
return
-
ENODEV
;
MOD_INC_USE_COUNT
;
MOD_INC_USE_COUNT
;
...
@@ -794,24 +795,27 @@ static void * hci_usb_probe(struct usb_device *udev, unsigned int ifnum, const s
...
@@ -794,24 +795,27 @@ static void * hci_usb_probe(struct usb_device *udev, unsigned int ifnum, const s
goto
probe_error
;
goto
probe_error
;
}
}
return
husb
;
dev_set_drvdata
(
&
intf
->
dev
,
husb
);
return
0
;
probe_error:
probe_error:
kfree
(
husb
);
kfree
(
husb
);
done:
done:
MOD_DEC_USE_COUNT
;
MOD_DEC_USE_COUNT
;
return
NULL
;
return
-
EIO
;
}
}
static
void
hci_usb_disconnect
(
struct
usb_
device
*
udev
,
void
*
ptr
)
static
void
hci_usb_disconnect
(
struct
usb_
interface
*
intf
)
{
{
struct
hci_usb
*
husb
=
(
struct
hci_usb
*
)
ptr
;
struct
hci_usb
*
husb
=
dev_get_drvdata
(
&
intf
->
dev
)
;
struct
hci_dev
*
hdev
=
&
husb
->
hdev
;
struct
hci_dev
*
hdev
;
dev_set_drvdata
(
&
intf
->
dev
,
NULL
);
if
(
!
husb
)
if
(
!
husb
)
return
;
return
;
hdev
=
&
husb
->
hdev
;
BT_DBG
(
"%s"
,
hdev
->
name
);
BT_DBG
(
"%s"
,
hdev
->
name
);
hci_usb_close
(
hdev
);
hci_usb_close
(
hdev
);
...
...
drivers/input/joystick/iforce/iforce-usb.c
View file @
a64bc8b4
...
@@ -106,14 +106,15 @@ static void iforce_usb_ctrl(struct urb *urb)
...
@@ -106,14 +106,15 @@ static void iforce_usb_ctrl(struct urb *urb)
wake_up
(
&
iforce
->
wait
);
wake_up
(
&
iforce
->
wait
);
}
}
static
void
*
iforce_usb_probe
(
struct
usb_device
*
dev
,
unsigned
int
ifnum
,
static
int
iforce_usb_probe
(
struct
usb_interface
*
intf
,
const
struct
usb_device_id
*
id
)
const
struct
usb_device_id
*
id
)
{
{
struct
usb_device
*
dev
=
interface_to_usbdev
(
intf
);
struct
usb_endpoint_descriptor
*
epirq
,
*
epout
;
struct
usb_endpoint_descriptor
*
epirq
,
*
epout
;
struct
iforce
*
iforce
;
struct
iforce
*
iforce
;
epirq
=
dev
->
config
[
0
].
interface
[
ifnum
].
altsetting
[
0
].
endpoint
+
0
;
epirq
=
intf
->
altsetting
[
0
].
endpoint
+
0
;
epout
=
dev
->
config
[
0
].
interface
[
ifnum
].
altsetting
[
0
].
endpoint
+
1
;
epout
=
intf
->
altsetting
[
0
].
endpoint
+
1
;
if
(
!
(
iforce
=
kmalloc
(
sizeof
(
struct
iforce
)
+
32
,
GFP_KERNEL
)))
if
(
!
(
iforce
=
kmalloc
(
sizeof
(
struct
iforce
)
+
32
,
GFP_KERNEL
)))
goto
fail
;
goto
fail
;
...
@@ -150,7 +151,8 @@ static void *iforce_usb_probe(struct usb_device *dev, unsigned int ifnum,
...
@@ -150,7 +151,8 @@ static void *iforce_usb_probe(struct usb_device *dev, unsigned int ifnum,
if
(
iforce_init_device
(
iforce
))
goto
fail
;
if
(
iforce_init_device
(
iforce
))
goto
fail
;
return
iforce
;
dev_set_drvdata
(
&
intf
->
dev
,
iforce
);
return
0
;
fail:
fail:
if
(
iforce
)
{
if
(
iforce
)
{
...
@@ -160,7 +162,7 @@ static void *iforce_usb_probe(struct usb_device *dev, unsigned int ifnum,
...
@@ -160,7 +162,7 @@ static void *iforce_usb_probe(struct usb_device *dev, unsigned int ifnum,
kfree
(
iforce
);
kfree
(
iforce
);
}
}
return
NULL
;
return
-
ENODEV
;
}
}
/* Called by iforce_delete() */
/* Called by iforce_delete() */
...
@@ -176,17 +178,20 @@ void iforce_usb_delete(struct iforce* iforce)
...
@@ -176,17 +178,20 @@ void iforce_usb_delete(struct iforce* iforce)
usb_free_urb
(
iforce
->
ctrl
);
usb_free_urb
(
iforce
->
ctrl
);
}
}
static
void
iforce_usb_disconnect
(
struct
usb_
device
*
dev
,
void
*
ptr
)
static
void
iforce_usb_disconnect
(
struct
usb_
interface
*
intf
)
{
{
struct
iforce
*
iforce
=
ptr
;
struct
iforce
*
iforce
=
dev_get_drvdata
(
&
intf
->
dev
)
;
int
open
=
0
;
/* FIXME! iforce->dev.handle->open; */
int
open
=
0
;
/* FIXME! iforce->dev.handle->open; */
iforce
->
usbdev
=
NULL
;
dev_set_drvdata
(
&
intf
->
dev
,
NULL
);
input_unregister_device
(
&
iforce
->
dev
);
if
(
iforce
)
{
iforce
->
usbdev
=
NULL
;
input_unregister_device
(
&
iforce
->
dev
);
if
(
!
open
)
{
if
(
!
open
)
{
iforce_delete_device
(
iforce
);
iforce_delete_device
(
iforce
);
kfree
(
iforce
);
kfree
(
iforce
);
}
}
}
}
}
...
...
drivers/isdn/hisax/st5481_init.c
View file @
a64bc8b4
...
@@ -59,10 +59,10 @@ static LIST_HEAD(adapter_list);
...
@@ -59,10 +59,10 @@ static LIST_HEAD(adapter_list);
* This function will be called when the adapter is plugged
* This function will be called when the adapter is plugged
* into the USB bus.
* into the USB bus.
*/
*/
static
void
*
__devinit
probe_st5481
(
struct
usb_device
*
dev
,
static
int
probe_st5481
(
struct
usb_interface
*
intf
unsigned
int
ifnum
,
const
struct
usb_device_id
*
id
)
const
struct
usb_device_id
*
id
)
{
{
struct
usb_device
*
dev
=
interface_to_usbdev
(
intf
);
struct
st5481_adapter
*
adapter
;
struct
st5481_adapter
*
adapter
;
struct
hisax_b_if
*
b_if
[
2
];
struct
hisax_b_if
*
b_if
[
2
];
int
retval
,
i
;
int
retval
,
i
;
...
@@ -73,7 +73,7 @@ static void * __devinit probe_st5481(struct usb_device *dev,
...
@@ -73,7 +73,7 @@ static void * __devinit probe_st5481(struct usb_device *dev,
adapter
=
kmalloc
(
sizeof
(
struct
st5481_adapter
),
GFP_KERNEL
);
adapter
=
kmalloc
(
sizeof
(
struct
st5481_adapter
),
GFP_KERNEL
);
if
(
!
adapter
)
if
(
!
adapter
)
return
NULL
;
return
-
ENOMEM
;
memset
(
adapter
,
0
,
sizeof
(
struct
st5481_adapter
));
memset
(
adapter
,
0
,
sizeof
(
struct
st5481_adapter
));
...
@@ -114,6 +114,7 @@ static void * __devinit probe_st5481(struct usb_device *dev,
...
@@ -114,6 +114,7 @@ static void * __devinit probe_st5481(struct usb_device *dev,
hisax_register
(
&
adapter
->
hisax_d_if
,
b_if
,
"st5481_usb"
,
protocol
);
hisax_register
(
&
adapter
->
hisax_d_if
,
b_if
,
"st5481_usb"
,
protocol
);
st5481_start
(
adapter
);
st5481_start
(
adapter
);
dev_set_drvdata
(
&
intf
->
dev
,
adapter
);
return
adapter
;
return
adapter
;
err_b:
err_b:
...
@@ -123,19 +124,23 @@ static void * __devinit probe_st5481(struct usb_device *dev,
...
@@ -123,19 +124,23 @@ static void * __devinit probe_st5481(struct usb_device *dev,
err_usb:
err_usb:
st5481_release_usb
(
adapter
);
st5481_release_usb
(
adapter
);
err:
err:
return
NULL
;
return
-
EIO
;
}
}
/*
/*
* This function will be called when the adapter is removed
* This function will be called when the adapter is removed
* from the USB bus.
* from the USB bus.
*/
*/
static
void
__devexit
disconnect_st5481
(
struct
usb_device
*
dev
,
void
*
arg
)
static
void
disconnect_st5481
(
struct
usb_interface
*
intf
)
{
{
struct
st5481_adapter
*
adapter
=
arg
;
struct
st5481_adapter
*
adapter
=
dev_get_drvdata
(
&
intf
->
dev
)
;
DBG
(
1
,
""
);
DBG
(
1
,
""
);
dev_set_drvdata
(
&
intf
->
dev
,
NULL
);
if
(
!
adapter
)
return
;
list_del
(
&
adapter
->
list
);
list_del
(
&
adapter
->
list
);
st5481_stop
(
adapter
);
st5481_stop
(
adapter
);
...
@@ -176,10 +181,10 @@ static struct usb_device_id st5481_ids[] = {
...
@@ -176,10 +181,10 @@ static struct usb_device_id st5481_ids[] = {
MODULE_DEVICE_TABLE
(
usb
,
st5481_ids
);
MODULE_DEVICE_TABLE
(
usb
,
st5481_ids
);
static
struct
usb_driver
st5481_usb_driver
=
{
static
struct
usb_driver
st5481_usb_driver
=
{
.
name
=
"st5481_usb"
,
.
name
=
"st5481_usb"
,
.
probe
=
probe_st5481
,
.
probe
=
probe_st5481
,
.
disconnect
=
__devexit_p
(
disconnect_st5481
)
,
.
disconnect
=
disconnect_st5481
,
.
id_table
=
st5481_ids
,
.
id_table
=
st5481_ids
,
};
};
static
int
__init
st5481_usb_init
(
void
)
static
int
__init
st5481_usb_init
(
void
)
...
...
drivers/media/video/cpia_usb.c
View file @
a64bc8b4
...
@@ -479,9 +479,10 @@ int cpia_usb_init(void)
...
@@ -479,9 +479,10 @@ int cpia_usb_init(void)
/* Probing and initializing */
/* Probing and initializing */
static
void
*
cpia_probe
(
struct
usb_device
*
udev
,
unsigned
int
ifnum
,
static
int
cpia_probe
(
struct
usb_interface
*
intf
,
const
struct
usb_device_id
*
id
)
const
struct
usb_device_id
*
id
)
{
{
struct
usb_device
*
udev
=
interface_to_usbdev
(
intf
);
struct
usb_interface_descriptor
*
interface
;
struct
usb_interface_descriptor
*
interface
;
struct
usb_cpia
*
ucpia
;
struct
usb_cpia
*
ucpia
;
struct
cam_data
*
cam
;
struct
cam_data
*
cam
;
...
@@ -489,16 +490,16 @@ static void *cpia_probe(struct usb_device *udev, unsigned int ifnum,
...
@@ -489,16 +490,16 @@ static void *cpia_probe(struct usb_device *udev, unsigned int ifnum,
/* A multi-config CPiA camera? */
/* A multi-config CPiA camera? */
if
(
udev
->
descriptor
.
bNumConfigurations
!=
1
)
if
(
udev
->
descriptor
.
bNumConfigurations
!=
1
)
return
NULL
;
return
-
ENODEV
;
interface
=
&
udev
->
actconfig
->
interface
[
ifnum
].
altsetting
[
0
];
interface
=
&
intf
->
altsetting
[
0
];
printk
(
KERN_INFO
"USB CPiA camera found
\n
"
);
printk
(
KERN_INFO
"USB CPiA camera found
\n
"
);
ucpia
=
kmalloc
(
sizeof
(
*
ucpia
),
GFP_KERNEL
);
ucpia
=
kmalloc
(
sizeof
(
*
ucpia
),
GFP_KERNEL
);
if
(
!
ucpia
)
{
if
(
!
ucpia
)
{
printk
(
KERN_ERR
"couldn't kmalloc cpia struct
\n
"
);
printk
(
KERN_ERR
"couldn't kmalloc cpia struct
\n
"
);
return
NULL
;
return
-
ENOMEM
;
}
}
memset
(
ucpia
,
0
,
sizeof
(
*
ucpia
));
memset
(
ucpia
,
0
,
sizeof
(
*
ucpia
));
...
@@ -548,7 +549,8 @@ static void *cpia_probe(struct usb_device *udev, unsigned int ifnum,
...
@@ -548,7 +549,8 @@ static void *cpia_probe(struct usb_device *udev, unsigned int ifnum,
cpia_add_to_list
(
cam_list
,
cam
);
cpia_add_to_list
(
cam_list
,
cam
);
spin_unlock
(
&
cam_list_lock_usb
);
spin_unlock
(
&
cam_list_lock_usb
);
return
cam
;
dev_set_drvdata
(
&
intf
->
dev
,
cam
);
return
0
;
fail_all:
fail_all:
vfree
(
ucpia
->
buffers
[
2
]);
vfree
(
ucpia
->
buffers
[
2
]);
...
@@ -561,10 +563,10 @@ static void *cpia_probe(struct usb_device *udev, unsigned int ifnum,
...
@@ -561,10 +563,10 @@ static void *cpia_probe(struct usb_device *udev, unsigned int ifnum,
ucpia
->
buffers
[
0
]
=
NULL
;
ucpia
->
buffers
[
0
]
=
NULL
;
fail_alloc_0:
fail_alloc_0:
return
NULL
;
return
-
EIO
;
}
}
static
void
cpia_disconnect
(
struct
usb_
device
*
dev
,
void
*
ptr
);
static
void
cpia_disconnect
(
struct
usb_
interface
*
intf
);
static
struct
usb_device_id
cpia_id_table
[]
=
{
static
struct
usb_device_id
cpia_id_table
[]
=
{
{
USB_DEVICE
(
0x0553
,
0x0002
)
},
{
USB_DEVICE
(
0x0553
,
0x0002
)
},
...
@@ -586,11 +588,17 @@ static struct usb_driver cpia_driver = {
...
@@ -586,11 +588,17 @@ static struct usb_driver cpia_driver = {
/* don't use dev, it may be NULL! (see usb_cpia_cleanup) */
/* don't use dev, it may be NULL! (see usb_cpia_cleanup) */
/* _disconnect from usb_cpia_cleanup is not necessary since usb_deregister */
/* _disconnect from usb_cpia_cleanup is not necessary since usb_deregister */
/* will do it for us as well as passing a udev structure - jerdfelt */
/* will do it for us as well as passing a udev structure - jerdfelt */
static
void
cpia_disconnect
(
struct
usb_
device
*
udev
,
void
*
ptr
)
static
void
cpia_disconnect
(
struct
usb_
interface
*
intf
)
{
{
struct
cam_data
*
cam
=
(
struct
cam_data
*
)
ptr
;
struct
cam_data
*
cam
=
dev_get_drvdata
(
&
intf
->
dev
);
struct
usb_cpia
*
ucpia
=
(
struct
usb_cpia
*
)
cam
->
lowlevel_data
;
struct
usb_cpia
*
ucpia
;
struct
usb_device
*
udev
;
dev_set_drvdata
(
&
intf
->
dev
,
NULL
);
if
(
!
cam
)
return
;
ucpia
=
(
struct
usb_cpia
*
)
cam
->
lowlevel_data
;
spin_lock
(
&
cam_list_lock_usb
);
spin_lock
(
&
cam_list_lock_usb
);
cpia_remove_from_list
(
cam
);
cpia_remove_from_list
(
cam
);
spin_unlock
(
&
cam_list_lock_usb
);
spin_unlock
(
&
cam_list_lock_usb
);
...
@@ -607,6 +615,7 @@ static void cpia_disconnect(struct usb_device *udev, void *ptr)
...
@@ -607,6 +615,7 @@ static void cpia_disconnect(struct usb_device *udev, void *ptr)
if
(
waitqueue_active
(
&
ucpia
->
wq_stream
))
if
(
waitqueue_active
(
&
ucpia
->
wq_stream
))
wake_up_interruptible
(
&
ucpia
->
wq_stream
);
wake_up_interruptible
(
&
ucpia
->
wq_stream
);
udev
=
interface_to_usbdev
(
intf
);
usb_driver_release_interface
(
&
cpia_driver
,
usb_driver_release_interface
(
&
cpia_driver
,
&
udev
->
actconfig
->
interface
[
0
]);
&
udev
->
actconfig
->
interface
[
0
]);
...
...
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