From c0841a279110baa31ae83b2e40d8d9274c97069f Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 20 Feb 2013 13:15:40 +1100 Subject: [PATCH] rtc-max77686-add-missing-variable-initialization-fix simplify code Cc: Chiwoong Byun Cc: Jingoo Han Cc: Jonghwa Lee Cc: Kyungmin Park Cc: Myugnjoo Ham Signed-off-by: Andrew Morton --- drivers/rtc/rtc-max77686.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c index fe6c5f4683ea..8ab56b00e693 100644 --- a/drivers/rtc/rtc-max77686.c +++ b/drivers/rtc/rtc-max77686.c @@ -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); -- 2.39.5