diff mbox

[2/2] mmc: dw_mmc: Convert to use DEFINE_SHOW_ATTRIBUTE

Message ID 1519375646-146695-2-git-send-email-shawn.lin@rock-chips.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shawn Lin Feb. 23, 2018, 8:47 a.m. UTC
Use the newly added macro to simply to the code.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 drivers/mmc/host/dw_mmc.c | 28 ++--------------------------
 1 file changed, 2 insertions(+), 26 deletions(-)

Comments

Jaehoon Chung Feb. 23, 2018, 9:39 a.m. UTC | #1
On 02/23/2018 05:47 PM, Shawn Lin wrote:
> Use the newly added macro to simply to the code.
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
> 
>  drivers/mmc/host/dw_mmc.c | 28 ++--------------------------
>  1 file changed, 2 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index e38dcf4..1f6c9c7 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -147,19 +147,7 @@ static int dw_mci_req_show(struct seq_file *s, void *v)
>  
>  	return 0;
>  }
> -
> -static int dw_mci_req_open(struct inode *inode, struct file *file)
> -{
> -	return single_open(file, dw_mci_req_show, inode->i_private);
> -}
> -
> -static const struct file_operations dw_mci_req_fops = {
> -	.owner		= THIS_MODULE,
> -	.open		= dw_mci_req_open,
> -	.read		= seq_read,
> -	.llseek		= seq_lseek,
> -	.release	= single_release,
> -};
> +DEFINE_SHOW_ATTRIBUTE(dw_mci_req);
>  
>  static int dw_mci_regs_show(struct seq_file *s, void *v)
>  {
> @@ -178,19 +166,7 @@ static int dw_mci_regs_show(struct seq_file *s, void *v)
>  
>  	return 0;
>  }
> -
> -static int dw_mci_regs_open(struct inode *inode, struct file *file)
> -{
> -	return single_open(file, dw_mci_regs_show, inode->i_private);
> -}
> -
> -static const struct file_operations dw_mci_regs_fops = {
> -	.owner		= THIS_MODULE,
> -	.open		= dw_mci_regs_open,
> -	.read		= seq_read,
> -	.llseek		= seq_lseek,
> -	.release	= single_release,
> -};
> +DEFINE_SHOW_ATTRIBUTE(dw_mci_regs);
>  
>  static void dw_mci_init_debugfs(struct dw_mci_slot *slot)
>  {
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ulf Hansson Feb. 27, 2018, 11:27 a.m. UTC | #2
On 23 February 2018 at 09:47, Shawn Lin <shawn.lin@rock-chips.com> wrote:
> Use the newly added macro to simply to the code.
>
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>
>  drivers/mmc/host/dw_mmc.c | 28 ++--------------------------
>  1 file changed, 2 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index e38dcf4..1f6c9c7 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -147,19 +147,7 @@ static int dw_mci_req_show(struct seq_file *s, void *v)
>
>         return 0;
>  }
> -
> -static int dw_mci_req_open(struct inode *inode, struct file *file)
> -{
> -       return single_open(file, dw_mci_req_show, inode->i_private);
> -}
> -
> -static const struct file_operations dw_mci_req_fops = {
> -       .owner          = THIS_MODULE,
> -       .open           = dw_mci_req_open,
> -       .read           = seq_read,
> -       .llseek         = seq_lseek,
> -       .release        = single_release,
> -};
> +DEFINE_SHOW_ATTRIBUTE(dw_mci_req);
>
>  static int dw_mci_regs_show(struct seq_file *s, void *v)
>  {
> @@ -178,19 +166,7 @@ static int dw_mci_regs_show(struct seq_file *s, void *v)
>
>         return 0;
>  }
> -
> -static int dw_mci_regs_open(struct inode *inode, struct file *file)
> -{
> -       return single_open(file, dw_mci_regs_show, inode->i_private);
> -}
> -
> -static const struct file_operations dw_mci_regs_fops = {
> -       .owner          = THIS_MODULE,
> -       .open           = dw_mci_regs_open,
> -       .read           = seq_read,
> -       .llseek         = seq_lseek,
> -       .release        = single_release,
> -};
> +DEFINE_SHOW_ATTRIBUTE(dw_mci_regs);
>
>  static void dw_mci_init_debugfs(struct dw_mci_slot *slot)
>  {
> --
> 1.9.1
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index e38dcf4..1f6c9c7 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -147,19 +147,7 @@  static int dw_mci_req_show(struct seq_file *s, void *v)
 
 	return 0;
 }
-
-static int dw_mci_req_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, dw_mci_req_show, inode->i_private);
-}
-
-static const struct file_operations dw_mci_req_fops = {
-	.owner		= THIS_MODULE,
-	.open		= dw_mci_req_open,
-	.read		= seq_read,
-	.llseek		= seq_lseek,
-	.release	= single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(dw_mci_req);
 
 static int dw_mci_regs_show(struct seq_file *s, void *v)
 {
@@ -178,19 +166,7 @@  static int dw_mci_regs_show(struct seq_file *s, void *v)
 
 	return 0;
 }
-
-static int dw_mci_regs_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, dw_mci_regs_show, inode->i_private);
-}
-
-static const struct file_operations dw_mci_regs_fops = {
-	.owner		= THIS_MODULE,
-	.open		= dw_mci_regs_open,
-	.read		= seq_read,
-	.llseek		= seq_lseek,
-	.release	= single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(dw_mci_regs);
 
 static void dw_mci_init_debugfs(struct dw_mci_slot *slot)
 {