USB: Export generic USB device driver functions
This will make it possible to implement device drivers which extend the generic driver without needing to reimplement it. Signed-off-by: Bastien Nocera <hadess@hadess.net> Acked-by: Alan Stern <stern@rowland.harvard.edu> Link: https://lore.kernel.org/r/20191016093933.693-2-hadess@hadess.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6a9746fb0b
commit
ef0f7d1877
|
@ -195,7 +195,7 @@ int usb_choose_configuration(struct usb_device *udev)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(usb_choose_configuration);
|
EXPORT_SYMBOL_GPL(usb_choose_configuration);
|
||||||
|
|
||||||
static int generic_probe(struct usb_device *udev)
|
int usb_generic_driver_probe(struct usb_device *udev)
|
||||||
{
|
{
|
||||||
int err, c;
|
int err, c;
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ static int generic_probe(struct usb_device *udev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void generic_disconnect(struct usb_device *udev)
|
void usb_generic_driver_disconnect(struct usb_device *udev)
|
||||||
{
|
{
|
||||||
usb_notify_remove_device(udev);
|
usb_notify_remove_device(udev);
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ static void generic_disconnect(struct usb_device *udev)
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
|
|
||||||
static int generic_suspend(struct usb_device *udev, pm_message_t msg)
|
int usb_generic_driver_suspend(struct usb_device *udev, pm_message_t msg)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ static int generic_suspend(struct usb_device *udev, pm_message_t msg)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int generic_resume(struct usb_device *udev, pm_message_t msg)
|
int usb_generic_driver_resume(struct usb_device *udev, pm_message_t msg)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -285,11 +285,11 @@ static int generic_resume(struct usb_device *udev, pm_message_t msg)
|
||||||
|
|
||||||
struct usb_device_driver usb_generic_driver = {
|
struct usb_device_driver usb_generic_driver = {
|
||||||
.name = "usb",
|
.name = "usb",
|
||||||
.probe = generic_probe,
|
.probe = usb_generic_driver_probe,
|
||||||
.disconnect = generic_disconnect,
|
.disconnect = usb_generic_driver_disconnect,
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
.suspend = generic_suspend,
|
.suspend = usb_generic_driver_suspend,
|
||||||
.resume = generic_resume,
|
.resume = usb_generic_driver_resume,
|
||||||
#endif
|
#endif
|
||||||
.supports_autosuspend = 1,
|
.supports_autosuspend = 1,
|
||||||
};
|
};
|
||||||
|
|
|
@ -47,6 +47,12 @@ extern void usb_release_bos_descriptor(struct usb_device *dev);
|
||||||
extern char *usb_cache_string(struct usb_device *udev, int index);
|
extern char *usb_cache_string(struct usb_device *udev, int index);
|
||||||
extern int usb_set_configuration(struct usb_device *dev, int configuration);
|
extern int usb_set_configuration(struct usb_device *dev, int configuration);
|
||||||
extern int usb_choose_configuration(struct usb_device *udev);
|
extern int usb_choose_configuration(struct usb_device *udev);
|
||||||
|
extern int usb_generic_driver_probe(struct usb_device *udev);
|
||||||
|
extern void usb_generic_driver_disconnect(struct usb_device *udev);
|
||||||
|
extern int usb_generic_driver_suspend(struct usb_device *udev,
|
||||||
|
pm_message_t msg);
|
||||||
|
extern int usb_generic_driver_resume(struct usb_device *udev,
|
||||||
|
pm_message_t msg);
|
||||||
|
|
||||||
static inline unsigned usb_get_max_power(struct usb_device *udev,
|
static inline unsigned usb_get_max_power(struct usb_device *udev,
|
||||||
struct usb_host_config *c)
|
struct usb_host_config *c)
|
||||||
|
|
Loading…
Reference in New Issue