mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 04:04:26 +08:00
net: rfkill: gpio: Add check for clk_enable()
Add check for the return value of clk_enable() to catch the potential
error.
Fixes: 7176ba23f8
("net: rfkill: add generic gpio rfkill driver")
Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Link: https://patch.msgid.link/20241108195341.1853080-1-zmw12306@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
857282b819
commit
8251e7621b
@ -32,8 +32,12 @@ static int rfkill_gpio_set_power(void *data, bool blocked)
|
||||
{
|
||||
struct rfkill_gpio_data *rfkill = data;
|
||||
|
||||
if (!blocked && !IS_ERR(rfkill->clk) && !rfkill->clk_enabled)
|
||||
clk_enable(rfkill->clk);
|
||||
if (!blocked && !IS_ERR(rfkill->clk) && !rfkill->clk_enabled) {
|
||||
int ret = clk_enable(rfkill->clk);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
gpiod_set_value_cansleep(rfkill->shutdown_gpio, !blocked);
|
||||
gpiod_set_value_cansleep(rfkill->reset_gpio, !blocked);
|
||||
|
Loading…
Reference in New Issue
Block a user