net: rfkill: Check the return value of regulator_enable()
PATCH 1/1 net: rfkill: Check the return value of regulator_enable()
From: Fabio Estevam <[email protected]>
Fix the following build warning:
net/rfkill/rfkill-regulator.c:43:20: warning: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Wunused-result]
Signed-off-by Fabio Estevam <[email protected]>
--- net/rfkill/rfkill-regulator.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/rfkill/rfkill-regulator.c +4 -1
@@ -30,6 +30,7 @@ struct rfkill_regulator_data {static int rfkill_regulator_set_block (void *data,bool blocked) {struct rfkill_regulator_data *rfkill_data = data; +int ret;pr_debug ("%s: blocked: %d\n" , __func__, blocked);
@@ -40,7 +41,9 @@ static int rfkill_regulator_set_block(void *data, bool blocked) } }else {if (!rfkill_data->reg_enabled) { -regulator_enable (rfkill_data->vcc); + ret =regulator_enable (rfkill_data->vcc); +if (ret) +return ret; rfkill_data->reg_enabled = true; } }
Signature · 1 line
1.8.1.2
Johannes Berg
maintainerQuoted 3 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Fix the following build warning:
I already have a fix for this in my tree.
johannes