Message ID | 20220503225104.12108-16-Sergey.Semin@baikalelectronics.ru (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Lorenzo Pieralisi |
Headers | show |
Series | dmaengine: dw-edma: Add RP/EP local DMA controllers support | expand |
On Wed, May 04, 2022 at 01:50:53AM +0300, Serge Semin wrote: > Since we are about to add the eDMA channels direction support to the > debugfs module it will be confusing to have both the DebugFS directory and > the channels direction short names used in the same code. As a preparation > patch let's convert the DebugFS dentry 'dir' variables to having the > 'dent' name so to prevent the confusion. > > Suggested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Thanks, Mani > > --- > > Changelog v2: > - This is a new patch added in v2. (@Manivannan) > --- > drivers/dma/dw-edma/dw-edma-v0-debugfs.c | 46 ++++++++++++------------ > 1 file changed, 23 insertions(+), 23 deletions(-) > > diff --git a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > index 78f15e4b07ac..7bb3363b40e4 100644 > --- a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > +++ b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c > @@ -96,7 +96,7 @@ static int dw_edma_debugfs_u32_get(void *data, u64 *val) > DEFINE_DEBUGFS_ATTRIBUTE(fops_x32, dw_edma_debugfs_u32_get, NULL, "0x%08llx\n"); > > static void dw_edma_debugfs_create_x32(const struct dw_edma_debugfs_entry ini[], > - int nr_entries, struct dentry *dir) > + int nr_entries, struct dentry *dent) > { > struct dw_edma_debugfs_entry *entries; > int i; > @@ -109,13 +109,13 @@ static void dw_edma_debugfs_create_x32(const struct dw_edma_debugfs_entry ini[], > for (i = 0; i < nr_entries; i++) { > entries[i] = ini[i]; > > - debugfs_create_file_unsafe(entries[i].name, 0444, dir, > + debugfs_create_file_unsafe(entries[i].name, 0444, dent, > &entries[i], &fops_x32); > } > } > > static void dw_edma_debugfs_regs_ch(struct dw_edma_v0_ch_regs __iomem *regs, > - struct dentry *dir) > + struct dentry *dent) > { > const struct dw_edma_debugfs_entry debugfs_regs[] = { > REGISTER(ch_control1), > @@ -131,10 +131,10 @@ static void dw_edma_debugfs_regs_ch(struct dw_edma_v0_ch_regs __iomem *regs, > int nr_entries; > > nr_entries = ARRAY_SIZE(debugfs_regs); > - dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, dir); > + dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, dent); > } > > -static void dw_edma_debugfs_regs_wr(struct dentry *dir) > +static void dw_edma_debugfs_regs_wr(struct dentry *dent) > { > const struct dw_edma_debugfs_entry debugfs_regs[] = { > /* eDMA global registers */ > @@ -171,34 +171,34 @@ static void dw_edma_debugfs_regs_wr(struct dentry *dir) > WR_REGISTER_UNROLL(ch6_pwr_en), > WR_REGISTER_UNROLL(ch7_pwr_en), > }; > - struct dentry *regs_dir, *ch_dir; > + struct dentry *regs_dent, *ch_dent; > int nr_entries, i; > char name[16]; > > - regs_dir = debugfs_create_dir(WRITE_STR, dir); > + regs_dent = debugfs_create_dir(WRITE_STR, dent); > > nr_entries = ARRAY_SIZE(debugfs_regs); > - dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, regs_dir); > + dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, regs_dent); > > if (dw->chip->mf == EDMA_MF_HDMA_COMPAT) { > nr_entries = ARRAY_SIZE(debugfs_unroll_regs); > dw_edma_debugfs_create_x32(debugfs_unroll_regs, nr_entries, > - regs_dir); > + regs_dent); > } > > for (i = 0; i < dw->wr_ch_cnt; i++) { > snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i); > > - ch_dir = debugfs_create_dir(name, regs_dir); > + ch_dent = debugfs_create_dir(name, regs_dent); > > - dw_edma_debugfs_regs_ch(®s->type.unroll.ch[i].wr, ch_dir); > + dw_edma_debugfs_regs_ch(®s->type.unroll.ch[i].wr, ch_dent); > > lim[0][i].start = ®s->type.unroll.ch[i].wr; > lim[0][i].end = ®s->type.unroll.ch[i].padding_1[0]; > } > } > > -static void dw_edma_debugfs_regs_rd(struct dentry *dir) > +static void dw_edma_debugfs_regs_rd(struct dentry *dent) > { > const struct dw_edma_debugfs_entry debugfs_regs[] = { > /* eDMA global registers */ > @@ -236,27 +236,27 @@ static void dw_edma_debugfs_regs_rd(struct dentry *dir) > RD_REGISTER_UNROLL(ch6_pwr_en), > RD_REGISTER_UNROLL(ch7_pwr_en), > }; > - struct dentry *regs_dir, *ch_dir; > + struct dentry *regs_dent, *ch_dent; > int nr_entries, i; > char name[16]; > > - regs_dir = debugfs_create_dir(READ_STR, dir); > + regs_dent = debugfs_create_dir(READ_STR, dent); > > nr_entries = ARRAY_SIZE(debugfs_regs); > - dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, regs_dir); > + dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, regs_dent); > > if (dw->chip->mf == EDMA_MF_HDMA_COMPAT) { > nr_entries = ARRAY_SIZE(debugfs_unroll_regs); > dw_edma_debugfs_create_x32(debugfs_unroll_regs, nr_entries, > - regs_dir); > + regs_dent); > } > > for (i = 0; i < dw->rd_ch_cnt; i++) { > snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i); > > - ch_dir = debugfs_create_dir(name, regs_dir); > + ch_dent = debugfs_create_dir(name, regs_dent); > > - dw_edma_debugfs_regs_ch(®s->type.unroll.ch[i].rd, ch_dir); > + dw_edma_debugfs_regs_ch(®s->type.unroll.ch[i].rd, ch_dent); > > lim[1][i].start = ®s->type.unroll.ch[i].rd; > lim[1][i].end = ®s->type.unroll.ch[i].padding_2[0]; > @@ -269,16 +269,16 @@ static void dw_edma_debugfs_regs(void) > REGISTER(ctrl_data_arb_prior), > REGISTER(ctrl), > }; > - struct dentry *regs_dir; > + struct dentry *regs_dent; > int nr_entries; > > - regs_dir = debugfs_create_dir(REGISTERS_STR, dw->debugfs); > + regs_dent = debugfs_create_dir(REGISTERS_STR, dw->debugfs); > > nr_entries = ARRAY_SIZE(debugfs_regs); > - dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, regs_dir); > + dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, regs_dent); > > - dw_edma_debugfs_regs_wr(regs_dir); > - dw_edma_debugfs_regs_rd(regs_dir); > + dw_edma_debugfs_regs_wr(regs_dent); > + dw_edma_debugfs_regs_rd(regs_dent); > } > > void dw_edma_v0_debugfs_on(struct dw_edma *_dw) > -- > 2.35.1 >
diff --git a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c index 78f15e4b07ac..7bb3363b40e4 100644 --- a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c +++ b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c @@ -96,7 +96,7 @@ static int dw_edma_debugfs_u32_get(void *data, u64 *val) DEFINE_DEBUGFS_ATTRIBUTE(fops_x32, dw_edma_debugfs_u32_get, NULL, "0x%08llx\n"); static void dw_edma_debugfs_create_x32(const struct dw_edma_debugfs_entry ini[], - int nr_entries, struct dentry *dir) + int nr_entries, struct dentry *dent) { struct dw_edma_debugfs_entry *entries; int i; @@ -109,13 +109,13 @@ static void dw_edma_debugfs_create_x32(const struct dw_edma_debugfs_entry ini[], for (i = 0; i < nr_entries; i++) { entries[i] = ini[i]; - debugfs_create_file_unsafe(entries[i].name, 0444, dir, + debugfs_create_file_unsafe(entries[i].name, 0444, dent, &entries[i], &fops_x32); } } static void dw_edma_debugfs_regs_ch(struct dw_edma_v0_ch_regs __iomem *regs, - struct dentry *dir) + struct dentry *dent) { const struct dw_edma_debugfs_entry debugfs_regs[] = { REGISTER(ch_control1), @@ -131,10 +131,10 @@ static void dw_edma_debugfs_regs_ch(struct dw_edma_v0_ch_regs __iomem *regs, int nr_entries; nr_entries = ARRAY_SIZE(debugfs_regs); - dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, dir); + dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, dent); } -static void dw_edma_debugfs_regs_wr(struct dentry *dir) +static void dw_edma_debugfs_regs_wr(struct dentry *dent) { const struct dw_edma_debugfs_entry debugfs_regs[] = { /* eDMA global registers */ @@ -171,34 +171,34 @@ static void dw_edma_debugfs_regs_wr(struct dentry *dir) WR_REGISTER_UNROLL(ch6_pwr_en), WR_REGISTER_UNROLL(ch7_pwr_en), }; - struct dentry *regs_dir, *ch_dir; + struct dentry *regs_dent, *ch_dent; int nr_entries, i; char name[16]; - regs_dir = debugfs_create_dir(WRITE_STR, dir); + regs_dent = debugfs_create_dir(WRITE_STR, dent); nr_entries = ARRAY_SIZE(debugfs_regs); - dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, regs_dir); + dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, regs_dent); if (dw->chip->mf == EDMA_MF_HDMA_COMPAT) { nr_entries = ARRAY_SIZE(debugfs_unroll_regs); dw_edma_debugfs_create_x32(debugfs_unroll_regs, nr_entries, - regs_dir); + regs_dent); } for (i = 0; i < dw->wr_ch_cnt; i++) { snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i); - ch_dir = debugfs_create_dir(name, regs_dir); + ch_dent = debugfs_create_dir(name, regs_dent); - dw_edma_debugfs_regs_ch(®s->type.unroll.ch[i].wr, ch_dir); + dw_edma_debugfs_regs_ch(®s->type.unroll.ch[i].wr, ch_dent); lim[0][i].start = ®s->type.unroll.ch[i].wr; lim[0][i].end = ®s->type.unroll.ch[i].padding_1[0]; } } -static void dw_edma_debugfs_regs_rd(struct dentry *dir) +static void dw_edma_debugfs_regs_rd(struct dentry *dent) { const struct dw_edma_debugfs_entry debugfs_regs[] = { /* eDMA global registers */ @@ -236,27 +236,27 @@ static void dw_edma_debugfs_regs_rd(struct dentry *dir) RD_REGISTER_UNROLL(ch6_pwr_en), RD_REGISTER_UNROLL(ch7_pwr_en), }; - struct dentry *regs_dir, *ch_dir; + struct dentry *regs_dent, *ch_dent; int nr_entries, i; char name[16]; - regs_dir = debugfs_create_dir(READ_STR, dir); + regs_dent = debugfs_create_dir(READ_STR, dent); nr_entries = ARRAY_SIZE(debugfs_regs); - dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, regs_dir); + dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, regs_dent); if (dw->chip->mf == EDMA_MF_HDMA_COMPAT) { nr_entries = ARRAY_SIZE(debugfs_unroll_regs); dw_edma_debugfs_create_x32(debugfs_unroll_regs, nr_entries, - regs_dir); + regs_dent); } for (i = 0; i < dw->rd_ch_cnt; i++) { snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i); - ch_dir = debugfs_create_dir(name, regs_dir); + ch_dent = debugfs_create_dir(name, regs_dent); - dw_edma_debugfs_regs_ch(®s->type.unroll.ch[i].rd, ch_dir); + dw_edma_debugfs_regs_ch(®s->type.unroll.ch[i].rd, ch_dent); lim[1][i].start = ®s->type.unroll.ch[i].rd; lim[1][i].end = ®s->type.unroll.ch[i].padding_2[0]; @@ -269,16 +269,16 @@ static void dw_edma_debugfs_regs(void) REGISTER(ctrl_data_arb_prior), REGISTER(ctrl), }; - struct dentry *regs_dir; + struct dentry *regs_dent; int nr_entries; - regs_dir = debugfs_create_dir(REGISTERS_STR, dw->debugfs); + regs_dent = debugfs_create_dir(REGISTERS_STR, dw->debugfs); nr_entries = ARRAY_SIZE(debugfs_regs); - dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, regs_dir); + dw_edma_debugfs_create_x32(debugfs_regs, nr_entries, regs_dent); - dw_edma_debugfs_regs_wr(regs_dir); - dw_edma_debugfs_regs_rd(regs_dir); + dw_edma_debugfs_regs_wr(regs_dent); + dw_edma_debugfs_regs_rd(regs_dent); } void dw_edma_v0_debugfs_on(struct dw_edma *_dw)
Since we are about to add the eDMA channels direction support to the debugfs module it will be confusing to have both the DebugFS directory and the channels direction short names used in the same code. As a preparation patch let's convert the DebugFS dentry 'dir' variables to having the 'dent' name so to prevent the confusion. Suggested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> --- Changelog v2: - This is a new patch added in v2. (@Manivannan) --- drivers/dma/dw-edma/dw-edma-v0-debugfs.c | 46 ++++++++++++------------ 1 file changed, 23 insertions(+), 23 deletions(-)