From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Li Chen <me@linux.beauty>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] debugfs: allow to use regmap for print regs
Date: Wed, 11 Jan 2023 07:25:51 +0100 [thread overview]
Message-ID: <Y75Wbya+U9F9UPJO@kroah.com> (raw)
In-Reply-To: <20230111061541.3657154-1-me@linux.beauty>
On Wed, Jan 11, 2023 at 02:15:41PM +0800, Li Chen wrote:
> Currently, debugfs_regset32 only contains void __iomem *base,
> and it is not friendly to regmap user.
>
> Let's add regmap to debugfs_regset32, and add regmap
> support to debugfs_print_reg32.
>
> Signed-off-by: Li Chen <me@linux.beauty>
> ---
> fs/debugfs/file.c | 23 +++++++++++++++++++----
> include/linux/debugfs.h | 10 +++++++---
> 2 files changed, 26 insertions(+), 7 deletions(-)
>
> diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
> index b54f470e0d03..c4663cfc20b6 100644
> --- a/fs/debugfs/file.c
> +++ b/fs/debugfs/file.c
> @@ -1112,8 +1112,10 @@ EXPORT_SYMBOL_GPL(debugfs_create_u32_array);
> * @regs: an array if struct debugfs_reg32 structures
> * @nregs: the length of the above array
> * @base: the base address to be used in reading the registers
> + * @regmap: regmap to be used in reading the registers
> * @prefix: a string to be prefixed to every output line
> *
> + * user should pick one of two from base and regmap
> * This function outputs a text block describing the current values of
> * some 32-bit hardware registers. It is meant to be used within debugfs
> * files based on seq_file that need to show registers, intermixed with other
> @@ -1122,15 +1124,27 @@ EXPORT_SYMBOL_GPL(debugfs_create_u32_array);
> * for example configuration of dma channels
> */
> void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs,
> - int nregs, void __iomem *base, char *prefix)
> + int nregs, void __iomem *base, struct regmap *regmap,
> + char *prefix)
This is confusing, please just provide a new function for regmap instead
of trying to overload this function. You can use the same function
inside the debugfs core like this, but never export such a complex set
of parameters to actual users, that's just painful.
thanks,
greg k-h
next parent reply other threads:[~2023-01-11 6:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230111061541.3657154-1-me@linux.beauty>
2023-01-11 6:25 ` Greg Kroah-Hartman [this message]
2023-01-11 7:24 ` [PATCH] debugfs: allow to use regmap for print regs Li Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y75Wbya+U9F9UPJO@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@linux.beauty \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox