aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorLan Tianyu <tianyu.lan@intel.com>2012-08-17 04:44:55 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-20 17:38:08 -0400
commit2d366846598d5f562866bba61a836d9325878066 (patch)
treee09734b7a6e6aa191ef458740a05dfdd6b26b79a /drivers/usb/core
parent26f944b2716717aa243f16cd2181f80441153f0d (diff)
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 <tianyu.lan@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/endpoint.c10
1 files changed, 5 insertions, 5 deletions
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 {
24#define to_ep_device(_dev) \ 24#define to_ep_device(_dev) \
25 container_of(_dev, struct ep_device, dev) 25 container_of(_dev, struct ep_device, dev)
26 26
27struct device_type usb_ep_device_type = {
28 .name = "usb_endpoint",
29};
30
31struct ep_attribute { 27struct ep_attribute {
32 struct attribute attr; 28 struct attribute attr;
33 ssize_t (*show)(struct usb_device *, 29 ssize_t (*show)(struct usb_device *,
@@ -172,6 +168,11 @@ static void ep_device_release(struct device *dev)
172 kfree(ep_dev); 168 kfree(ep_dev);
173} 169}
174 170
171struct device_type usb_ep_device_type = {
172 .name = "usb_endpoint",
173 .release = ep_device_release,
174};
175
175int usb_create_ep_devs(struct device *parent, 176int usb_create_ep_devs(struct device *parent,
176 struct usb_host_endpoint *endpoint, 177 struct usb_host_endpoint *endpoint,
177 struct usb_device *udev) 178 struct usb_device *udev)
@@ -190,7 +191,6 @@ int usb_create_ep_devs(struct device *parent,
190 ep_dev->dev.groups = ep_dev_groups; 191 ep_dev->dev.groups = ep_dev_groups;
191 ep_dev->dev.type = &usb_ep_device_type; 192 ep_dev->dev.type = &usb_ep_device_type;
192 ep_dev->dev.parent = parent; 193 ep_dev->dev.parent = parent;
193 ep_dev->dev.release = ep_device_release;
194 dev_set_name(&ep_dev->dev, "ep_%02x", endpoint->desc.bEndpointAddress); 194 dev_set_name(&ep_dev->dev, "ep_%02x", endpoint->desc.bEndpointAddress);
195 195
196 retval = device_register(&ep_dev->dev); 196 retval = device_register(&ep_dev->dev);