summaryrefslogtreecommitdiff
path: root/drivers/soc
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2019-09-04 22:32:30 +0200
committerArnd Bergmann <arnd@arndb.de>2019-09-04 22:32:30 +0200
commitb8580b283197cf6c355b0ccc8128777dcf8375d4 (patch)
tree438cdccdd63060b0721535ca61a746a5db133f7f /drivers/soc
parentde8a618f30e8436b8b6f344604225990325fef91 (diff)
parent28578825ede61834a2c46e7f9a89012c4c7a667f (diff)
Merge tag 'samsung-drivers-5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/drivers
Samsung soc drivers changes for v5.4, part 2 Fixes and cleanups for recently introduced Exynos chipid driver. * tag 'samsung-drivers-5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: soc: samsung: chipid: Select missing dependency for EXYNOS_CHIPID soc: samsung: chipid: Remove the regmap lookup error log soc: samsung: chipid: Fix memory leak in error path Link: https://lore.kernel.org/r/20190904175002.10487-3-krzk@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/samsung/Kconfig1
-rw-r--r--drivers/soc/samsung/exynos-chipid.c18
2 files changed, 12 insertions, 7 deletions
diff --git a/drivers/soc/samsung/Kconfig b/drivers/soc/samsung/Kconfig
index 2905f5262197..33ad0de2de3c 100644
--- a/drivers/soc/samsung/Kconfig
+++ b/drivers/soc/samsung/Kconfig
@@ -10,6 +10,7 @@ if SOC_SAMSUNG
config EXYNOS_CHIPID
bool "Exynos Chipid controller driver" if COMPILE_TEST
depends on ARCH_EXYNOS || COMPILE_TEST
+ select MFD_SYSCON
select SOC_BUS
config EXYNOS_PMU
diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exynos-chipid.c
index 006a95feb618..c55a47cfe617 100644
--- a/drivers/soc/samsung/exynos-chipid.c
+++ b/drivers/soc/samsung/exynos-chipid.c
@@ -56,10 +56,8 @@ int __init exynos_chipid_early_init(void)
int ret;
regmap = syscon_regmap_lookup_by_compatible("samsung,exynos4210-chipid");
- if (IS_ERR(regmap)) {
- pr_err("Failed to get CHIPID regmap\n");
+ if (IS_ERR(regmap))
return PTR_ERR(regmap);
- }
ret = regmap_read(regmap, EXYNOS_CHIPID_REG_PRO_ID, &product_id);
if (ret < 0)
@@ -81,15 +79,15 @@ int __init exynos_chipid_early_init(void)
soc_dev_attr->soc_id = product_id_to_soc_id(product_id);
if (!soc_dev_attr->soc_id) {
pr_err("Unknown SoC\n");
- return -ENODEV;
+ ret = -ENODEV;
+ goto err;
}
/* please note that the actual registration will be deferred */
soc_dev = soc_device_register(soc_dev_attr);
if (IS_ERR(soc_dev)) {
- kfree(soc_dev_attr->revision);
- kfree(soc_dev_attr);
- return PTR_ERR(soc_dev);
+ ret = PTR_ERR(soc_dev);
+ goto err;
}
/* it is too early to use dev_info() here (soc_dev is NULL) */
@@ -97,5 +95,11 @@ int __init exynos_chipid_early_init(void)
soc_dev_attr->soc_id, product_id, revision);
return 0;
+
+err:
+ kfree(soc_dev_attr->revision);
+ kfree(soc_dev_attr);
+ return ret;
}
+
early_initcall(exynos_chipid_early_init);