net: rfkill-wlan: fixes WARN if WIFI,poweren_gpio is not assigned

Change-Id: I85cf17f0b7efd95eb515a2708497dd17f15337b2
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
This commit is contained in:
Ziyuan Xu
2021-01-16 14:11:25 +08:00
committed by Tao Huang
parent 1afd77fecc
commit c0a95fe38f

View File

@@ -872,7 +872,8 @@ static int rfkill_wlan_probe(struct platform_device *pdev)
rfkill_set_wifi_bt_power(1);
#ifdef CONFIG_SDIO_KEEPALIVE
if (primary_sdio_host && primary_sdio_host->support_chip_alive)
if (gpio_is_valid(pdata->power_n.io) &&
primary_sdio_host && primary_sdio_host->support_chip_alive)
gpio_direction_output(pdata->power_n.io, pdata->power_n.enable);
#else
if (gpio_is_valid(pdata->power_n.io))