Skip to content

Commit 4ed7d7d

Browse files
baolin-wanglinusw
authored andcommitted
Revert "gpio: eic-sprd: Use devm_platform_ioremap_resource()"
This reverts commit 0f5cb8c. This commit will cause below warnings, since our EIC controller can support differnt banks on different Spreadtrum SoCs, and each bank has its own base address, we will get invalid resource warning if the bank number is less than SPRD_EIC_MAX_BANK on some Spreadtrum SoCs. So we should not use devm_platform_ioremap_resource() here to remove the warnings. [ 1.118508] sprd-eic 40210000.gpio: invalid resource [ 1.118535] sprd-eic 40210000.gpio: invalid resource [ 1.119034] sprd-eic 40210080.gpio: invalid resource [ 1.119055] sprd-eic 40210080.gpio: invalid resource [ 1.119462] sprd-eic 402100a0.gpio: invalid resource [ 1.119482] sprd-eic 402100a0.gpio: invalid resource [ 1.119893] sprd-eic 402100c0.gpio: invalid resource [ 1.119913] sprd-eic 402100c0.gpio: invalid resource Signed-off-by: Baolin Wang <[email protected]> Link: https://lore.kernel.org/r/8d3579f4b49bb675dc805035960f24852898be28.1585734060.git.baolin.wang7@gmail.com Signed-off-by: Linus Walleij <[email protected]>
1 parent d6471d6 commit 4ed7d7d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/gpio/gpio-eic-sprd.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ static int sprd_eic_probe(struct platform_device *pdev)
569569
const struct sprd_eic_variant_data *pdata;
570570
struct gpio_irq_chip *irq;
571571
struct sprd_eic *sprd_eic;
572+
struct resource *res;
572573
int ret, i;
573574

574575
pdata = of_device_get_match_data(&pdev->dev);
@@ -595,9 +596,13 @@ static int sprd_eic_probe(struct platform_device *pdev)
595596
* have one bank EIC, thus base[1] and base[2] can be
596597
* optional.
597598
*/
598-
sprd_eic->base[i] = devm_platform_ioremap_resource(pdev, i);
599-
if (IS_ERR(sprd_eic->base[i]))
599+
res = platform_get_resource(pdev, IORESOURCE_MEM, i);
600+
if (!res)
600601
continue;
602+
603+
sprd_eic->base[i] = devm_ioremap_resource(&pdev->dev, res);
604+
if (IS_ERR(sprd_eic->base[i]))
605+
return PTR_ERR(sprd_eic->base[i]);
601606
}
602607

603608
sprd_eic->chip.label = sprd_eic_label_name[sprd_eic->type];

0 commit comments

Comments
 (0)