5
Last change
on this file since a7e8996 was
a7e8996,
checked in by Sebastian Huber <sebastian.huber@…>, on 12/21/18 at 20:09:53
|
drvmgr: Improve LP64 compatibility
|
-
Property mode set to
100644
|
File size:
729 bytes
|
Rev | Line | |
---|
[e7fade3] | 1 | /* Find device by device name |
---|
| 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 | |
---|
| 11 | #include <string.h> |
---|
| 12 | #include <drvmgr/drvmgr.h> |
---|
| 13 | #include "drvmgr_internal.h" |
---|
| 14 | |
---|
[a7e8996] | 15 | static intptr_t dev_name_compare(struct drvmgr_dev *dev, void *arg) |
---|
[e7fade3] | 16 | { |
---|
| 17 | const char *name = arg; |
---|
| 18 | |
---|
| 19 | if (dev->name && (strcmp(dev->name, name) == 0)) |
---|
[a7e8996] | 20 | return (intptr_t)dev; |
---|
[e7fade3] | 21 | else |
---|
| 22 | return 0; |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | /* Get device by device name or bus name */ |
---|
| 26 | struct drvmgr_dev *drvmgr_dev_by_name(const char *name) |
---|
| 27 | { |
---|
| 28 | if (!name) |
---|
| 29 | return NULL; |
---|
| 30 | |
---|
| 31 | return (struct drvmgr_dev *) |
---|
| 32 | drvmgr_for_each_dev(dev_name_compare, (void *)name, 0); |
---|
| 33 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.