[PATCH v2 6/7] usb: gadget: core: delete udc_attach_driver API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After gadget bus introducing, the user (configfs) of this API
will use device-model's bind/unbind, so we can use delete it.

Signed-off-by: Peter Chen <peter.chen@xxxxxxxxxxxxx>
---
 drivers/usb/gadget/udc-core.c |   44 -----------------------------------------
 include/linux/usb/gadget.h    |    2 -
 2 files changed, 0 insertions(+), 46 deletions(-)

diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
index 00a04e9..47f87af 100644
--- a/drivers/usb/gadget/udc-core.c
+++ b/drivers/usb/gadget/udc-core.c
@@ -158,16 +158,6 @@ static int __find_driver(struct device *dev, void *data)
 		return 0;
 }
 
-static int __find_udc(struct device *dev, void *data)
-{
-	char *name = data;
-
-	if (strcmp(name, dev_name(dev)) == 0)
-		return 1;
-	else
-		return 0;
-}
-
 /**
  * usb_gadget_udc_start - tells usb device controller to start up
  * @gadget: The gadget we want to get started
@@ -410,40 +400,6 @@ err1:
 	return ret;
 }
 
-int udc_attach_driver(const char *name, struct usb_gadget_driver *driver)
-{
-	struct usb_udc *udc;
-	struct device *dev;
-	int ret = -ENODEV;
-	struct device_driver *drv;
-
-	mutex_lock(&udc_lock);
-
-	if (!driver || !driver->bind || !driver->setup) {
-		ret = -EINVAL;
-		goto out;
-	}
-
-	dev = bus_find_device(&gadget_bus_type,
-			NULL, (char *)name, __find_udc);
-	if (!dev)
-		goto out;
-
-	udc = container_of(dev, struct usb_udc, dev);
-	if (udc->driver) {
-		ret = -EBUSY;
-		goto out;
-	}
-
-	drv = &driver->driver;
-	drv->bus = &gadget_bus_type;
-	ret = driver_register(drv);
-out:
-	mutex_unlock(&udc_lock);
-	return ret;
-}
-EXPORT_SYMBOL_GPL(udc_attach_driver);
-
 int usb_gadget_probe_driver(struct usb_gadget_driver *driver)
 {
 	struct device_driver *drv;
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index c3a6185..cd58acd 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -921,8 +921,6 @@ extern int usb_add_gadget_udc_release(struct device *parent,
 		struct usb_gadget *gadget, void (*release)(struct device *dev));
 extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget);
 extern void usb_del_gadget_udc(struct usb_gadget *gadget);
-extern int udc_attach_driver(const char *name,
-		struct usb_gadget_driver *driver);
 
 /*-------------------------------------------------------------------------*/
 
-- 
1.7.8

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux