soc/tegra: pmc: Simplify debugfs initialization
authorThierry Reding <treding@nvidia.com>
Fri, 9 Jun 2023 14:42:24 +0000 (16:42 +0200)
committerThierry Reding <treding@nvidia.com>
Fri, 9 Jun 2023 14:56:57 +0000 (16:56 +0200)
commitbae9fb2d39b73822379b9bda02f3b9335fc77e13
tree674061659a9d9aac1d34b8f12b6d3bf4683e6aeb
parente180cf836433185d0674ade52f8db911d89f6422
soc/tegra: pmc: Simplify debugfs initialization

debugfs calls should generally not be error-checked to simplify the case
where debugfs is disabled. Since this driver is built-in and has the
sysfs bind/unbind attributes disabled, it cannot be unloaded, so there
is no need to hold onto a reference to the debugfs files that are
created.

We can further simplify this by moving the debugfs file creation to a
later stage to avoid any cleanup we might have to do during error unwind
operations. This is also a little cleaner because the debugfs file
relies on data structures that are created at a later point than when
the file was previously created.

Suggested-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/soc/tegra/pmc.c