From 3f043af06cdda9aa6772a84bf0e6e989c0f8a9cb Mon Sep 17 00:00:00 2001 From: libo Date: Mon, 16 Jul 2018 16:12:47 +0800 Subject: [PATCH] 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 --- drivers/amlogic/wifi/wifi_dt.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/amlogic/wifi/wifi_dt.c b/drivers/amlogic/wifi/wifi_dt.c index 98cd411662c8..304f491db272 100644 --- a/drivers/amlogic/wifi/wifi_dt.c +++ b/drivers/amlogic/wifi/wifi_dt.c @@ -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)