Skip to contentSkip to conversation

net: rfkill: Check the return value of regulator_enable()

PATCH In review Fabio Estevam 2 participants 2 messages Aug 17, 2013 – Aug 19, 2013 Rfkill

lore
Share & tools
lore
#0 lore raw

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]

---
 net/rfkill/rfkill-regulator.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/rfkill/rfkill-regulator.c +4 -1
index d11ac79..0aa922c 100644
@@ -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
maintainer
#1 lore raw
Quoted 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