[PATCH 2/2] regulator: max8660: Add error message for missing regulator data
From: Markus Pargmann
Date: Tue Mar 24 2015 - 08:08:42 EST
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@xxxxxxxxxxxxxx>
---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/