]> git.baikalelectronics.ru Git - kernel.git/commitdiff
USB: gadget: Rename usb_gadget_probe_driver()
authorAlan Stern <stern@rowland.harvard.edu>
Sun, 24 Apr 2022 00:42:03 +0000 (20:42 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Apr 2022 12:00:13 +0000 (14:00 +0200)
In preparation for adding a "gadget" bus, this patch renames
usb_gadget_probe_driver() to usb_gadget_register_driver().  The new
name will be more accurate, since gadget drivers will be registered on
the gadget bus and the probing will be done by the driver core, not
the UDC core.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/YmSc29YZvxgT5fEJ@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/composite.c
drivers/usb/gadget/configfs.c
drivers/usb/gadget/legacy/dbgp.c
drivers/usb/gadget/legacy/inode.c
drivers/usb/gadget/legacy/raw_gadget.c
drivers/usb/gadget/udc/core.c
include/linux/usb/gadget.h

index 2eaeaae96759e320a1d522fef6ca8a95749f1ca3..403563c06477b1906fd25ccb51d00288f35f6a18 100644 (file)
@@ -2505,7 +2505,7 @@ int usb_composite_probe(struct usb_composite_driver *driver)
        gadget_driver->driver.name = driver->name;
        gadget_driver->max_speed = driver->max_speed;
 
-       return usb_gadget_probe_driver(gadget_driver);
+       return usb_gadget_register_driver(gadget_driver);
 }
 EXPORT_SYMBOL_GPL(usb_composite_probe);
 
index 1fb837d9271e155cfeb89987feb0ebc855877a30..4141206bb0eda056d17c83557ce0685b61de649c 100644 (file)
@@ -284,7 +284,7 @@ static ssize_t gadget_dev_desc_UDC_store(struct config_item *item,
                        goto err;
                }
                gi->composite.gadget_driver.udc_name = name;
-               ret = usb_gadget_probe_driver(&gi->composite.gadget_driver);
+               ret = usb_gadget_register_driver(&gi->composite.gadget_driver);
                if (ret) {
                        gi->composite.gadget_driver.udc_name = NULL;
                        goto err;
index 6bcbad382580203e0aafbe012c202c3587297a3a..b62e45235e8e1c3242728a7099af696fa8470b45 100644 (file)
@@ -422,7 +422,7 @@ static struct usb_gadget_driver dbgp_driver = {
 
 static int __init dbgp_init(void)
 {
-       return usb_gadget_probe_driver(&dbgp_driver);
+       return usb_gadget_register_driver(&dbgp_driver);
 }
 
 static void __exit dbgp_exit(void)
index 0c01e749f9eae48aad694faf54e2193158e05c7f..79990597c39f14e7853444470393faba38ea0074 100644 (file)
@@ -1873,7 +1873,7 @@ dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
        else
                gadgetfs_driver.max_speed = USB_SPEED_FULL;
 
-       value = usb_gadget_probe_driver(&gadgetfs_driver);
+       value = usb_gadget_register_driver(&gadgetfs_driver);
        if (value != 0) {
                spin_lock_irq(&dev->lock);
                goto fail;
index 8d40a1f2ec57d343b0c7f1f68ad3dfe0f377467c..b3be8db1ff6385350828c0a9e8e90369228b2a11 100644 (file)
@@ -510,12 +510,12 @@ static int raw_ioctl_run(struct raw_dev *dev, unsigned long value)
        }
        spin_unlock_irqrestore(&dev->lock, flags);
 
-       ret = usb_gadget_probe_driver(&dev->driver);
+       ret = usb_gadget_register_driver(&dev->driver);
 
        spin_lock_irqsave(&dev->lock, flags);
        if (ret) {
                dev_err(dev->dev,
-                       "fail, usb_gadget_probe_driver returned %d\n", ret);
+                       "fail, usb_gadget_register_driver returned %d\n", ret);
                dev->state = STATE_DEV_FAILED;
                goto out_unlock;
        }
index 85b194011a16713df97baca979cb43a3ecdab40e..f0cce482b74a1d0e8af83dce3ab0f72885e229c6 100644 (file)
@@ -1523,7 +1523,7 @@ err1:
        return ret;
 }
 
-int usb_gadget_probe_driver(struct usb_gadget_driver *driver)
+int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 {
        struct usb_udc          *udc = NULL, *iter;
        int                     ret = -ENODEV;
@@ -1572,7 +1572,7 @@ found:
        mutex_unlock(&udc_lock);
        return ret;
 }
-EXPORT_SYMBOL_GPL(usb_gadget_probe_driver);
+EXPORT_SYMBOL_GPL(usb_gadget_register_driver);
 
 int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
 {
index 10fe57cf40beca6a9ef8a5244975c4a6b3d590c8..5830b8a903da3ae27a2775aa0d5c77c1698aa152 100644 (file)
@@ -745,7 +745,7 @@ struct usb_gadget_driver {
  */
 
 /**
- * usb_gadget_probe_driver - probe a gadget driver
+ * usb_gadget_register_driver - register a gadget driver
  * @driver: the driver being registered
  * Context: can sleep
  *
@@ -755,7 +755,7 @@ struct usb_gadget_driver {
  * registration call returns.  It's expected that the @bind() function will
  * be in init sections.
  */
-int usb_gadget_probe_driver(struct usb_gadget_driver *driver);
+int usb_gadget_register_driver(struct usb_gadget_driver *driver);
 
 /**
  * usb_gadget_unregister_driver - unregister a gadget driver