Re: [PATCH] rtc: ds1307: generalise ram size and offset

From: Wolfram Sang
Date: Wed Nov 02 2011 - 19:07:01 EST


On Thu, Nov 03, 2011 at 09:59:15AM +1300, Austin Boyle wrote:
> From: Austin Boyle <Austin.Boyle@xxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxxxx>
> Cc: David Anderson <danders.dev@xxxxxxxxx>
> Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx>
> Cc: Joakim Tjernlund <Joakim.Tjernlund@xxxxxxxxxxxx>
> Signed-off-by: Austin Boyle <Austin.Boyle@xxxxxxxxxxxx>

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/ |

Attachment: signature.asc
Description: Digital signature