OSDN Git Service
(root)
/
sagit-ice-cold
/
kernel_xiaomi_msm8998.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rapidio: fix sysfs config attribute to access 16MB of maint space
[sagit-ice-cold/kernel_xiaomi_msm8998.git]
/
drivers
/
rapidio
/
rio-sysfs.c
diff --git
a/drivers/rapidio/rio-sysfs.c
b/drivers/rapidio/rio-sysfs.c
index
76b4185
..
1269fbd
100644
(file)
--- a/
drivers/rapidio/rio-sysfs.c
+++ b/
drivers/rapidio/rio-sysfs.c
@@
-77,9
+77,9
@@
rio_read_config(struct file *filp, struct kobject *kobj,
/* Several chips lock up trying to read undefined config space */
if (capable(CAP_SYS_ADMIN))
/* Several chips lock up trying to read undefined config space */
if (capable(CAP_SYS_ADMIN))
- size =
0x200000
;
+ size =
RIO_MAINT_SPACE_SZ
;
- if (off > size)
+ if (off >
=
size)
return 0;
if (off + count > size) {
size -= off;
return 0;
if (off + count > size) {
size -= off;
@@
-147,10
+147,10
@@
rio_write_config(struct file *filp, struct kobject *kobj,
loff_t init_off = off;
u8 *data = (u8 *) buf;
loff_t init_off = off;
u8 *data = (u8 *) buf;
- if (off >
0x200000
)
+ if (off >
= RIO_MAINT_SPACE_SZ
)
return 0;
return 0;
- if (off + count >
0x200000
) {
- size =
0x200000
- off;
+ if (off + count >
RIO_MAINT_SPACE_SZ
) {
+ size =
RIO_MAINT_SPACE_SZ
- off;
count = size;
}
count = size;
}
@@
-200,7
+200,7
@@
static struct bin_attribute rio_config_attr = {
.name = "config",
.mode = S_IRUGO | S_IWUSR,
},
.name = "config",
.mode = S_IRUGO | S_IWUSR,
},
- .size =
0x200000
,
+ .size =
RIO_MAINT_SPACE_SZ
,
.read = rio_read_config,
.write = rio_write_config,
};
.read = rio_read_config,
.write = rio_write_config,
};