]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
soc: sunxi: sram: Fix probe function ordering issues
authorSamuel Holland <samuel@sholland.org>
Mon, 15 Aug 2022 04:12:42 +0000 (23:12 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 14 Nov 2022 10:25:30 +0000 (11:25 +0100)
commitba714a9b79120c5320e21b9db712171771576cb6
tree6871b643dd1422a7a4044a819147dbcf06b765c5
parentcec4d9fb02f718b86861b23cf5972d4d27b34325
soc: sunxi: sram: Fix probe function ordering issues

BugLink: https://bugs.launchpad.net/bugs/1995517
[ Upstream commit 49fad91a7b8941979c3e9a35f9894ac45bc5d3d6 ]

Errors from debugfs are intended to be non-fatal, and should not prevent
the driver from probing.

Since debugfs file creation is treated as infallible, move it below the
parts of the probe function that can fail. This prevents an error
elsewhere in the probe function from causing the file to leak. Do the
same for the call to of_platform_populate().

Finally, checkpatch suggests an octal literal for the file permissions.

Fixes: 4af34b572a85 ("drivers: soc: sunxi: Introduce SoC driver to map SRAMs")
Fixes: 5828729bebbb ("soc: sunxi: export a regmap for EMAC clock reg on A64")
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20220815041248.53268-6-samuel@sholland.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/soc/sunxi/sunxi_sram.c