Messages in this thread | | | Date | Tue, 7 Feb 2012 15:56:52 +0100 | From | Wolfram Sang <> | Subject | Re: [PATCH v3] rtc: ds1307: generalise ram size and offset |
| |
> So if you have multiple RTCs, even of the same type, they would be in > rtc0, rtc1, rtc2 > > Since they each have their own nvram, does it matter if the size is > changed?
Yes, because currently you pass a pointer to a static struct to the sysfs_bin_attribute. If you change the size of the static struct to another value, all other instances will get the new size, too, because they still use the pointer to it.
You could just delete the size from the static struct, copy it over and add the correct size to the copy and pass the copy to create_bin_file(). Or you initialize directly.
-- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | [unhandled content-type:application/pgp-signature] | |