Revert "net: ethernet: bgmac: Use devm_platform_ioremap_resource_byname"
Subsystems (3)
PATCH 1/1 Revert "net: ethernet: bgmac: Use devm_platform_ioremap_resource_byname"
This reverts commit 3710e80952cf2dc48257ac9f145b117b5f74e0a5.
Since idm_base and nicpm_base are still optional resources not present on all platforms, this breaks the driver for everything except Northstar 2 (which has both).
The same change was already reverted once with 755f5738ff98 ("net:
broadcom: fix a mistake about ioremap resource").
So let's do it again.
--- .../net/ethernet/broadcom/bgmac-platform.c | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
drivers/net/ethernet/broadcom/bgmac-platform.c +14 -7
@@ -172,6 +172,7 @@ static int bgmac_probe(struct platform_device *pdev) {struct device_node *np = pdev->dev.of_node;struct bgmac *bgmac; +struct resource *regs;int ret; bgmac =bgmac_alloc (&pdev->dev);
@@ -208,15 +209,21 @@ static int bgmac_probe(struct platform_device *pdev)if (IS_ERR (bgmac->plat.base))return PTR_ERR (bgmac->plat.base); - bgmac->plat.idm_base =devm_platform_ioremap_resource_byname (pdev,"idm_base" ); -if (IS_ERR (bgmac->plat.idm_base)) -return PTR_ERR (bgmac->plat.idm_base); -else + regs =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"idm_base" ); +if (regs) { + bgmac->plat.idm_base =devm_ioremap_resource (&pdev->dev, regs); +if (IS_ERR (bgmac->plat.idm_base)) +return PTR_ERR (bgmac->plat.idm_base); bgmac->feature_flags &= ~BGMAC_FEAT_IDM_MASK ; + } - bgmac->plat.nicpm_base =devm_platform_ioremap_resource_byname (pdev,"nicpm_base" ); -if (IS_ERR (bgmac->plat.nicpm_base)) -return PTR_ERR (bgmac->plat.nicpm_base); + regs =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"nicpm_base" ); +if (regs) { + bgmac->plat.nicpm_base =devm_ioremap_resource (&pdev->dev, + regs); +if (IS_ERR (bgmac->plat.nicpm_base)) +return PTR_ERR (bgmac->plat.nicpm_base); + } bgmac->read = platform_bgmac_read; bgmac->write = platform_bgmac_write;
Signature · 1 line
2.25.1
Quoted 10 lines · Jonas Gorski
This reverts commit
3710e80952cf2dc48257ac9f145b117b5f74e0a5.Since
idm_baseandnicpm_baseare still optional resources not present on all platforms, this breaks the driver for everything except Northstar 2 (which has both).The same change was already reverted once with
755f5738ff98("net:
broadcom: fix a mistake about ioremap resource").So let's do it again.
Hi Jonas
It is worth adding a comment in the code about them being optional. It seems like bot handlers are dumber than the bots they use, but they might read a comment and not make the same mistake a 3rd time.
Andrew
Hi Andrew,
Quoted 11 lines · Andrew Lunn
Quoted 9 lines · Jonas Gorski
This reverts commit
3710e80952cf2dc48257ac9f145b117b5f74e0a5.Since
idm_baseandnicpm_baseare still optional resources not present on all platforms, this breaks the driver for everything except Northstar 2 (which has both).The same change was already reverted once with
755f5738ff98("net:
broadcom: fix a mistake about ioremap resource").
Quoted 7 lines
Quoted 1 line
So let's do it again.
Hi Jonas
It is worth adding a comment in the code about them being optional. It seems like bot handlers are dumber than the bots they use, but they might read a comment and not make the same mistake a 3rd time.
Sounds reasonable, will spin a v2 with a comment added.
Regards
Jonas
Quoted 16 lines · Jonas Gorski
Hi Andrew,
Quoted 13 lines · Andrew Lunn
Quoted 10 lines · Jonas Gorski
This reverts commit
3710e80952cf2dc48257ac9f145b117b5f74e0a5.Since
idm_baseandnicpm_baseare still optional resources not present on all platforms, this breaks the driver for everything except Northstar 2 (which has both).The same change was already reverted once with
755f5738ff98("net:
broadcom: fix a mistake about ioremap resource").So let's do it again.
Quoted 7 lines
Quoted 5 lines
Hi Jonas
It is worth adding a comment in the code about them being optional. It seems like bot handlers are dumber than the bots they use, but they might read a comment and not make the same mistake a 3rd time.
Sounds reasonable, will spin a v2 with a comment added.
I just hit that problem as well refreshing my Northstar Plus to boot net-next, are you going to submit this patch in the next few days? Thanks!
Signature · 1 line
Florian
Quoted 19 lines · Florian Fainelli
Quoted 18 lines · Jonas Gorski
Hi Andrew,
Quoted 15 lines · Andrew Lunn
Quoted 10 lines · Jonas Gorski
This reverts commit
3710e80952cf2dc48257ac9f145b117b5f74e0a5.Since
idm_baseandnicpm_baseare still optional resources not present on all platforms, this breaks the driver for everything except Northstar 2 (which has both).The same change was already reverted once with
755f5738ff98("net:
broadcom: fix a mistake about ioremap resource").So let's do it again.
Hi Jonas
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
It is worth adding a comment in the code about them being optional. It seems like bot handlers are dumber than the bots they use, but they might read a comment and not make the same mistake a 3rd time.
Sounds reasonable, will spin a v2 with a comment added.
I just hit that problem as well refreshing my Northstar Plus to boot net-next, are you going to submit this patch in the next few days? Thanks!
Ah sorry, got sidetracked by a nasty security issue in our software. Will do so later today.
Regards
Jonas
Quoted 6 lines · Jonas Gorski
This reverts commit
3710e80952cf2dc48257ac9f145b117b5f74e0a5.Since
idm_baseandnicpm_baseare still optional resources not present on all platforms, this breaks the driver for everything except Northstar 2 (which has both).
Quoted 7 lines
The same change was already reverted once with
755f5738ff98("net:
broadcom: fix a mistake about ioremap resource").So let's do it again.
Fixes 3710e80952cf ("net: ethernet: bgmac: Use devm_platform_ioremap_resource_byname")Signed-off-by Jonas Gorski <[email protected]>
Thanks!
Signature · 1 line
Florian