wifi: meson: fix kernel panic when dts not config wifi pwms

PD#168480: wifi: fix kernel panic when dts not config wifi pwms

Change-Id: I8907ec9f131034fbbe113e74ff3a760b6b8169e1
Signed-off-by: libo <bo.li@amlogic.com>
This commit is contained in:
libo
2018-07-16 16:12:47 +08:00
committed by Yixun Lan
parent 2b4bba619e
commit 3f043af06c

View File

@@ -491,6 +491,7 @@ int pwm_double_channel_conf_dt(struct wifi_plat_info *plat)
ret = of_property_read_u32(wifinode, "pwm_config", &pwm_phandle);
if (ret) {
pr_err("not match wifi_pwm_config node\n");
return -1;
} else {
pnode = of_find_node_by_phandle(pwm_phandle);
if (!pnode) {
@@ -656,11 +657,13 @@ static int wifi_dev_probe(struct platform_device *pdev)
if (get_cpu_type() >= MESON_CPU_MAJOR_ID_GXTVBB) {
ret = pwm_double_channel_conf_dt(plat);
if (ret != 0)
if (ret != 0) {
WIFI_INFO("pwm_double_channel_conf_dt error\n");
ret = pwm_double_channel_conf(plat);
if (ret != 0)
WIFI_INFO("pwm_double_channel_conf error\n");
} else {
ret = pwm_double_channel_conf(plat);
if (ret != 0)
WIFI_INFO("pwm_double_channel_conf error\n");
}
} else if (get_cpu_type() == MESON_CPU_MAJOR_ID_GXBB) {
ret = pwm_single_channel_conf(plat);
if (ret)