rtc: palmas: Initialise bb_charging flag before using it
authorLaxman Dewangan <ldewangan@nvidia.com>
Fri, 29 May 2015 12:14:05 +0000 (17:44 +0530)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Wed, 24 Jun 2015 23:13:40 +0000 (01:13 +0200)
Initialise the variable high_bb_charging before using it to avoid
configuring wrong value and fix following compilation warning:

/*
rtc-palmas.c: In function ‘palmas_rtc_probe’:
rtc-palmas.c:242:7: warning: ‘high_bb_charging’ may be used
uninitialized in this function
*/

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-palmas.c

index 3b01d567496daeb0e24e4168ccc1ee3cac6fa96a..7ea2c471feca3864a20612b9720e25314b5f5e77 100644 (file)
@@ -239,7 +239,7 @@ static int palmas_rtc_probe(struct platform_device *pdev)
        struct palmas_rtc *palmas_rtc = NULL;
        int ret;
        bool enable_bb_charging = false;
-       bool high_bb_charging;
+       bool high_bb_charging = false;
 
        if (pdev->dev.of_node) {
                enable_bb_charging = of_property_read_bool(pdev->dev.of_node,