lkml.org 
[lkml]   [2011]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] rtc: ds1307: generalise ram size and offset
On Thu, Nov 03, 2011 at 09:59:15AM +1300, Austin Boyle wrote:
> From: Austin Boyle <Austin.Boyle@aviatnet.com>
>
> This patch generalises NVRAM to support RAM with other size and offset, such
> as the 64 bytes of SRAM on the MCP7941x.
>
> Cc: Wolfram Sang <w.sang@pengutronix.de>
> Cc: David Anderson <danders.dev@gmail.com>
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> Signed-off-by: Austin Boyle <Austin.Boyle@aviatnet.com>

Looks good to me in general, with one exception.

> ---
> this patch is based on Wolfram Sang's tree:
> git://git.pengutronix.de/git/wsa/linux-2.6.git ds1307
>
> patch depends on:
> rtc: ds1307: comment and format cleanup 21af5f7bd6
> rtc: ds1307: simplify irq setup code 8c63e03627
> rtc: ds1307: refactor chip_desc table e246db081d
> rtc: add initial support for mcp7941x parts e69bba2d3a
>
> --- a/drivers/rtc/rtc-ds1307.c 2011-10-10 11:22:22.674690998 +1300
> +++ b/drivers/rtc/rtc-ds1307.c 2011-11-03 09:13:06.662159569 +1300
> @@ -104,10 +104,12 @@ enum ds_type {
>
> struct ds1307 {
> u8 offset; /* register's offset */
> + u16 ram_offset;
> + u16 ram_size;
> u8 regs[11];
> enum ds_type type;
> unsigned long flags;
> -#define HAS_NVRAM 0 /* bit 0 == sysfs file active */
> +#define HAS_RAM 0 /* bit 0 == sysfs file active */

Why the rename from NVRAM to RAM everywhere? While it doesn't matter much for
most occurences...

> -static struct bin_attribute nvram = {
> +static struct bin_attribute ram = {
> .attr = {
> - .name = "nvram",
> + .name = "ram",
> .mode = S_IRUGO | S_IWUSR,
> },

... here it will break userspace.

Regards,

Wolfram

--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2011-11-03 00:09    [W:0.025 / U:0.604 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site