Skip to content

Commit

Permalink
USB: serial: remove usb_serial_register and usb_serial_deregister
Browse files Browse the repository at this point in the history
No one uses them anymore, they should be using the safer
usb_serial_register_drivers() and usb_serial_deregister_drivers()
functions instead.

Thanks to Alan Stern for writing these functions and porting all
in-kernel users to them.

Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed Feb 24, 2012
1 parent 8c49fc9 commit f799e76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
12 changes: 2 additions & 10 deletions drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1338,12 +1338,7 @@ static void fixup_generic(struct usb_serial_driver *device)
set_to_generic_if_null(device, prepare_write_buffer);
}

/*
* The next two routines are mainly for internal use.
* They are exported only for out-of-tree modules.
* New drivers should call usb_serial_{de}register_drivers() instead.
*/
int usb_serial_register(struct usb_serial_driver *driver)
static int usb_serial_register(struct usb_serial_driver *driver)
{
int retval;

Expand Down Expand Up @@ -1377,10 +1372,8 @@ int usb_serial_register(struct usb_serial_driver *driver)
mutex_unlock(&table_lock);
return retval;
}
EXPORT_SYMBOL_GPL(usb_serial_register);


void usb_serial_deregister(struct usb_serial_driver *device)
static void usb_serial_deregister(struct usb_serial_driver *device)
{
printk(KERN_INFO "USB Serial deregistering driver %s\n",
device->description);
Expand All @@ -1389,7 +1382,6 @@ void usb_serial_deregister(struct usb_serial_driver *device)
usb_serial_bus_deregister(device);
mutex_unlock(&table_lock);
}
EXPORT_SYMBOL_GPL(usb_serial_deregister);

/**
* usb_serial_register_drivers - register drivers for a usb-serial module
Expand Down
7 changes: 0 additions & 7 deletions include/linux/usb/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,6 @@ struct usb_serial_driver {
#define to_usb_serial_driver(d) \
container_of(d, struct usb_serial_driver, driver)

/*
* These two routines are kept only for backward compatibility.
* Don't use them; call usb_serial_{de}register_drivers() instead.
*/
extern int usb_serial_register(struct usb_serial_driver *driver);
extern void usb_serial_deregister(struct usb_serial_driver *driver);

extern int usb_serial_register_drivers(struct usb_driver *udriver,
struct usb_serial_driver * const serial_drivers[]);
extern void usb_serial_deregister_drivers(struct usb_driver *udriver,
Expand Down

0 comments on commit f799e76

Please sign in to comment.