diff mbox series

[v2,3/4] memory: omap-gpmc: check for nand node name instead of just compatibility

Message ID 20211208124611.16843-3-rogerq@kernel.org
State New
Headers show
Series [v2,1/4] dt-bindings: memory-controllers: ti,gpmc: Add compatible for AM64 | expand

Commit Message

Roger Quadros Dec. 8, 2021, 12:46 p.m. UTC
We have added new compatibles for controller so just checking for
"ti,omap2-nand" compatible is not enough. Check for "nand" node name
as well.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
 drivers/memory/omap-gpmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Rob Herring (Arm) Dec. 15, 2021, 4:03 p.m. UTC | #1
On Wed, Dec 08, 2021 at 02:46:10PM +0200, Roger Quadros wrote:
> We have added new compatibles for controller so just checking for
> "ti,omap2-nand" compatible is not enough. Check for "nand" node name
> as well.
> 
> Signed-off-by: Roger Quadros <rogerq@kernel.org>
> ---
>  drivers/memory/omap-gpmc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
> index 624153048182..9f0062a262db 100644
> --- a/drivers/memory/omap-gpmc.c
> +++ b/drivers/memory/omap-gpmc.c
> @@ -2183,7 +2183,8 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
>  		}
>  	}
>  
> -	if (of_device_is_compatible(child, "ti,omap2-nand")) {
> +	if (of_device_is_compatible(child, "ti,omap2-nand") ||
> +	    of_node_name_eq(child, "nand")) {

It would be better to stick with compatible strings. You can match 
against a match table. This should be 'nand-controller' really if this 
binding had a proper split between the controller and nand chips.

Rob
Roger Quadros Dec. 17, 2021, 7:35 a.m. UTC | #2
Hi Rob,

On 15/12/2021 18:03, Rob Herring wrote:
> On Wed, Dec 08, 2021 at 02:46:10PM +0200, Roger Quadros wrote:
>> We have added new compatibles for controller so just checking for
>> "ti,omap2-nand" compatible is not enough. Check for "nand" node name
>> as well.
>>
>> Signed-off-by: Roger Quadros <rogerq@kernel.org>
>> ---
>>  drivers/memory/omap-gpmc.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
>> index 624153048182..9f0062a262db 100644
>> --- a/drivers/memory/omap-gpmc.c
>> +++ b/drivers/memory/omap-gpmc.c
>> @@ -2183,7 +2183,8 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
>>  		}
>>  	}
>>  
>> -	if (of_device_is_compatible(child, "ti,omap2-nand")) {
>> +	if (of_device_is_compatible(child, "ti,omap2-nand") ||
>> +	    of_node_name_eq(child, "nand")) {
> 
> It would be better to stick with compatible strings. You can match 
> against a match table. This should be 'nand-controller' really if this 
> binding had a proper split between the controller and nand chips.

OK. I will change this to use compatible strings using a match table.

The 'nand-controller' + 'nand' chip change will be done in a separate series
sometime later.

cheers,
-roger
diff mbox series

Patch

diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index 624153048182..9f0062a262db 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -2183,7 +2183,8 @@  static int gpmc_probe_generic_child(struct platform_device *pdev,
 		}
 	}
 
-	if (of_device_is_compatible(child, "ti,omap2-nand")) {
+	if (of_device_is_compatible(child, "ti,omap2-nand") ||
+	    of_node_name_eq(child, "nand")) {
 		/* NAND specific setup */
 		val = 8;
 		of_property_read_u32(child, "nand-bus-width", &val);