mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user