mfd/asic3: fix asic3_mfd_probe return value
authorArnd Bergmann <[email protected]>
Sat, 4 Aug 2012 06:20:49 +0000 (06:20 +0000)
committerArnd Bergmann <[email protected]>
Wed, 8 Aug 2012 19:13:00 +0000 (21:13 +0200)
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 <[email protected]>
Cc: Paul Parsons <[email protected]>
Cc: Philipp Zabel <[email protected]>
Cc: Samuel Ortiz <[email protected]>
drivers/mfd/asic3.c

index 383421bf57609a994b7f8d537f97c269d2ab6302..683e18a23329802875d03f92d53e354a6474ad9d 100644 (file)
@@ -925,6 +925,7 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,
                        goto out;
        }
 
+       ret = 0;
        if (pdata->leds) {
                int i;