diff options
-rw-r--r-- | drivers/mfd/ab8500-debugfs.c | 14 | ||||
-rw-r--r-- | drivers/platform/x86/pmc_atom.c | 14 | ||||
-rw-r--r-- | include/linux/seq_file.h | 14 | ||||
-rw-r--r-- | net/bluetooth/hci_debugfs.c | 13 |
4 files changed, 14 insertions, 41 deletions
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c index 1afa27de7191..fcb3a92ae85f 100644 --- a/drivers/mfd/ab8500-debugfs.c +++ b/drivers/mfd/ab8500-debugfs.c | |||
@@ -1258,20 +1258,6 @@ static struct ab8500_prcmu_ranges ab8540_debug_ranges[AB8500_NUM_BANKS] = { | |||
1258 | }, | 1258 | }, |
1259 | }; | 1259 | }; |
1260 | 1260 | ||
1261 | #define DEFINE_SHOW_ATTRIBUTE(__name) \ | ||
1262 | static int __name ## _open(struct inode *inode, struct file *file) \ | ||
1263 | { \ | ||
1264 | return single_open(file, __name ## _show, inode->i_private); \ | ||
1265 | } \ | ||
1266 | \ | ||
1267 | static const struct file_operations __name ## _fops = { \ | ||
1268 | .owner = THIS_MODULE, \ | ||
1269 | .open = __name ## _open, \ | ||
1270 | .read = seq_read, \ | ||
1271 | .llseek = seq_lseek, \ | ||
1272 | .release = single_release, \ | ||
1273 | } \ | ||
1274 | |||
1275 | static irqreturn_t ab8500_debug_handler(int irq, void *data) | 1261 | static irqreturn_t ab8500_debug_handler(int irq, void *data) |
1276 | { | 1262 | { |
1277 | char buf[16]; | 1263 | char buf[16]; |
diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c index 4b3c37b6288c..8f018b3f3cd4 100644 --- a/drivers/platform/x86/pmc_atom.c +++ b/drivers/platform/x86/pmc_atom.c | |||
@@ -208,20 +208,6 @@ static const struct pmc_data cht_data = { | |||
208 | .clks = cht_clks, | 208 | .clks = cht_clks, |
209 | }; | 209 | }; |
210 | 210 | ||
211 | #define DEFINE_SHOW_ATTRIBUTE(__name) \ | ||
212 | static int __name ## _open(struct inode *inode, struct file *file) \ | ||
213 | { \ | ||
214 | return single_open(file, __name ## _show, inode->i_private); \ | ||
215 | } \ | ||
216 | \ | ||
217 | static const struct file_operations __name ## _fops = { \ | ||
218 | .owner = THIS_MODULE, \ | ||
219 | .open = __name ## _open, \ | ||
220 | .read = seq_read, \ | ||
221 | .llseek = seq_lseek, \ | ||
222 | .release = single_release, \ | ||
223 | } | ||
224 | |||
225 | static inline u32 pmc_reg_read(struct pmc_dev *pmc, int reg_offset) | 211 | static inline u32 pmc_reg_read(struct pmc_dev *pmc, int reg_offset) |
226 | { | 212 | { |
227 | return readl(pmc->regmap + reg_offset); | 213 | return readl(pmc->regmap + reg_offset); |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 09c6e28746f9..ab437dd2e3b9 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -140,6 +140,20 @@ void *__seq_open_private(struct file *, const struct seq_operations *, int); | |||
140 | int seq_open_private(struct file *, const struct seq_operations *, int); | 140 | int seq_open_private(struct file *, const struct seq_operations *, int); |
141 | int seq_release_private(struct inode *, struct file *); | 141 | int seq_release_private(struct inode *, struct file *); |
142 | 142 | ||
143 | #define DEFINE_SHOW_ATTRIBUTE(__name) \ | ||
144 | static int __name ## _open(struct inode *inode, struct file *file) \ | ||
145 | { \ | ||
146 | return single_open(file, __name ## _show, inode->i_private); \ | ||
147 | } \ | ||
148 | \ | ||
149 | static const struct file_operations __name ## _fops = { \ | ||
150 | .owner = THIS_MODULE, \ | ||
151 | .open = __name ## _open, \ | ||
152 | .read = seq_read, \ | ||
153 | .llseek = seq_lseek, \ | ||
154 | .release = single_release, \ | ||
155 | } | ||
156 | |||
143 | static inline struct user_namespace *seq_user_ns(struct seq_file *seq) | 157 | static inline struct user_namespace *seq_user_ns(struct seq_file *seq) |
144 | { | 158 | { |
145 | #ifdef CONFIG_USER_NS | 159 | #ifdef CONFIG_USER_NS |
diff --git a/net/bluetooth/hci_debugfs.c b/net/bluetooth/hci_debugfs.c index 57403bd567d0..418b76e557b0 100644 --- a/net/bluetooth/hci_debugfs.c +++ b/net/bluetooth/hci_debugfs.c | |||
@@ -90,19 +90,6 @@ static int __name ## _show(struct seq_file *f, void *ptr) \ | |||
90 | \ | 90 | \ |
91 | DEFINE_SHOW_ATTRIBUTE(__name) | 91 | DEFINE_SHOW_ATTRIBUTE(__name) |
92 | 92 | ||
93 | #define DEFINE_SHOW_ATTRIBUTE(__name) \ | ||
94 | static int __name ## _open(struct inode *inode, struct file *file) \ | ||
95 | { \ | ||
96 | return single_open(file, __name ## _show, inode->i_private); \ | ||
97 | } \ | ||
98 | \ | ||
99 | static const struct file_operations __name ## _fops = { \ | ||
100 | .open = __name ## _open, \ | ||
101 | .read = seq_read, \ | ||
102 | .llseek = seq_lseek, \ | ||
103 | .release = single_release, \ | ||
104 | } \ | ||
105 | |||
106 | static int features_show(struct seq_file *f, void *ptr) | 93 | static int features_show(struct seq_file *f, void *ptr) |
107 | { | 94 | { |
108 | struct hci_dev *hdev = f->private; | 95 | struct hci_dev *hdev = f->private; |