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 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

[ ... ]

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog




[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