Browse Source

refine code

Signed-off-by: surenyi <surenyi82@163.com>
master
surenyi 2 weeks ago
parent
commit
a6cd0209c2
  1. 76
      vxbLfsLib.c

76
vxbLfsLib.c

@ -76,8 +76,50 @@ struct __lfs_drv_ctrl {
lfs_t fsh; 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; LOCAL int __lfs_driver_node = -1;
void lfsDevRegister(void)
{
(void)vxbDevRegister((struct vxbDevRegInfo *)&lfsDevDriver);
}
/* {{{ lfsDevFuncs */ /* {{{ lfsDevFuncs */
LOCAL void lfsDevInstInit(VXB_DEVICE_ID pDev) 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 */ /* {{{ 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) LOCAL lfsDrvCtrl * getLfsLowHandle(int unit)
{ {
VXB_DEVICE_ID pDev; VXB_DEVICE_ID pDev;

Loading…
Cancel
Save