fix resources dev linklist init error from Liu Weichao

it is fit
This commit is contained in:
xuedongliang 2021-04-29 15:24:26 +08:00
commit c4280d9488
13 changed files with 25 additions and 25 deletions

View File

@ -59,7 +59,7 @@ int CanDeviceRegister(struct CanHardwareDevice *can_device, void *can_param, con
x_err_t ret = EOK;
static x_bool dev_link_flag = RET_FALSE;
if (dev_link_flag) {
if (!dev_link_flag) {
CanDeviceLinkInit();
dev_link_flag = RET_TRUE;
}

View File

@ -103,7 +103,7 @@ int I2cDeviceRegister(struct I2cHardwareDevice *i2c_device, void *i2c_param, con
x_err_t ret = EOK;
static x_bool dev_link_flag = RET_FALSE;
if (dev_link_flag) {
if (!dev_link_flag) {
I2cDeviceLinkInit();
dev_link_flag = RET_TRUE;
}

View File

@ -55,11 +55,11 @@ int PinDeviceRegister(struct PinHardwareDevice *pin_device, void *pin_param, con
NULL_PARAM_CHECK(device_name);
x_err_t ret = EOK;
static x_bool DevLinkFlag = RET_FALSE;
static x_bool dev_link_flag = RET_FALSE;
if (DevLinkFlag) {
if (!dev_link_flag) {
PinDeviceLinkInit();
DevLinkFlag = RET_TRUE;
dev_link_flag = RET_TRUE;
}
if (DEV_INSTALL != pin_device->haldev.dev_state) {

View File

@ -54,11 +54,11 @@ int PinDriverRegister(struct Driver *driver)
NULL_PARAM_CHECK(driver);
x_err_t ret = EOK;
static x_bool DriverLinkFlag = RET_FALSE;
static x_bool driver_link_flag = RET_FALSE;
if (!DriverLinkFlag) {
if (!driver_link_flag) {
PinDrvLinkInit();
DriverLinkFlag = RET_TRUE;
driver_link_flag = RET_TRUE;
}
DoubleLinkListInsertNodeAfter(&pindrv_linklist, &(driver->driver_link));

View File

@ -57,7 +57,7 @@ int RtcDeviceRegister(struct RtcHardwareDevice *rtc_device, void *rtc_param, con
x_err_t ret = EOK;
static x_bool dev_link_flag = RET_FALSE;
if (dev_link_flag) {
if (!dev_link_flag) {
RtcDeviceLinkInit();
dev_link_flag = RET_TRUE;
}

View File

@ -55,11 +55,11 @@ int SdioDeviceRegister(struct SdioHardwareDevice *sdio_device, const char *devic
NULL_PARAM_CHECK(device_name);
x_err_t ret = EOK;
static x_bool DevLinkFlag = RET_FALSE;
static x_bool dev_link_flag = RET_FALSE;
if (DevLinkFlag) {
if (!dev_link_flag) {
SdioDeviceLinkInit();
DevLinkFlag = RET_TRUE;
dev_link_flag = RET_TRUE;
}
if (DEV_INSTALL != sdio_device->haldev.dev_state) {

View File

@ -54,11 +54,11 @@ int SdioDriverRegister(struct Driver *driver)
NULL_PARAM_CHECK(driver);
x_err_t ret = EOK;
static x_bool DriverLinkFlag = RET_FALSE;
static x_bool driver_link_flag = RET_FALSE;
if (!DriverLinkFlag) {
if (!driver_link_flag) {
SdioDrvLinkInit();
DriverLinkFlag = RET_TRUE;
driver_link_flag = RET_TRUE;
}
DoubleLinkListInsertNodeAfter(&sdiodrv_linklist, &(driver->driver_link));

View File

@ -812,7 +812,7 @@ int SerialDeviceRegister(struct SerialHardwareDevice *serial_device, void *seria
x_err_t ret = EOK;
static x_bool dev_link_flag = RET_FALSE;
if (dev_link_flag) {
if (!dev_link_flag) {
SerialDeviceLinkInit();
dev_link_flag = RET_TRUE;
}

View File

@ -119,7 +119,7 @@ int SpiDeviceRegister(struct SpiHardwareDevice *spi_device, void *spi_param, con
x_err_t ret = EOK;
static x_bool dev_link_flag = RET_FALSE;
if (dev_link_flag) {
if (!dev_link_flag) {
SpiDeviceLinkInit();
dev_link_flag = RET_TRUE;
}

View File

@ -57,7 +57,7 @@ int HwtimerDeviceRegister(struct HwtimerHardwareDevice *hwtimer_device, void *hw
x_err_t ret = EOK;
static x_bool dev_link_flag = RET_FALSE;
if (dev_link_flag) {
if (!dev_link_flag) {
HwtimerDeviceLinkInit();
dev_link_flag = RET_TRUE;
}

View File

@ -59,7 +59,7 @@ int USBDeviceRegister(struct UsbHardwareDevice *usb_device, void *usb_param, con
x_err_t ret = EOK;
static x_bool dev_link_flag = RET_FALSE;
if (dev_link_flag) {
if (!dev_link_flag) {
USBDeviceLinkInit();
dev_link_flag = RET_TRUE;
}

View File

@ -55,11 +55,11 @@ int WdtDeviceRegister(struct WdtHardwareDevice *wdt_device, const char *device_n
NULL_PARAM_CHECK(device_name);
x_err_t ret = EOK;
static x_bool DevLinkFlag = RET_FALSE;
static x_bool dev_link_flag = RET_FALSE;
if (DevLinkFlag) {
if (!dev_link_flag) {
WdtDeviceLinkInit();
DevLinkFlag = RET_TRUE;
dev_link_flag = RET_TRUE;
}
if (DEV_INSTALL != wdt_device->haldev.dev_state) {

View File

@ -54,11 +54,11 @@ int WdtDriverRegister(struct Driver *driver)
NULL_PARAM_CHECK(driver);
x_err_t ret = EOK;
static x_bool DriverLinkFlag = RET_FALSE;
static x_bool driver_link_flag = RET_FALSE;
if (!DriverLinkFlag) {
if (!driver_link_flag) {
WdtDrvLinkInit();
DriverLinkFlag = RET_TRUE;
driver_link_flag = RET_TRUE;
}
DoubleLinkListInsertNodeAfter(&wdtdrv_linklist, &(driver->driver_link));