};
static struct class *udc_class;
-static struct device_type udc_device_type;
static LIST_HEAD(udc_list);
static DEFINE_MUTEX(udc_lock);
kfree(udc);
}
+static const struct attribute_group *usb_udc_attr_groups[];
/**
* usb_add_gadget_udc - adds a new gadget to the udc class driver list
* @parent: the parent device to this udc. Usually the controller
device_initialize(&udc->dev);
udc->dev.release = usb_udc_release;
udc->dev.class = udc_class;
+ udc->dev.groups = usb_udc_attr_groups;
udc->dev.parent = parent;
ret = dev_set_name(&udc->dev, "%s", kobject_name(&parent->kobj));
if (ret)
static ssize_t usb_udc_speed_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct usb_udc *udc = dev_get_drvdata(dev);
+ struct usb_udc *udc = container_of(dev, struct usb_udc, dev);
struct usb_gadget *gadget = udc->gadget;
switch (gadget->speed) {
ssize_t usb_udc_##name##_show(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
- struct usb_udc *udc = dev_get_drvdata(dev); \
+ struct usb_udc *udc = container_of(dev, struct usb_udc, dev); \
struct usb_gadget *gadget = udc->gadget; \
\
return snprintf(buf, PAGE_SIZE, "%d\n", gadget->name); \
}
udc_class->dev_uevent = usb_udc_uevent;
- udc_device_type.groups = usb_udc_attr_groups;
-
return 0;
}
subsys_initcall(usb_udc_init);