bus: imx-weim: Fix the "fsl,weim-cs-gpr" lookup method
Fabio Estevam
reviewerPATCH v2 1/1 bus: imx-weim: Fix the "fsl,weim-cs-gpr" lookup method
From: Fabio Estevam <[email protected]>
Commit 1be81ea5860744520 ("ARM: dts: imx6: Add imx-weim parameters to dtsi's") causes the following probe error when the weim node is not present on the board dts (such as imx6q-sabresd):
imx-weim 21b8000.weim: Invalid 'ranges' configuration
imx-weim: probe of 21b8000.weim failed with error -22
As the "fsl,weim-cs-gpr" property changed the location from the individual board dts "&weim" node to the common dtsi node we can no longer reach it via syscon_regmap_lookup_by_phandle(), so use syscon_regmap_lookup_by_compatible() instead, which will successfully find the "fsl,weim-cs-gpr" property.
---
Changes since v1:
- Fix copy and paste error of the error message
- Add Fixes tag
drivers/bus/imx-weim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/imx-weim.c +1 -1
@@ -76,7 +76,7 @@ static int __init imx_weim_gpr_setup(struct platform_device *pdev)int cs =0 ;int i =0 ; - gpr =syscon_regmap_lookup_by_phandle (np,"fsl,weim-cs-gpr" ); + gpr =syscon_regmap_lookup_by_compatible ("fsl,weim-cs-gpr" );if (IS_ERR (gpr)) {dev_dbg (&pdev->dev,"failed to find weim-cs-gpr\n" );return 0 ;
Signature · 1 line
2.7.4
Shawn Guo
NAKPATCH v2 1/1 bus: imx-weim: Fix the "fsl, weim-cs-gpr" lookup method
Quoted 9 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Commit
1be81ea5860744520("ARM: dts: imx6: Add imx-weim parameters to dtsi's") causes the following probe error when the weim node is not present on the board dts (such as imx6q-sabresd):imx-weim 21b8000.weim: Invalid 'ranges' configuration
imx-weim: probe of 21b8000.weim failed with error -22
Quoted 8 lines
As the "fsl,weim-cs-gpr" property changed the location from the individual board dts "&weim" node to the common dtsi node we can no longer reach it via
syscon_regmap_lookup_by_phandle(), so usesyscon_regmap_lookup_by_compatible()instead, which will successfully find the "fsl,weim-cs-gpr" property.Fixes 1be81ea5860744520 ("ARM: dts: imx6: Add imx-weim parameters to dtsi's")Signed-off-by Fabio Estevam <[email protected]>
NACK.
Quoted 13 lines
---
Changes since v1:
- Fix copy and paste error of the error message
- Add Fixes tagdrivers/bus/imx-weim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/bus/imx-weim.c +0
-0
drivers/bus/imx-weim.c static int __init imx_weim_gpr_setup(struct platform_device *pdev) · line 79
Quoted 5 lines
drivers/bus/imx-weim.c +1
-1@@ -76,7 +76,7 @@ static int __init imx_weim_gpr_setup(struct platform_device *pdev)int cs =0 ;int i =0 ; - gpr =syscon_regmap_lookup_by_phandle (np,"fsl,weim-cs-gpr" ); + gpr =syscon_regmap_lookup_by_compatible ("fsl,weim-cs-gpr" );
"fsl,weim-cs-gpr" is *not* a compatible string, while
what syscon_regmap_lookup_by_compatible() does is to find a syscon node by its compatible string.
Your understanding about how the error message comes and the fix to it are completely wrong.
Shawn
Quoted 6 lines
drivers/bus/imx-weim.c +0
-0if (IS_ERR (gpr)) {dev_dbg (&pdev->dev,"failed to find weim-cs-gpr\n" );return 0 ;Signature · 1 line
2.7.4
Fabio Estevam
reviewerPATCH v2 1/1 bus: imx-weim: Fix the "fsl, weim-cs-gpr" lookup method
Quoted 3 lines · Shawn Guo
"fsl,weim-cs-gpr" is *not* a compatible string, while
whatsyscon_regmap_lookup_by_compatible()does is to find a syscon node by its compatible string.
Ops, sorry about that. I sent a v3, which hopefully looks better.