diff mbox

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

Message ID 1376775367-17068-1-git-send-email-festevam@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Fabio Estevam Aug. 17, 2013, 9:36 p.m. UTC
From: Fabio Estevam <fabio.estevam@freescale.com>

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 <fabio.estevam@freescale.com>
---
 net/rfkill/rfkill-regulator.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Johannes Berg Aug. 19, 2013, 10:28 a.m. UTC | #1
On Sat, 2013-08-17 at 18:36 -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Fix the following build warning:

I already have a fix for this in my tree.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/rfkill/rfkill-regulator.c b/net/rfkill/rfkill-regulator.c
index d11ac79..0aa922c 100644
--- a/net/rfkill/rfkill-regulator.c
+++ b/net/rfkill/rfkill-regulator.c
@@ -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;
 		}
 	}