Re: [PATCH v2 04/13] thermal: tegra: Use driver-private data consistently

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 13, 2023 at 10:04:33AM +0200, Daniel Lezcano wrote:
> On 12/10/2023 19:58, Thierry Reding wrote:
> > From: Thierry Reding <treding@xxxxxxxxxx>
> > 
> > Instead of passing around platform and plain devices and figuring out
> > the driver-private data within each helper, directly pass around the
> > driver-private data when it's available.
> > 
> > Also store a pointer to the parent device in the main driver-private
> > data structure for easier access.
> > 
> > Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
> > ---
> 
> [ ... ]
> 
> > -static void soctherm_debug_init(struct platform_device *pdev)
> > +static void soctherm_debug_init(struct tegra_soctherm *tegra)
> >   {
> > -	struct tegra_soctherm *tegra = platform_get_drvdata(pdev);
> >   	struct dentry *root;
> >   	root = debugfs_create_dir("soctherm", NULL);
> >   	tegra->debugfs_dir = root;
> > -	debugfs_create_file("reg_contents", 0644, root, pdev, &regs_fops);
> > +	debugfs_create_file("reg_contents", 0644, root, tegra, &regs_fops);
> 
> (Orthogonal to this series) : in case you are not aware of it there is the
> debugfs_create_regset32() function. That may make go away a bunch of code
> related to the debugfs code here.
> 
> cf. https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git/tree/drivers/thermal/mediatek/lvts_thermal.c?h=thermal/bleeding-edge#n159

Doesn't look like we could 1:1 transition to that because a bunch of the
output is parameterized on some per-SoC variables, but it might be
possible to rework the whole debugfs interfaces and split it up into
multiple directories and files, much like LVTS does this. That's going
to be quite a bit of work, but I can add it to my TODO list to look at
when I get some spare time.

Thierry

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux