[lkml]   [2012]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [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 | |
[unhandled content-type:application/pgp-signature]
 \ /
  Last update: 2012-02-07 15:59    [W:0.075 / U:18.328 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site