Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145937
b: refs/heads/master
c: 0bf8412
h: refs/heads/master
i:
  145935: 12b65c5
v: v3
  • Loading branch information
Joerg Roedel committed Jun 8, 2009
1 parent 801137d commit 586052d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 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: be81c6ea23b8b471141734ef4bc005f5127aaf43
refs/heads/master: 0bf841281e58d0b3cc9fe9dc4383df7694bde6bd
42 changes: 21 additions & 21 deletions trunk/lib/dma-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ static inline void dump_entry_trace(struct dma_debug_entry *entry)

static bool driver_filter(struct device *dev)
{
struct device_driver *drv;
unsigned long flags;
bool ret;

/* driver filter off */
if (likely(!current_driver_name[0]))
return true;
Expand All @@ -155,32 +159,28 @@ static bool driver_filter(struct device *dev)
if (current_driver && dev->driver == current_driver)
return true;

/* driver filter on but not yet initialized */
if (!current_driver && current_driver_name[0]) {
struct device_driver *drv = get_driver(dev->driver);
unsigned long flags;
bool ret = false;

if (!drv)
return false;

/* lock to protect against change of current_driver_name */
read_lock_irqsave(&driver_name_lock, flags);
if (current_driver || !current_driver_name[0])
return false;

if (drv->name &&
strncmp(current_driver_name, drv->name,
NAME_MAX_LEN-1) == 0) {
current_driver = drv;
ret = true;
}
/* driver filter on but not yet initialized */
drv = get_driver(dev->driver);
if (!drv)
return false;

read_unlock_irqrestore(&driver_name_lock, flags);
put_driver(drv);
/* lock to protect against change of current_driver_name */
read_lock_irqsave(&driver_name_lock, flags);

return ret;
ret = false;
if (drv->name &&
strncmp(current_driver_name, drv->name, NAME_MAX_LEN - 1) == 0) {
current_driver = drv;
ret = true;
}

return false;
read_unlock_irqrestore(&driver_name_lock, flags);
put_driver(drv);

return ret;
}

#define err_printk(dev, entry, format, arg...) do { \
Expand Down

0 comments on commit 586052d

Please sign in to comment.