diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-31 18:16:14 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-04-09 14:13:32 -0400 |
commit | d9dda78bad879595d8c4220a067fc029d6484a16 (patch) | |
tree | 376c47ed566b719009e753e917104b150a639b11 /drivers/platform | |
parent | 8510e30b46cd5467b2f930bef68a276dbc2c7d7c (diff) |
procfs: new helper - PDE_DATA(inode)
The only part of proc_dir_entry the code outside of fs/proc
really cares about is PDE(inode)->data. Provide a helper
for that; static inline for now, eventually will be moved
to fs/proc, along with the knowledge of struct proc_dir_entry
layout.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 4 | ||||
-rw-r--r-- | drivers/platform/x86/toshiba_acpi.c | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 9a907567f41e..05272e676a28 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -844,14 +844,14 @@ static int dispatch_proc_show(struct seq_file *m, void *v) | |||
844 | 844 | ||
845 | static int dispatch_proc_open(struct inode *inode, struct file *file) | 845 | static int dispatch_proc_open(struct inode *inode, struct file *file) |
846 | { | 846 | { |
847 | return single_open(file, dispatch_proc_show, PDE(inode)->data); | 847 | return single_open(file, dispatch_proc_show, PDE_DATA(inode)); |
848 | } | 848 | } |
849 | 849 | ||
850 | static ssize_t dispatch_proc_write(struct file *file, | 850 | static ssize_t dispatch_proc_write(struct file *file, |
851 | const char __user *userbuf, | 851 | const char __user *userbuf, |
852 | size_t count, loff_t *pos) | 852 | size_t count, loff_t *pos) |
853 | { | 853 | { |
854 | struct ibm_struct *ibm = PDE(file_inode(file))->data; | 854 | struct ibm_struct *ibm = PDE_DATA(file_inode(file)); |
855 | char *kernbuf; | 855 | char *kernbuf; |
856 | int ret; | 856 | int ret; |
857 | 857 | ||
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 242abac62d8b..eb3467ea6d86 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c | |||
@@ -553,7 +553,7 @@ static int lcd_proc_show(struct seq_file *m, void *v) | |||
553 | 553 | ||
554 | static int lcd_proc_open(struct inode *inode, struct file *file) | 554 | static int lcd_proc_open(struct inode *inode, struct file *file) |
555 | { | 555 | { |
556 | return single_open(file, lcd_proc_show, PDE(inode)->data); | 556 | return single_open(file, lcd_proc_show, PDE_DATA(inode)); |
557 | } | 557 | } |
558 | 558 | ||
559 | static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value) | 559 | static int set_lcd_brightness(struct toshiba_acpi_dev *dev, int value) |
@@ -583,7 +583,7 @@ static int set_lcd_status(struct backlight_device *bd) | |||
583 | static ssize_t lcd_proc_write(struct file *file, const char __user *buf, | 583 | static ssize_t lcd_proc_write(struct file *file, const char __user *buf, |
584 | size_t count, loff_t *pos) | 584 | size_t count, loff_t *pos) |
585 | { | 585 | { |
586 | struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data; | 586 | struct toshiba_acpi_dev *dev = PDE_DATA(file_inode(file)); |
587 | char cmd[42]; | 587 | char cmd[42]; |
588 | size_t len; | 588 | size_t len; |
589 | int value; | 589 | int value; |
@@ -644,13 +644,13 @@ static int video_proc_show(struct seq_file *m, void *v) | |||
644 | 644 | ||
645 | static int video_proc_open(struct inode *inode, struct file *file) | 645 | static int video_proc_open(struct inode *inode, struct file *file) |
646 | { | 646 | { |
647 | return single_open(file, video_proc_show, PDE(inode)->data); | 647 | return single_open(file, video_proc_show, PDE_DATA(inode)); |
648 | } | 648 | } |
649 | 649 | ||
650 | static ssize_t video_proc_write(struct file *file, const char __user *buf, | 650 | static ssize_t video_proc_write(struct file *file, const char __user *buf, |
651 | size_t count, loff_t *pos) | 651 | size_t count, loff_t *pos) |
652 | { | 652 | { |
653 | struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data; | 653 | struct toshiba_acpi_dev *dev = PDE_DATA(file_inode(file)); |
654 | char *cmd, *buffer; | 654 | char *cmd, *buffer; |
655 | int ret; | 655 | int ret; |
656 | int value; | 656 | int value; |
@@ -744,13 +744,13 @@ static int fan_proc_show(struct seq_file *m, void *v) | |||
744 | 744 | ||
745 | static int fan_proc_open(struct inode *inode, struct file *file) | 745 | static int fan_proc_open(struct inode *inode, struct file *file) |
746 | { | 746 | { |
747 | return single_open(file, fan_proc_show, PDE(inode)->data); | 747 | return single_open(file, fan_proc_show, PDE_DATA(inode)); |
748 | } | 748 | } |
749 | 749 | ||
750 | static ssize_t fan_proc_write(struct file *file, const char __user *buf, | 750 | static ssize_t fan_proc_write(struct file *file, const char __user *buf, |
751 | size_t count, loff_t *pos) | 751 | size_t count, loff_t *pos) |
752 | { | 752 | { |
753 | struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data; | 753 | struct toshiba_acpi_dev *dev = PDE_DATA(file_inode(file)); |
754 | char cmd[42]; | 754 | char cmd[42]; |
755 | size_t len; | 755 | size_t len; |
756 | int value; | 756 | int value; |
@@ -816,13 +816,13 @@ static int keys_proc_show(struct seq_file *m, void *v) | |||
816 | 816 | ||
817 | static int keys_proc_open(struct inode *inode, struct file *file) | 817 | static int keys_proc_open(struct inode *inode, struct file *file) |
818 | { | 818 | { |
819 | return single_open(file, keys_proc_show, PDE(inode)->data); | 819 | return single_open(file, keys_proc_show, PDE_DATA(inode)); |
820 | } | 820 | } |
821 | 821 | ||
822 | static ssize_t keys_proc_write(struct file *file, const char __user *buf, | 822 | static ssize_t keys_proc_write(struct file *file, const char __user *buf, |
823 | size_t count, loff_t *pos) | 823 | size_t count, loff_t *pos) |
824 | { | 824 | { |
825 | struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data; | 825 | struct toshiba_acpi_dev *dev = PDE_DATA(file_inode(file)); |
826 | char cmd[42]; | 826 | char cmd[42]; |
827 | size_t len; | 827 | size_t len; |
828 | int value; | 828 | int value; |
@@ -859,7 +859,7 @@ static int version_proc_show(struct seq_file *m, void *v) | |||
859 | 859 | ||
860 | static int version_proc_open(struct inode *inode, struct file *file) | 860 | static int version_proc_open(struct inode *inode, struct file *file) |
861 | { | 861 | { |
862 | return single_open(file, version_proc_show, PDE(inode)->data); | 862 | return single_open(file, version_proc_show, PDE_DATA(inode)); |
863 | } | 863 | } |
864 | 864 | ||
865 | static const struct file_operations version_proc_fops = { | 865 | static const struct file_operations version_proc_fops = { |