* [PATCH] gpio: eic-sprd: break loop when getting NULL device resource
@ 2020-12-09 5:51 Chunyan Zhang
2020-12-09 8:42 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Chunyan Zhang @ 2020-12-09 5:51 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: linux-gpio, linux-kernel, Orson Zhai, Baolin Wang, Chunyan Zhang,
Chunyan Zhang
From: Chunyan Zhang <chunyan.zhang@unisoc.com>
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: 25518e024e3a ("gpio: Add Spreadtrum EIC driver support")
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
---
drivers/gpio/gpio-eic-sprd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
index ad61daf6c212..865ab2b34fdd 100644
--- a/drivers/gpio/gpio-eic-sprd.c
+++ b/drivers/gpio/gpio-eic-sprd.c
@@ -598,7 +598,7 @@ static int sprd_eic_probe(struct platform_device *pdev)
*/
res = platform_get_resource(pdev, IORESOURCE_MEM, i);
if (!res)
- continue;
+ break;
sprd_eic->base[i] = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(sprd_eic->base[i]))
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gpio: eic-sprd: break loop when getting NULL device resource
2020-12-09 5:51 [PATCH] gpio: eic-sprd: break loop when getting NULL device resource Chunyan Zhang
@ 2020-12-09 8:42 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2020-12-09 8:42 UTC (permalink / raw)
To: Chunyan Zhang
Cc: Bartosz Golaszewski, open list:GPIO SUBSYSTEM,
linux-kernel@vger.kernel.org, Orson Zhai, Baolin Wang,
Chunyan Zhang
On Wed, Dec 9, 2020 at 6:51 AM Chunyan Zhang <zhang.lyra@gmail.com> wrote:
> 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: 25518e024e3a ("gpio: Add Spreadtrum EIC driver support")
> Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Patch applied for fixes!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-09 8:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-09 5:51 [PATCH] gpio: eic-sprd: break loop when getting NULL device resource Chunyan Zhang
2020-12-09 8:42 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).