Commit 01e18699 authored by Felipe Balbi's avatar Felipe Balbi Committed by Tony Lindgren

I2C: TWL4030: checkpatch.pl fixes to rtc-twl4030.c

Misc cleanup patch.
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent bff9e9c9
......@@ -36,12 +36,12 @@
#include <linux/device.h>
#include <linux/i2c/twl4030.h>
#include <linux/i2c/twl4030-rtc.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <asm/io.h>
#include <asm/mach/time.h>
#include <asm/system.h>
#include <asm/hardware.h>
#include <asm/irq.h>
#define ALL_TIME_REGS 6
......@@ -54,7 +54,7 @@ static int epoch = 1900; /* year corresponding to 0x00 */
/*
* Supports 1 byte read from TWL4030 RTC register.
*/
static int twl4030_rtc_read_u8(u8 * data, u8 reg)
static int twl4030_rtc_read_u8(u8 *data, u8 reg)
{
int ret;
......@@ -182,7 +182,8 @@ static int get_rtc_time(struct rtc_time *rtc_tm)
* Account for differences between how the RTC uses the values
* and how they are defined in a struct rtc_time;
*/
if ((rtc_tm->tm_year += (epoch - 1900)) <= 69)
rtc_tm->tm_year += (epoch - 1900);
if (rtc_tm->tm_year <= 69)
rtc_tm->tm_year += 100;
rtc_tm->tm_mon--;
......@@ -258,7 +259,8 @@ static int get_rtc_alm_time(struct rtc_time *alm_tm)
* Account for differences between how the RTC uses the values
* and how they are defined in a struct rtc_time;
*/
if ((alm_tm->tm_year += (epoch - 1900)) <= 69)
alm_tm->tm_year += (epoch - 1900);
if (alm_tm->tm_year <= 69)
alm_tm->tm_year += 100;
alm_tm->tm_mon--;
......@@ -450,7 +452,8 @@ static irqreturn_t twl4030_rtc_interrupt(int irq, void *rtc)
* RTC event generates 2 interrupts in a row.
* (no errata document available)
*/
res = twl4030_i2c_write_u8(TWL4030_MODULE_INT, PWR_RTC_INT_CLR, REG_PWR_ISR1);
res = twl4030_i2c_write_u8(TWL4030_MODULE_INT,
PWR_RTC_INT_CLR, REG_PWR_ISR1);
if (res)
goto out;
......@@ -600,7 +603,7 @@ static void twl4030_rtc_shutdown(struct platform_device *pdev)
#ifdef CONFIG_PM
static unsigned char irqstat = 0;
static unsigned char irqstat;
static int twl4030_rtc_suspend(struct platform_device *pdev, pm_message_t state)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment