diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2017-08-24 17:23:23 +0200 |
---|---|---|
committer | Daniel Hellstrom <daniel@gaisler.com> | 2017-08-29 08:44:13 +0200 |
commit | 3663be53521e29981f3617ef99c7f8e3cec7036d (patch) | |
tree | dabf9c87d5da54f1790d555b60973ba7dd127e1e | |
parent | leon,ambapp_bus: make unreferenced global function static (diff) | |
download | rtems-3663be53521e29981f3617ef99c7f8e3cec7036d.tar.bz2 |
drvmgr: clean up info_drv print
Fixes #2930
-rw-r--r-- | cpukit/libdrvmgr/drvmgr_print.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/cpukit/libdrvmgr/drvmgr_print.c b/cpukit/libdrvmgr/drvmgr_print.c index 2b7a2e538e..f53d87f18f 100644 --- a/cpukit/libdrvmgr/drvmgr_print.c +++ b/cpukit/libdrvmgr/drvmgr_print.c @@ -334,19 +334,9 @@ void drvmgr_info_bus(struct drvmgr_bus *bus, unsigned int options) } } -char *drv_ops_names[DRVMGR_OPS_NUM(struct drvmgr_drv_ops)] = { - "init[1]:", - "init[2]:", - "init[3]:", - "init[4]:", - "remove: ", - "info: " -}; - void drvmgr_info_drv(struct drvmgr_drv *drv, unsigned int options) { struct drvmgr_dev *dev; - fun_ptr *ppfunc; int i; /* Print Driver */ @@ -355,9 +345,10 @@ void drvmgr_info_drv(struct drvmgr_drv *drv, unsigned int options) printf(" NAME: %s\n", drv->name ? drv->name : "NO_NAME"); printf(" BUS TYPE: %d\n", drv->bus_type); printf(" OPERATIONS:\n"); - for (i = 0, ppfunc = (fun_ptr *)&drv->ops->init[0]; - i < DRVMGR_OPS_NUM(struct drvmgr_drv_ops); i++) - printf(" %s %p\n", drv_ops_names[i], ppfunc[i]); + for (i = 0; i < DRVMGR_LEVEL_MAX; i++) + printf(" init[%d]: %p\n", i + 1, drv->ops->init[i]); + printf(" remove: %p\n", drv->ops->remove); + printf(" info: %p\n", drv->ops->info); printf(" NO. DEVICES: %d\n", drv->dev_cnt); /* Print devices united with this driver? */ |