]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rtc-max77686-add-missing-variable-initialization-fix
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 20 Feb 2013 02:15:40 +0000 (13:15 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:53:23 +0000 (16:53 +1100)
simplify code

Cc: Chiwoong Byun <woong.byun@samsung.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Jonghwa Lee <jonghwa3.lee@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Myugnjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/rtc/rtc-max77686.c

index fe6c5f4683eaa6d89c73c2bd6e6aef9575328df0..8ab56b00e6930101a224eb3afa26aa71beceb47b 100644 (file)
@@ -133,16 +133,12 @@ static int max77686_rtc_update(struct max77686_rtc_info *info,
        enum MAX77686_RTC_OP op)
 {
        int ret;
-       unsigned int data = 0;
+       unsigned int data;
 
-       switch (op) {
-       case MAX77686_RTC_WRITE:
+       if (op == MAX77686_RTC_WRITE)
                data = 1 << RTC_UDR_SHIFT;
-               break;
-       case MAX77686_RTC_READ:
+       else
                data = 1 << RTC_RBUDR_SHIFT;
-               break;
-       }
 
        ret = regmap_update_bits(info->max77686->rtc_regmap,
                                 MAX77686_RTC_UPDATE0, data, data);