* Re: [PATCH] debugfs: allow to use regmap for print regs
[not found] <20230111061541.3657154-1-me@linux.beauty>
@ 2023-01-11 6:25 ` Greg Kroah-Hartman
2023-01-11 7:24 ` Li Chen
0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman @ 2023-01-11 6:25 UTC (permalink / raw)
To: Li Chen; +Cc: Rafael J. Wysocki, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] debugfs: allow to use regmap for print regs
2023-01-11 6:25 ` [PATCH] debugfs: allow to use regmap for print regs Greg Kroah-Hartman
@ 2023-01-11 7:24 ` Li Chen
0 siblings, 0 replies; 2+ messages in thread
From: Li Chen @ 2023-01-11 7:24 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: rafael j. wysocki, linux-kernel
Hi Greg,
> > 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 for your review, updated in v2.
Regards,
Li
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-11 7:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20230111061541.3657154-1-me@linux.beauty>
2023-01-11 6:25 ` [PATCH] debugfs: allow to use regmap for print regs Greg Kroah-Hartman
2023-01-11 7:24 ` Li Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox