lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1427198883-6577-2-git-send-email-mpa@pengutronix.de>
Date:	Tue, 24 Mar 2015 13:08:03 +0100
From:	Markus Pargmann <mpa@...gutronix.de>
To:	Mark Brown <broonie@...nel.org>
Cc:	Liam Girdwood <lgirdwood@...il.com>,
	Wolfram Sang <wsa@...-dreams.de>, kernel@...gutronix.de,
	linux-kernel@...r.kernel.org, Markus Pargmann <mpa@...gutronix.de>
Subject: [PATCH 2/2] regulator: max8660: Add error message for missing regulator data

The driver probe fails when there is a subdevice without platform_data.
Add a error message so it is clear what failed.

Signed-off-by: Markus Pargmann <mpa@...gutronix.de>
---
 drivers/regulator/max8660.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
index 32cf277a7662..b1ba1d09e064 100644
--- a/drivers/regulator/max8660.c
+++ b/drivers/regulator/max8660.c
@@ -441,8 +441,10 @@ static int max8660_probe(struct i2c_client *client,
 		max8660->shadow_regs[MAX8660_MDTV2] = 0x04;
 
 	for (i = 0; i < pdata->num_subdevs; i++) {
-		if (!pdata->subdevs[i].platform_data)
+		if (!pdata->subdevs[i].platform_data) {
+			dev_err(dev, "No data for %d regulator\n", i);
 			return -EINVAL;
+		}
 
 		switch (pdata->subdevs[i].id) {
 		case MAX8660_V3:
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ