aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorChris Wright <chrisw@sous-sol.org>2010-05-12 21:28:57 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-21 12:37:31 -0400
commit2c3c8bea608866d8bd9dcf92657d57fdcac011c5 (patch)
treef509b958d0a65c46c831dbdd447a81e706dd995a /drivers/rtc
parent68d75ed4b84a0806ecd4bc14da4759713b23a532 (diff)
sysfs: add struct file* to bin_attr callbacks
This allows bin_attr->read,write,mmap callbacks to check file specific data (such as inode owner) as part of any privilege validation. Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-cmos.c6
-rw-r--r--drivers/rtc/rtc-ds1305.c6
-rw-r--r--drivers/rtc/rtc-ds1307.c6
-rw-r--r--drivers/rtc/rtc-ds1511.c10
-rw-r--r--drivers/rtc/rtc-ds1553.c4
-rw-r--r--drivers/rtc/rtc-ds1742.c4
-rw-r--r--drivers/rtc/rtc-m48t59.c4
-rw-r--r--drivers/rtc/rtc-stk17ta8.c4
-rw-r--r--drivers/rtc/rtc-tx4939.c4
9 files changed, 28 insertions, 20 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index e9aa814ddd23..ece4dbddc0ea 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -519,7 +519,8 @@ static const struct rtc_class_ops cmos_rtc_ops = {
519#define NVRAM_OFFSET (RTC_REG_D + 1) 519#define NVRAM_OFFSET (RTC_REG_D + 1)
520 520
521static ssize_t 521static ssize_t
522cmos_nvram_read(struct kobject *kobj, struct bin_attribute *attr, 522cmos_nvram_read(struct file *filp, struct kobject *kobj,
523 struct bin_attribute *attr,
523 char *buf, loff_t off, size_t count) 524 char *buf, loff_t off, size_t count)
524{ 525{
525 int retval; 526 int retval;
@@ -547,7 +548,8 @@ cmos_nvram_read(struct kobject *kobj, struct bin_attribute *attr,
547} 548}
548 549
549static ssize_t 550static ssize_t
550cmos_nvram_write(struct kobject *kobj, struct bin_attribute *attr, 551cmos_nvram_write(struct file *filp, struct kobject *kobj,
552 struct bin_attribute *attr,
551 char *buf, loff_t off, size_t count) 553 char *buf, loff_t off, size_t count)
552{ 554{
553 struct cmos_rtc *cmos; 555 struct cmos_rtc *cmos;
diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c
index 7836c9cec557..48da85e97ca4 100644
--- a/drivers/rtc/rtc-ds1305.c
+++ b/drivers/rtc/rtc-ds1305.c
@@ -542,7 +542,8 @@ static void msg_init(struct spi_message *m, struct spi_transfer *x,
542} 542}
543 543
544static ssize_t 544static ssize_t
545ds1305_nvram_read(struct kobject *kobj, struct bin_attribute *attr, 545ds1305_nvram_read(struct file *filp, struct kobject *kobj,
546 struct bin_attribute *attr,
546 char *buf, loff_t off, size_t count) 547 char *buf, loff_t off, size_t count)
547{ 548{
548 struct spi_device *spi; 549 struct spi_device *spi;
@@ -572,7 +573,8 @@ ds1305_nvram_read(struct kobject *kobj, struct bin_attribute *attr,
572} 573}
573 574
574static ssize_t 575static ssize_t
575ds1305_nvram_write(struct kobject *kobj, struct bin_attribute *attr, 576ds1305_nvram_write(struct file *filp, struct kobject *kobj,
577 struct bin_attribute *attr,
576 char *buf, loff_t off, size_t count) 578 char *buf, loff_t off, size_t count)
577{ 579{
578 struct spi_device *spi; 580 struct spi_device *spi;
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index c4ec5c158aa1..de033b7ac21f 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -556,7 +556,8 @@ static const struct rtc_class_ops ds13xx_rtc_ops = {
556#define NVRAM_SIZE 56 556#define NVRAM_SIZE 56
557 557
558static ssize_t 558static ssize_t
559ds1307_nvram_read(struct kobject *kobj, struct bin_attribute *attr, 559ds1307_nvram_read(struct file *filp, struct kobject *kobj,
560 struct bin_attribute *attr,
560 char *buf, loff_t off, size_t count) 561 char *buf, loff_t off, size_t count)
561{ 562{
562 struct i2c_client *client; 563 struct i2c_client *client;
@@ -580,7 +581,8 @@ ds1307_nvram_read(struct kobject *kobj, struct bin_attribute *attr,
580} 581}
581 582
582static ssize_t 583static ssize_t
583ds1307_nvram_write(struct kobject *kobj, struct bin_attribute *attr, 584ds1307_nvram_write(struct file *filp, struct kobject *kobj,
585 struct bin_attribute *attr,
584 char *buf, loff_t off, size_t count) 586 char *buf, loff_t off, size_t count)
585{ 587{
586 struct i2c_client *client; 588 struct i2c_client *client;
diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c
index 06b8566c4532..37268e97de49 100644
--- a/drivers/rtc/rtc-ds1511.c
+++ b/drivers/rtc/rtc-ds1511.c
@@ -423,8 +423,9 @@ static const struct rtc_class_ops ds1511_rtc_ops = {
423}; 423};
424 424
425 static ssize_t 425 static ssize_t
426ds1511_nvram_read(struct kobject *kobj, struct bin_attribute *ba, 426ds1511_nvram_read(struct file *filp, struct kobject *kobj,
427 char *buf, loff_t pos, size_t size) 427 struct bin_attribute *ba,
428 char *buf, loff_t pos, size_t size)
428{ 429{
429 ssize_t count; 430 ssize_t count;
430 431
@@ -452,8 +453,9 @@ ds1511_nvram_read(struct kobject *kobj, struct bin_attribute *ba,
452} 453}
453 454
454 static ssize_t 455 static ssize_t
455ds1511_nvram_write(struct kobject *kobj, struct bin_attribute *bin_attr, 456ds1511_nvram_write(struct file *filp, struct kobject *kobj,
456 char *buf, loff_t pos, size_t size) 457 struct bin_attribute *bin_attr,
458 char *buf, loff_t pos, size_t size)
457{ 459{
458 ssize_t count; 460 ssize_t count;
459 461
diff --git a/drivers/rtc/rtc-ds1553.c b/drivers/rtc/rtc-ds1553.c
index 244f9994bcbb..ff432e2ca275 100644
--- a/drivers/rtc/rtc-ds1553.c
+++ b/drivers/rtc/rtc-ds1553.c
@@ -252,7 +252,7 @@ static const struct rtc_class_ops ds1553_rtc_ops = {
252 .update_irq_enable = ds1553_rtc_update_irq_enable, 252 .update_irq_enable = ds1553_rtc_update_irq_enable,
253}; 253};
254 254
255static ssize_t ds1553_nvram_read(struct kobject *kobj, 255static ssize_t ds1553_nvram_read(struct file *filp, struct kobject *kobj,
256 struct bin_attribute *bin_attr, 256 struct bin_attribute *bin_attr,
257 char *buf, loff_t pos, size_t size) 257 char *buf, loff_t pos, size_t size)
258{ 258{
@@ -267,7 +267,7 @@ static ssize_t ds1553_nvram_read(struct kobject *kobj,
267 return count; 267 return count;
268} 268}
269 269
270static ssize_t ds1553_nvram_write(struct kobject *kobj, 270static ssize_t ds1553_nvram_write(struct file *filp, struct kobject *kobj,
271 struct bin_attribute *bin_attr, 271 struct bin_attribute *bin_attr,
272 char *buf, loff_t pos, size_t size) 272 char *buf, loff_t pos, size_t size)
273{ 273{
diff --git a/drivers/rtc/rtc-ds1742.c b/drivers/rtc/rtc-ds1742.c
index 2b4b0bc42d6f..042630c90dd3 100644
--- a/drivers/rtc/rtc-ds1742.c
+++ b/drivers/rtc/rtc-ds1742.c
@@ -128,7 +128,7 @@ static const struct rtc_class_ops ds1742_rtc_ops = {
128 .set_time = ds1742_rtc_set_time, 128 .set_time = ds1742_rtc_set_time,
129}; 129};
130 130
131static ssize_t ds1742_nvram_read(struct kobject *kobj, 131static ssize_t ds1742_nvram_read(struct file *filp, struct kobject *kobj,
132 struct bin_attribute *bin_attr, 132 struct bin_attribute *bin_attr,
133 char *buf, loff_t pos, size_t size) 133 char *buf, loff_t pos, size_t size)
134{ 134{
@@ -143,7 +143,7 @@ static ssize_t ds1742_nvram_read(struct kobject *kobj,
143 return count; 143 return count;
144} 144}
145 145
146static ssize_t ds1742_nvram_write(struct kobject *kobj, 146static ssize_t ds1742_nvram_write(struct file *filp, struct kobject *kobj,
147 struct bin_attribute *bin_attr, 147 struct bin_attribute *bin_attr,
148 char *buf, loff_t pos, size_t size) 148 char *buf, loff_t pos, size_t size)
149{ 149{
diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c
index 365ff3ac2348..be8359fdb65a 100644
--- a/drivers/rtc/rtc-m48t59.c
+++ b/drivers/rtc/rtc-m48t59.c
@@ -343,7 +343,7 @@ static const struct rtc_class_ops m48t02_rtc_ops = {
343 .set_time = m48t59_rtc_set_time, 343 .set_time = m48t59_rtc_set_time,
344}; 344};
345 345
346static ssize_t m48t59_nvram_read(struct kobject *kobj, 346static ssize_t m48t59_nvram_read(struct file *filp, struct kobject *kobj,
347 struct bin_attribute *bin_attr, 347 struct bin_attribute *bin_attr,
348 char *buf, loff_t pos, size_t size) 348 char *buf, loff_t pos, size_t size)
349{ 349{
@@ -363,7 +363,7 @@ static ssize_t m48t59_nvram_read(struct kobject *kobj,
363 return cnt; 363 return cnt;
364} 364}
365 365
366static ssize_t m48t59_nvram_write(struct kobject *kobj, 366static ssize_t m48t59_nvram_write(struct file *filp, struct kobject *kobj,
367 struct bin_attribute *bin_attr, 367 struct bin_attribute *bin_attr,
368 char *buf, loff_t pos, size_t size) 368 char *buf, loff_t pos, size_t size)
369{ 369{
diff --git a/drivers/rtc/rtc-stk17ta8.c b/drivers/rtc/rtc-stk17ta8.c
index b53a00198dbe..3b943673cd3e 100644
--- a/drivers/rtc/rtc-stk17ta8.c
+++ b/drivers/rtc/rtc-stk17ta8.c
@@ -244,7 +244,7 @@ static const struct rtc_class_ops stk17ta8_rtc_ops = {
244 .alarm_irq_enable = stk17ta8_rtc_alarm_irq_enable, 244 .alarm_irq_enable = stk17ta8_rtc_alarm_irq_enable,
245}; 245};
246 246
247static ssize_t stk17ta8_nvram_read(struct kobject *kobj, 247static ssize_t stk17ta8_nvram_read(struct file *filp, struct kobject *kobj,
248 struct bin_attribute *attr, char *buf, 248 struct bin_attribute *attr, char *buf,
249 loff_t pos, size_t size) 249 loff_t pos, size_t size)
250{ 250{
@@ -259,7 +259,7 @@ static ssize_t stk17ta8_nvram_read(struct kobject *kobj,
259 return count; 259 return count;
260} 260}
261 261
262static ssize_t stk17ta8_nvram_write(struct kobject *kobj, 262static ssize_t stk17ta8_nvram_write(struct file *filp, struct kobject *kobj,
263 struct bin_attribute *attr, char *buf, 263 struct bin_attribute *attr, char *buf,
264 loff_t pos, size_t size) 264 loff_t pos, size_t size)
265{ 265{
diff --git a/drivers/rtc/rtc-tx4939.c b/drivers/rtc/rtc-tx4939.c
index 20bfc64a15c8..ec6313d15359 100644
--- a/drivers/rtc/rtc-tx4939.c
+++ b/drivers/rtc/rtc-tx4939.c
@@ -188,7 +188,7 @@ static const struct rtc_class_ops tx4939_rtc_ops = {
188 .alarm_irq_enable = tx4939_rtc_alarm_irq_enable, 188 .alarm_irq_enable = tx4939_rtc_alarm_irq_enable,
189}; 189};
190 190
191static ssize_t tx4939_rtc_nvram_read(struct kobject *kobj, 191static ssize_t tx4939_rtc_nvram_read(struct file *filp, struct kobject *kobj,
192 struct bin_attribute *bin_attr, 192 struct bin_attribute *bin_attr,
193 char *buf, loff_t pos, size_t size) 193 char *buf, loff_t pos, size_t size)
194{ 194{
@@ -207,7 +207,7 @@ static ssize_t tx4939_rtc_nvram_read(struct kobject *kobj,
207 return count; 207 return count;
208} 208}
209 209
210static ssize_t tx4939_rtc_nvram_write(struct kobject *kobj, 210static ssize_t tx4939_rtc_nvram_write(struct file *filp, struct kobject *kobj,
211 struct bin_attribute *bin_attr, 211 struct bin_attribute *bin_attr,
212 char *buf, loff_t pos, size_t size) 212 char *buf, loff_t pos, size_t size)
213{ 213{