Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
[linux-2.6-microblaze.git] / drivers / rtc / rtc-ds1343.c
index d21004a..ba14342 100644 (file)
@@ -75,7 +75,6 @@ static const struct spi_device_id ds1343_id[] = {
 MODULE_DEVICE_TABLE(spi, ds1343_id);
 
 struct ds1343_priv {
-       struct spi_device *spi;
        struct rtc_device *rtc;
        struct regmap *map;
        int irq;
@@ -362,12 +361,13 @@ static int ds1343_probe(struct spi_device *spi)
        if (!priv)
                return -ENOMEM;
 
-       priv->spi = spi;
-
        /* RTC DS1347 works in spi mode 3 and
-        * its chip select is active high
+        * its chip select is active high. Active high should be defined as
+        * "inverse polarity" as GPIO-based chip selects can be logically
+        * active high but inverted by the GPIO library.
         */
-       spi->mode = SPI_MODE_3 | SPI_CS_HIGH;
+       spi->mode |= SPI_MODE_3;
+       spi->mode ^= SPI_CS_HIGH;
        spi->bits_per_word = 8;
        res = spi_setup(spi);
        if (res)