lkml.org 
[lkml]   [2013]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH RESEND] mfd: max8997: Return proper error if pdata is NULL
From
Date
Return proper error instead of 0 if pdata is NULL.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/mfd/max8997.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index 1471405..823f34b 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -209,8 +209,10 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
}
}

- if (!pdata)
+ if (!pdata) {
+ ret = -ENOMEM;
goto err;
+ }

max8997->pdata = pdata;
max8997->ono = pdata->ono;
--
1.7.9.5




\
 
 \ /
  Last update: 2013-04-13 16:21    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog