diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-08-04 02:20:49 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-08-08 15:13:00 -0400 |
commit | b2f0fa828ee7265028f1bca87928b0dc69663b53 (patch) | |
tree | 29632369130a3a622bd85447234a4ea163d008a2 /drivers/mfd/asic3.c | |
parent | 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff) |
mfd/asic3: fix asic3_mfd_probe return value
In commit 4f304245b "mfd: Set asic3 DS1WM clock_rate", a possible
path through asic3_mfd_probe was introduced that would lead to
an unpredictable return value, if everything succeeds but there
are pdata->leds is NULL. This was reported correctly by gcc.
Without this patch, building magician_defconfig results in:
drivers/mfd/asic3.c: In function 'asic3_mfd_probe':
drivers/mfd/asic3.c:940:2: warning: 'ret' may be used uninitialized in this function [-Wuninitialized]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Paul Parsons <lost.distance@yahoo.com>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/asic3.c')
-rw-r--r-- | drivers/mfd/asic3.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c index 383421bf5760..683e18a23329 100644 --- a/drivers/mfd/asic3.c +++ b/drivers/mfd/asic3.c | |||
@@ -925,6 +925,7 @@ static int __init asic3_mfd_probe(struct platform_device *pdev, | |||
925 | goto out; | 925 | goto out; |
926 | } | 926 | } |
927 | 927 | ||
928 | ret = 0; | ||
928 | if (pdata->leds) { | 929 | if (pdata->leds) { |
929 | int i; | 930 | int i; |
930 | 931 | ||