From 1db97176edf3b4c031c25ad3b6315b1ea593ee9c Mon Sep 17 00:00:00 2001 From: Dominik Sliwa Date: Wed, 19 Sep 2018 10:40:46 +0200 Subject: backports: bluetooth: fix bluetooth debugfs compilation Signed-off-by: Dominik Sliwa --- backport-include/linux/seq_file.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/backport-include/linux/seq_file.h b/backport-include/linux/seq_file.h index ad1bded..4bb696c 100644 --- a/backport-include/linux/seq_file.h +++ b/backport-include/linux/seq_file.h @@ -48,4 +48,19 @@ void seq_hex_dump(struct seq_file *m, const char *prefix_str, int prefix_type, bool ascii); #endif +#if LINUX_VERSION_IS_LESS(4,16,0) +#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 #endif /* __BACKPORT_SEQ_FILE_H */ -- cgit v1.2.3