diff options
author | Icenowy Zheng <icenowy@aosc.io> | 2017-08-09 16:56:25 +0800 |
---|---|---|
committer | Chen-Yu Tsai <wens@csie.org> | 2017-08-18 14:30:19 +0800 |
commit | 2262a65f0bcdfe372b088d20c325c1987cec4332 (patch) | |
tree | 1a75fa9a83b368420a737c08143c744706daee78 /drivers/soc | |
parent | 189f02826cf471241070fb6ae5848206c2218b67 (diff) | |
download | talos-obmc-linux-2262a65f0bcdfe372b088d20c325c1987cec4332.tar.gz talos-obmc-linux-2262a65f0bcdfe372b088d20c325c1987cec4332.zip |
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: 4af34b572a85 ("drivers: soc: sunxi: Introduce SoC driver to map
SRAMs")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/sunxi/sunxi_sram.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c index 99e354c8f53f..c1ff7fa62cb4 100644 --- a/drivers/soc/sunxi/sunxi_sram.c +++ b/drivers/soc/sunxi/sunxi_sram.c @@ -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) |