[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <200811101449.17972.david-b@pacbell.net>
Date: Mon, 10 Nov 2008 14:49:17 -0800
From: David Brownell <david-b@...bell.net>
To: Mark Jackson <mpfj@...c.co.uk>
Cc: dbrownell@...rs.sourceforge.net,
lkml <linux-kernel@...r.kernel.org>,
Alessandro Zummo <alessandro.zummo@...ertech.it>,
rtc-linux@...glegroups.com, spi-devel-general@...ts.sourceforge.net
Subject: Re: [PATCH v6] Add Dallas DS1390/93/94 RTC chips
On Thursday 06 November 2008, Mark Jackson wrote:
> v6 (!!) of this patch with even more code tidying as per previous comments.
> Also only a single tx/rx buffer is used.
> Now uses spi_write_then_read()
> Comments changed to include extra chips in the family
>
> This patch adds support for the Dallas DS1390/93/94 SPI RTC chip.
>
> Signed-off-by: Mark Jackson <mpfj@...c.co.uk>
Acked-by: David Brownell <dbrownell@...rs.sourceforge.net>
Although I wouldn't bother using the "wday" field at all.
Linux doesn't use that field, so trying to maintain it isn't
useful ... though it probably doesn't hurt, assuming the
chip behaves OK when invalid data is written there.
Also, in probe():
> + printk(KERN_INFO "DS1390 SPI RTC driver\n");
I dislike those banners in general. Best to remove that,
since the RTC framework announces the registration. Or
at least, dev_info().
> + spi->mode = SPI_MODE_3;
> + spi->bits_per_word = 8;
> + spi_setup(spi);
Unlikely to fail ... but
res = spi_setup(spi);
if (res < 0) {
/* or do it before the kzalloc, no kfree
* ... likewise with reading the register
* as an "is it there" check: do it earlier
* and get a similar minor codeshrink.
*/
kfree(chip);
return res;
}
> +
> + dev_set_drvdata(&spi->dev, chip);
> +
> + res = ds1390_get_reg(&spi->dev, DS1390_REG_SECONDS, &tmp);
> + if (res) {
> + dev_err(&spi->dev, "DS1390: unable to read device\n");
> + kfree(chip);
> + return res;
> + }
> +
> + rtc = rtc_device_register("ds1390",
> + &spi->dev, &ds1390_rtc_ops, THIS_MODULE);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists