From 3663be53521e29981f3617ef99c7f8e3cec7036d Mon Sep 17 00:00:00 2001 From: Daniel Hellstrom Date: Thu, 24 Aug 2017 17:23:23 +0200 Subject: drvmgr: clean up info_drv print Fixes #2930 --- cpukit/libdrvmgr/drvmgr_print.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'cpukit/libdrvmgr') 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? */ -- cgit v1.2.3