Skip to content

Commit

Permalink
usb/endpoint: Set release callback in the struct device_type instead …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Lan Tianyu authored and Greg Kroah-Hartman committed Aug 20, 2012
1 parent 26f944b commit 2d36684
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/usb/core/endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *,
Expand Down Expand Up @@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit 2d36684

Please sign in to comment.