Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9191
b: refs/heads/master
c: d305ef5
h: refs/heads/master
i:
  9189: 160f9e5
  9187: d3a34a7
  9183: 2521a9e
v: v3
  • Loading branch information
Daniel Ritz authored and Linus Torvalds committed Sep 22, 2005
1 parent 63465f7 commit 6a7313a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4c898c7f2f286b204fefc5dddb568f755d195d0c
refs/heads/master: d305ef5d2a4e77bfa66160513f4a7494126a506b
2 changes: 1 addition & 1 deletion trunk/drivers/s390/cio/ccwgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ __ccwgroup_get_gdev_by_cdev(struct ccw_device *cdev)
if (cdev->dev.driver_data) {
gdev = (struct ccwgroup_device *)cdev->dev.driver_data;
if (get_device(&gdev->dev)) {
if (klist_node_attached(&gdev->dev.knode_bus))
if (device_is_registered(&gdev->dev))
return gdev;
put_device(&gdev->dev);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)

/* remove this interface if it has been registered */
interface = dev->actconfig->interface[i];
if (!klist_node_attached(&interface->dev.knode_bus))
if (!device_is_registered(&interface->dev))
continue;
dev_dbg (&dev->dev, "unregistering interface %s\n",
interface->dev.bus_id);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/usb/core/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ int usb_driver_claim_interface(struct usb_driver *driver,
/* if interface was already added, bind now; else let
* the future device_add() bind it, bypassing probe()
*/
if (klist_node_attached(&dev->knode_bus))
if (device_is_registered(dev))
device_bind_driver(dev);

return 0;
Expand Down Expand Up @@ -336,8 +336,8 @@ void usb_driver_release_interface(struct usb_driver *driver,
if (iface->condition != USB_INTERFACE_BOUND)
return;

/* release only after device_add() */
if (klist_node_attached(&dev->knode_bus)) {
/* don't release if the interface hasn't been added yet */
if (device_is_registered(dev)) {
iface->condition = USB_INTERFACE_UNBINDING;
device_release_driver(dev);
}
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,11 @@ dev_set_drvdata (struct device *dev, void *data)
dev->driver_data = data;
}

static inline int device_is_registered(struct device *dev)
{
return klist_node_attached(&dev->knode_bus);
}

/*
* High level routines for use by the bus drivers
*/
Expand Down

0 comments on commit 6a7313a

Please sign in to comment.