From c0a95fe38f21504bf3d4d0425e36cb086019d618 Mon Sep 17 00:00:00 2001 From: Ziyuan Xu Date: Sat, 16 Jan 2021 14:11:25 +0800 Subject: [PATCH] net: rfkill-wlan: fixes WARN if WIFI,poweren_gpio is not assigned Change-Id: I85cf17f0b7efd95eb515a2708497dd17f15337b2 Signed-off-by: Ziyuan Xu --- net/rfkill/rfkill-wlan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/rfkill/rfkill-wlan.c b/net/rfkill/rfkill-wlan.c index a4e326e9b342..6a581c847a68 100644 --- a/net/rfkill/rfkill-wlan.c +++ b/net/rfkill/rfkill-wlan.c @@ -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))