5
Rev | Line | |
---|
[9ea65119] | 1 | /* |
---|
| 2 | * AMBA Plug & Play routines |
---|
| 3 | * |
---|
| 4 | * COPYRIGHT (c) 2011 |
---|
| 5 | * Aeroflex Gaisler |
---|
| 6 | * |
---|
| 7 | * The license and distribution terms for this file may be |
---|
| 8 | * found in the file LICENSE in this distribution or at |
---|
[c499856] | 9 | * http://www.rtems.org/license/LICENSE. |
---|
[9ea65119] | 10 | */ |
---|
| 11 | |
---|
[31720925] | 12 | #include <grlib/ambapp.h> |
---|
[9ea65119] | 13 | |
---|
| 14 | /* Get bus depth a device is located at */ |
---|
| 15 | int ambapp_depth(struct ambapp_dev *dev) |
---|
| 16 | { |
---|
| 17 | int depth = 0; |
---|
| 18 | |
---|
| 19 | do { |
---|
| 20 | dev = ambapp_find_parent(dev); |
---|
| 21 | depth++; |
---|
| 22 | } while (dev); |
---|
| 23 | |
---|
| 24 | return depth - 1; |
---|
| 25 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.