From: Andrew Morton Date: Wed, 20 Feb 2013 02:15:40 +0000 (+1100) Subject: rtc-max77686-add-missing-variable-initialization-fix X-Git-Tag: next-20130220~1^2~270 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c0841a279110baa31ae83b2e40d8d9274c97069f;p=karo-tx-linux.git 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 --- 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);