@@ -48,4 +48,20 @@ void seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type,
bool ascii);
#endif
+#ifndef DEFINE_SHOW_ATTRIBUTE
+#define DEFINE_SHOW_ATTRIBUTE(__name) \
+static int __name ## _open(struct inode *inode, struct file *file) \
+{ \
+ return single_open(file, __name ## _show, inode->i_private); \
+} \
+ \
+static const struct file_operations __name ## _fops = { \
+ .owner = THIS_MODULE, \
+ .open = __name ## _open, \
+ .read = seq_read, \
+ .llseek = seq_lseek, \
+ .release = single_release, \
+}
+#endif /* DEFINE_SHOW_ATTRIBUTE */
+
#endif /* __BACKPORT_SEQ_FILE_H */
This was introduced in Linux commit a08f06bb7a07 ("seq_file: Introduce DEFINE_SHOW_ATTRIBUTE() helper macro" and is used by the cw1200 and the wil6210 driver. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> --- backport/backport-include/linux/seq_file.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)