]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: eic-sprd: break loop when getting NULL device resource
authorChunyan Zhang <chunyan.zhang@unisoc.com>
Wed, 9 Dec 2020 05:51:06 +0000 (13:51 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 9 Dec 2020 08:41:49 +0000 (09:41 +0100)
commit8e44a74b1ef60e28627dc641a91dc6a2da1eb1b5
tree956cd786390a72718d09d59d0a7518fd15f67e1e
parent4f08e6b8eda347649e1707c5406aa9d1d5affaf3
gpio: eic-sprd: break loop when getting NULL device resource

EIC controller have unfixed numbers of banks on different Spreadtrum SoCs,
and each bank has its own base address, the loop of getting there base
address in driver should break if the resource gotten via
platform_get_resource() is NULL already. The later ones would be all NULL
even if the loop continues.

Fixes: c0ff3483b6ec ("gpio: Add Spreadtrum EIC driver support")
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Link: https://lore.kernel.org/r/20201209055106.840100-1-zhang.lyra@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-eic-sprd.c