pxa2xx_spi: dma bugfixes
[pandora-kernel.git] / drivers / rtc / rtc-max6902.c
index 3e183cf..78b2551 100644 (file)
@@ -20,8 +20,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/version.h>
-
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/init.h>
@@ -89,13 +87,9 @@ static int max6902_get_reg(struct device *dev, unsigned char address,
 
        /* do the i/o */
        status = spi_sync(spi, &message);
-       if (status == 0)
-               status = message.status;
-       else
-               return status;
-
-       *data = chip->rx_buf[1];
 
+       if (status == 0)
+               *data = chip->rx_buf[1];
        return status;
 }
 
@@ -125,9 +119,7 @@ static int max6902_get_datetime(struct device *dev, struct rtc_time *dt)
 
        /* do the i/o */
        status = spi_sync(spi, &message);
-       if (status == 0)
-               status = message.status;
-       else
+       if (status)
                return status;
 
        /* The chip sends data in this order:
@@ -146,7 +138,7 @@ static int max6902_get_datetime(struct device *dev, struct rtc_time *dt)
        dt->tm_year -= 1900;
 
 #ifdef MAX6902_DEBUG
-       printk("\n%s : Read RTC values\n",__FUNCTION__);
+       printk("\n%s : Read RTC values\n",__func__);
        printk("tm_hour: %i\n",dt->tm_hour);
        printk("tm_min : %i\n",dt->tm_min);
        printk("tm_sec : %i\n",dt->tm_sec);
@@ -164,7 +156,7 @@ static int max6902_set_datetime(struct device *dev, struct rtc_time *dt)
        dt->tm_year = dt->tm_year+1900;
 
 #ifdef MAX6902_DEBUG
-       printk("\n%s : Setting RTC values\n",__FUNCTION__);
+       printk("\n%s : Setting RTC values\n",__func__);
        printk("tm_sec : %i\n",dt->tm_sec);
        printk("tm_min : %i\n",dt->tm_min);
        printk("tm_hour: %i\n",dt->tm_hour);