Skip to content

Commit d9bbd6a

Browse files
TinyWindzzdavem330
authored andcommitted
net: marvell: convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2507915 commit d9bbd6a

2 files changed

Lines changed: 2 additions & 26 deletions

File tree

‎drivers/net/ethernet/marvell/skge.c‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,19 +3732,7 @@ static int skge_debug_show(struct seq_file *seq, void *v)
37323732

37333733
return 0;
37343734
}
3735-
3736-
static int skge_debug_open(struct inode *inode, struct file *file)
3737-
{
3738-
return single_open(file, skge_debug_show, inode->i_private);
3739-
}
3740-
3741-
static const struct file_operations skge_debug_fops = {
3742-
.owner = THIS_MODULE,
3743-
.open = skge_debug_open,
3744-
.read = seq_read,
3745-
.llseek = seq_lseek,
3746-
.release = single_release,
3747-
};
3735+
DEFINE_SHOW_ATTRIBUTE(skge_debug);
37483736

37493737
/*
37503738
* Use network device events to create/remove/rename

‎drivers/net/ethernet/marvell/sky2.c‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4621,19 +4621,7 @@ static int sky2_debug_show(struct seq_file *seq, void *v)
46214621
napi_enable(&hw->napi);
46224622
return 0;
46234623
}
4624-
4625-
static int sky2_debug_open(struct inode *inode, struct file *file)
4626-
{
4627-
return single_open(file, sky2_debug_show, inode->i_private);
4628-
}
4629-
4630-
static const struct file_operations sky2_debug_fops = {
4631-
.owner = THIS_MODULE,
4632-
.open = sky2_debug_open,
4633-
.read = seq_read,
4634-
.llseek = seq_lseek,
4635-
.release = single_release,
4636-
};
4624+
DEFINE_SHOW_ATTRIBUTE(sky2_debug);
46374625

46384626
/*
46394627
* Use network device events to create/remove/rename

0 commit comments

Comments
 (0)