5
Last change
on this file since 7075fb11 was
bb2f220,
checked in by Daniel Hellstrom <daniel@…>, on 04/13/15 at 08:49:47
|
DRVMGR: renamed private drv_mgr and its struct name
|
-
Property mode set to
100644
|
File size:
737 bytes
|
Rev | Line | |
---|
[e7fade3] | 1 | /* Find driver by driver-ID |
---|
| 2 | * |
---|
[65d1f35] | 3 | * COPYRIGHT (c) 2011 Cobham Gaisler AB. |
---|
[e7fade3] | 4 | * |
---|
| 5 | * The license and distribution terms for this file may be |
---|
| 6 | * found in the file LICENSE in this distribution or at |
---|
[0decc806] | 7 | * http://www.rtems.org/license/LICENSE. |
---|
[e7fade3] | 8 | */ |
---|
| 9 | |
---|
| 10 | #include <drvmgr/drvmgr.h> |
---|
| 11 | #include "drvmgr_internal.h" |
---|
| 12 | |
---|
| 13 | /* Get driver from driver name */ |
---|
| 14 | struct drvmgr_drv *drvmgr_drv_by_id(uint64_t id) |
---|
| 15 | { |
---|
[bb2f220] | 16 | struct drvmgr *mgr = &drvmgr; |
---|
[e7fade3] | 17 | struct drvmgr_drv *drv = NULL; |
---|
| 18 | |
---|
| 19 | /* NOTE: No locking is needed here since Driver list is supposed to be |
---|
| 20 | * initialized once during startup, we treat it as a static |
---|
| 21 | * read-only list |
---|
| 22 | */ |
---|
| 23 | |
---|
| 24 | drv = DRV_LIST_HEAD(&mgr->drivers); |
---|
| 25 | while (drv) { |
---|
| 26 | if (drv->drv_id == id) |
---|
| 27 | break; |
---|
| 28 | drv = drv->next; |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | return drv; |
---|
| 32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.