Skip to contentSkip to conversation

mfd: max8997: Return proper error if pdata is NULL

PATCH Superseded Axel Lin 1 participant 1 message Feb 6, 2013 Multifunction devices (MFD)

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mfd: max8997: Return proper error if pdata is NULL

Return proper error instead of 0 if pdata is NULL.

---
 drivers/mfd/max8997.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mfd/max8997.c +3 -1
index 1471405..823f34b 100644
@@ -209,8 +209,10 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
 		}
 	}
 
-	if (!pdata)
+	if (!pdata) {
+		ret = -EINVAL;
 		goto err;
+	}
 
 	max8997->pdata = pdata;
 	max8997->ono = pdata->ono;
Signature · 1 line
1.7.9.5