linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] pwm: convert to use DEFINE_SEQ_ATTRIBUTE macro
@ 2020-09-16  2:50 Liu Shixin
  2020-09-16  5:54 ` Uwe Kleine-König
  2020-09-23 11:56 ` Thierry Reding
  0 siblings, 2 replies; 3+ messages in thread
From: Liu Shixin @ 2020-09-16  2:50 UTC (permalink / raw)
  To: Thierry Reding, Uwe Kleine-König, Lee Jones
  Cc: linux-pwm, linux-kernel, Liu Shixin

Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 drivers/pwm/core.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 276e939a5684..1f16f5365d3c 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -1327,30 +1327,19 @@ static int pwm_seq_show(struct seq_file *s, void *v)
 	return 0;
 }
 
-static const struct seq_operations pwm_seq_ops = {
+static const struct seq_operations pwm_debugfs_sops = {
 	.start = pwm_seq_start,
 	.next = pwm_seq_next,
 	.stop = pwm_seq_stop,
 	.show = pwm_seq_show,
 };
 
-static int pwm_seq_open(struct inode *inode, struct file *file)
-{
-	return seq_open(file, &pwm_seq_ops);
-}
-
-static const struct file_operations pwm_debugfs_ops = {
-	.owner = THIS_MODULE,
-	.open = pwm_seq_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = seq_release,
-};
+DEFINE_SEQ_ATTRIBUTE(pwm_debugfs);
 
 static int __init pwm_debugfs_init(void)
 {
 	debugfs_create_file("pwm", S_IFREG | S_IRUGO, NULL, NULL,
-			    &pwm_debugfs_ops);
+			    &pwm_debugfs_fops);
 
 	return 0;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] pwm: convert to use DEFINE_SEQ_ATTRIBUTE macro
  2020-09-16  2:50 [PATCH -next] pwm: convert to use DEFINE_SEQ_ATTRIBUTE macro Liu Shixin
@ 2020-09-16  5:54 ` Uwe Kleine-König
  2020-09-23 11:56 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2020-09-16  5:54 UTC (permalink / raw)
  To: Liu Shixin; +Cc: Thierry Reding, Lee Jones, linux-pwm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

On Wed, Sep 16, 2020 at 10:50:28AM +0800, Liu Shixin wrote:
> Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>

Looks good. I didn't test but assume it compiles and works as before.

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] pwm: convert to use DEFINE_SEQ_ATTRIBUTE macro
  2020-09-16  2:50 [PATCH -next] pwm: convert to use DEFINE_SEQ_ATTRIBUTE macro Liu Shixin
  2020-09-16  5:54 ` Uwe Kleine-König
@ 2020-09-23 11:56 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2020-09-23 11:56 UTC (permalink / raw)
  To: Liu Shixin; +Cc: Uwe Kleine-König, Lee Jones, linux-pwm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

On Wed, Sep 16, 2020 at 10:50:28AM +0800, Liu Shixin wrote:
> Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
> ---
>  drivers/pwm/core.c | 17 +++--------------
>  1 file changed, 3 insertions(+), 14 deletions(-)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-23 11:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16  2:50 [PATCH -next] pwm: convert to use DEFINE_SEQ_ATTRIBUTE macro Liu Shixin
2020-09-16  5:54 ` Uwe Kleine-König
2020-09-23 11:56 ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).