!830 fix:modify Chip adaptation

Merge pull request !830 from 王有刚/master
This commit is contained in:
openharmony_ci
2022-03-25 11:36:11 +00:00
committed by Gitee
+11 -3
View File
@@ -339,16 +339,24 @@ static void ReleaseWlanDevice(struct HdfWlanDevice *device)
static struct HdfWlanDevice *ProbeDevice(struct HdfConfigWlanDevInst *deviceConfig)
{
if (deviceConfig == NULL) {
return NULL;
}
struct HdfWlanDevice *device = NULL;
int32_t ret;
if (deviceConfig == NULL) {
struct HdfConfigWlanChipList *tmpChipList = NULL;
struct HdfConfigWlanRoot *rootConfig = HdfWlanGetModuleConfigRoot();
if (rootConfig == NULL) {
HDF_LOGE("%s:ProbeDevice rootConfig NULL", __func__);
return NULL;
}
device = (struct HdfWlanDevice *)OsalMemCalloc(sizeof(struct HdfWlanDevice));
if (device == NULL) {
HDF_LOGE("%s:oom", __func__);
HDF_LOGE("%s:ProbeDevice device NULL", __func__);
return NULL;
}
tmpChipList = &rootConfig->wlanConfig.chipList;
do {
device->powers = HdfWlanCreatePowerManager(&deviceConfig->powers);
device->reset = HdfWlanCreateResetManager(&deviceConfig->reset, deviceConfig->bootUpTimeOut);
@@ -371,7 +379,7 @@ static struct HdfWlanDevice *ProbeDevice(struct HdfConfigWlanDevInst *deviceConf
ret = HDF_SUCCESS;
OsalMSleep(SLEEPTIME);
device->bus = NULL;
device->driverName = "hisi"; // from BDH6_DRIVER_NAME
device->driverName = tmpChipList->chipInst[0].driverName; // from BDH6_DRIVER_NAME
HDF_LOGW("Do not call GPIO and HdfWlanBusInit");
#endif