diff --git a/vxbLfsLib.c b/vxbLfsLib.c index a3c8187..3fb8ec8 100644 --- a/vxbLfsLib.c +++ b/vxbLfsLib.c @@ -76,8 +76,50 @@ struct __lfs_drv_ctrl { lfs_t fsh; }; +/* {{{ vxBus methods */ +LOCAL void lfsDevInstInit(VXB_DEVICE_ID pDev); +LOCAL void lfsDevInstInit2(VXB_DEVICE_ID pDev); +LOCAL void lfsDevInstConnect(VXB_DEVICE_ID pDev); +LOCAL void lfsDevShow(VXB_DEVICE_ID pDev, int verbose); +LOCAL STATUS lfsDevInstUnlink(VXB_DEVICE_ID pDev, void *unused); +/* }}} */ + +/* Publish the methods for the resources controlled with this file */ +/* clang-format off */ +LOCAL struct drvBusFuncs lfsDevFuncs = { + lfsDevInstInit, /* devInstanceInit */ + lfsDevInstInit2, /* devInstanceInit2 */ + lfsDevInstConnect /* devConnect */ +}; +LOCAL struct vxbDeviceMethod lfsDevMethods[] = { + DEVMETHOD(busDevShow , lfsDevShow), + DEVMETHOD(vxbDrvUnlink, lfsDevInstUnlink), + { 0, 0 } +}; + +LOCAL struct vxbSpiRegister lfsDevDriver = { + { + NULL, /* pNext */ + VXB_DEVID_DEVICE, /* devID */ + VXB_BUSID_PLB, /* busID */ + VXBUS_VERSION_5, /* vxbVersion */ + LFS_NAME, /* drvName */ + &lfsDevFuncs, /* pDrvBusFuncs */ + lfsDevMethods, /* pMethods */ + NULL, /* devProbe */ + NULL, /* pParamDefaults */ + }, +}; +/* clang-format on */ + LOCAL int __lfs_driver_node = -1; + +void lfsDevRegister(void) +{ + (void)vxbDevRegister((struct vxbDevRegInfo *)&lfsDevDriver); +} + /* {{{ lfsDevFuncs */ LOCAL void lfsDevInstInit(VXB_DEVICE_ID pDev) { @@ -509,12 +551,6 @@ LOCAL void lfsDevInstConnect(VXB_DEVICE_ID pDev) } } } - -LOCAL struct drvBusFuncs lfsDevFuncs = { - lfsDevInstInit, /* devInstanceInit */ - lfsDevInstInit2, /* devInstanceInit2 */ - lfsDevInstConnect /* devConnect */ -}; /* }}} */ /* {{{ lfsMethods */ @@ -556,34 +592,6 @@ LOCAL STATUS lfsDevInstUnlink(VXB_DEVICE_ID pDev, void *unused) } /* }}} */ -/* Publish the methods for the resources controlled with this file */ -/* clang-format off */ -LOCAL struct vxbDeviceMethod lfsDevMethods[] = { - DEVMETHOD(busDevShow , lfsDevShow), - DEVMETHOD(vxbDrvUnlink, lfsDevInstUnlink), - { 0, 0 } -}; - -LOCAL struct vxbSpiRegister lfsDevDriver = { - { - NULL, /* pNext */ - VXB_DEVID_DEVICE, /* devID */ - VXB_BUSID_PLB, /* busID */ - VXBUS_VERSION_5, /* vxbVersion */ - LFS_NAME, /* drvName */ - &lfsDevFuncs, /* pDrvBusFuncs */ - lfsDevMethods, /* pMethods */ - NULL, /* devProbe */ - NULL, /* pParamDefaults */ - }, -}; -/* clang-format on */ - -void lfsDevRegister(void) -{ - (void)vxbDevRegister((struct vxbDevRegInfo *)&lfsDevDriver); -} - LOCAL lfsDrvCtrl * getLfsLowHandle(int unit) { VXB_DEVICE_ID pDev;