]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/rtc/rtc-max6902.c
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
[linux-2.6-omap-h63xx.git] / drivers / rtc / rtc-max6902.c
index 2f0b7772419276cd8f1f8b0bb7157973ecce0574..1f956dc5d56eeb57806bb66b471422ae5734ad37 100644 (file)
  *
  * 24-May-2006: Raphael Assenat <raph@8d.com>
  *                - Major rework
- *                             Converted to rtc_device and uses the SPI layer.
+ *                             Converted to rtc_device and uses the SPI layer.
  *
  * ??-???-2005: Someone at Compulab
  *                - Initial driver creation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/version.h>
 
@@ -90,13 +89,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;
 }
 
@@ -126,9 +121,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:
@@ -137,7 +130,7 @@ static int max6902_get_datetime(struct device *dev, struct rtc_time *dt)
        dt->tm_min      = BCD2BIN(chip->buf[2]);
        dt->tm_hour     = BCD2BIN(chip->buf[3]);
        dt->tm_mday     = BCD2BIN(chip->buf[4]);
-       dt->tm_mon      = BCD2BIN(chip->buf[5] - 1);
+       dt->tm_mon      = BCD2BIN(chip->buf[5]) - 1;
        dt->tm_wday     = BCD2BIN(chip->buf[6]);
        dt->tm_year = BCD2BIN(chip->buf[7]);
 
@@ -260,11 +253,11 @@ static int __devexit max6902_remove(struct spi_device *spi)
 
 static struct spi_driver max6902_driver = {
        .driver = {
-               .name   = "max6902",
+               .name   = "rtc-max6902",
                .bus    = &spi_bus_type,
                .owner  = THIS_MODULE,
        },
-       .probe  = max6902_probe,
+       .probe  = max6902_probe,
        .remove = __devexit_p(max6902_remove),
 };