memory: samsung: exynos5422-dmc: Do not ignore return code of regmap_read()
authorKrzysztof Kozlowski <krzk@kernel.org>
Mon, 20 Jul 2020 11:03:01 +0000 (13:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:23:36 +0000 (08:23 +0200)
commitfc20f2ac67b0aa31254d5363f96ed85e4506731c
tree2e7c1746afeb7f2f210b3b4f0ba50b59f68deda3
parent29c1bca537ec44e67718e3972dcfaf7db1ac97e4
memory: samsung: exynos5422-dmc: Do not ignore return code of regmap_read()

[ Upstream commit c4f16e96d8fdd62ef12898fc0965c42093bed237 ]

Check for regmap_read() return code before using the read value in
following write in exynos5_switch_timing_regs().  Pass reading error
code to the callers.

This does not introduce proper error handling for such failed reads (and
obviously regmap_write() error is still ignored) because the driver
ignored this in all places.  Therefor it only fixes reported issue while
matching current driver coding style:

       drivers/memory/samsung/exynos5422-dmc.c: In function 'exynos5_switch_timing_regs':
    >> drivers/memory/samsung/exynos5422-dmc.c:216:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/memory/samsung/exynos5422-dmc.c