1
0
Fork 0

drivers: soc: sunxi: fix error processing on base address when claiming

When claiming SRAM, if the base is set to an error, it means that the
SRAM controller has been probed, but failed to remap the controller
memory zone. If the base is zero, thus the SRAM controller should be not
probed at all, and it should return -EPROBE_DEFER. However, currently we
returned -EPROBE_DEFER in the former situation, and ignored the latter
situation (which will lead to the kernel to panic).

Fix the behavior on abnormal base address processing when claiming.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Fixes: 4af34b572a ("drivers: soc: sunxi: Introduce SoC driver to map
		      SRAMs")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
hifive-unleashed-5.1
Icenowy Zheng 2017-08-09 16:56:25 +08:00 committed by Chen-Yu Tsai
parent 189f02826c
commit 2262a65f0b
1 changed files with 3 additions and 0 deletions

View File

@ -190,6 +190,9 @@ int sunxi_sram_claim(struct device *dev)
u32 val, mask;
if (IS_ERR(base))
return PTR_ERR(base);
if (!base)
return -EPROBE_DEFER;
if (!dev || !dev->of_node)