Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 175032
b: refs/heads/master
c: 3589972
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Dec 11, 2009
1 parent 637f7a2 commit faa74c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 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: c60e0504c8e4fa14179d0687d80ef25148dd6dd4
refs/heads/master: 3589972e51fac1e02d0aaa576fa47f568cb94d40
9 changes: 8 additions & 1 deletion trunk/drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ static inline int device_is_not_partition(struct device *dev)
*/
const char *dev_driver_string(const struct device *dev)
{
return dev->driver ? dev->driver->name :
struct device_driver *drv;

/* dev->driver can change to NULL underneath us because of unbinding,
* so be careful about accessing it. dev->bus and dev->class should
* never change once they are set, so they don't need special care.
*/
drv = ACCESS_ONCE(dev->driver);
return drv ? drv->name :
(dev->bus ? dev->bus->name :
(dev->class ? dev->class->name : ""));
}
Expand Down

0 comments on commit faa74c2

Please sign in to comment.