From: Arnd Bergmann Date: Sat, 4 Aug 2012 06:20:49 +0000 (+0000) Subject: mfd/asic3: fix asic3_mfd_probe return value X-Git-Tag: next-20120816~111^2~2^2~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;ds=sidebyside;h=b2f0fa828ee7265028f1bca87928b0dc69663b53;p=karo-tx-linux.git 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 Cc: Paul Parsons Cc: Philipp Zabel Cc: Samuel Ortiz --- 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, goto out; } + ret = 0; if (pdata->leds) { int i;