From: Lan Tianyu Date: Fri, 17 Aug 2012 08:44:55 +0000 (+0800) Subject: usb/endpoint: Set release callback in the struct device_type instead of in the device... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2d366846598d5f562866bba61a836d9325878066;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git usb/endpoint: Set release callback in the struct device_type instead of in the device itself directly For following the way the rest of the usb core does, this patch is to change the place of setting release callback. Signed-off-by: Lan Tianyu Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index db7fe50c23d..68cc6532e74 100644 --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c @@ -24,10 +24,6 @@ struct ep_device { #define to_ep_device(_dev) \ container_of(_dev, struct ep_device, dev) -struct device_type usb_ep_device_type = { - .name = "usb_endpoint", -}; - struct ep_attribute { struct attribute attr; ssize_t (*show)(struct usb_device *, @@ -172,6 +168,11 @@ static void ep_device_release(struct device *dev) kfree(ep_dev); } +struct device_type usb_ep_device_type = { + .name = "usb_endpoint", + .release = ep_device_release, +}; + int usb_create_ep_devs(struct device *parent, struct usb_host_endpoint *endpoint, struct usb_device *udev) @@ -190,7 +191,6 @@ int usb_create_ep_devs(struct device *parent, ep_dev->dev.groups = ep_dev_groups; ep_dev->dev.type = &usb_ep_device_type; ep_dev->dev.parent = parent; - ep_dev->dev.release = ep_device_release; dev_set_name(&ep_dev->dev, "ep_%02x", endpoint->desc.bEndpointAddress); retval = device_register(&ep_dev->dev);