linux-stable/drivers/soc/tegra
Jon Hunter a46b51cd2a soc/tegra: pmc: Remove reset sysfs entries on error
Commit 5f84bb1a40 ("soc/tegra: pmc: Add sysfs entries for reset info")
added sysfs entries for Tegra reset source and level. However, these
sysfs are not removed on error and so if the registering of PMC device
is probe deferred, then the next time we attempt to probe the PMC device
warnings such as the following will be displayed on boot ...

  sysfs: cannot create duplicate filename '/devices/platform/7000e400.pmc/reset_reason'

Fix this by calling device_remove_file() for each sysfs entry added on
failure. Note that we call device_remove_file() unconditionally without
checking if the sysfs entry was created in the first place, but this
should be OK because kernfs_remove_by_name_ns() will fail silently.

Fixes: 5f84bb1a40 ("soc/tegra: pmc: Add sysfs entries for reset info")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2019-04-17 10:32:08 +02:00
..
fuse soc/tegra: fuse: Fix typo in tegra210_init_speedo_data 2019-01-25 12:39:47 +01:00
common.c soc/tegra: Don't leak device tree node reference 2018-11-22 16:10:04 +01:00
flowctrl.c soc/tegra: flowctrl: Fix error handling 2017-06-13 16:47:44 +02:00
Kconfig soc/tegra: default select TEGRA_TIMER for Tegra210 2019-02-23 12:13:45 +01:00
Makefile soc/tegra: pmc: Consolidate Tegra186 support 2017-12-13 13:06:44 +01:00
pmc.c soc/tegra: pmc: Remove reset sysfs entries on error 2019-04-17 10:32:08 +02:00
powergate-bpmp.c soc/tegra: bpmp: Check BPMP response return code 2017-10-19 16:33:57 +02:00