mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
seq_file: Introduce DEFINE_SHOW_ATTRIBUTE() helper macro
The DEFINE_SHOW_ATTRIBUTE() helper macro would be useful for current users, which are many of them, and for new comers to decrease code duplication. Acked-by: Lee Jones <[email protected]> Acked-by: Darren Hart (VMware) <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
This commit is contained in:
parent
a2e5790d84
commit
a08f06bb7a
4 changed files with 14 additions and 41 deletions
|
|
@ -1258,20 +1258,6 @@ static struct ab8500_prcmu_ranges ab8540_debug_ranges[AB8500_NUM_BANKS] = {
|
|||
},
|
||||
};
|
||||
|
||||
#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, \
|
||||
} \
|
||||
|
||||
static irqreturn_t ab8500_debug_handler(int irq, void *data)
|
||||
{
|
||||
char buf[16];
|
||||
|
|
|
|||
Loading…
Reference in a new issue