[v2] memory: omap-gpmc: Make 'bank-width' property optional
diff mbox

Message ID 20171106104103.yaeccw3pfx7gznsy@lenoch
State New
Headers show

Commit Message

Ladislav Michl Nov. 6, 2017, 10:41 a.m. UTC
Error out only if both 'bank-width' and 'gpmc,device-width' are missing.
As 'bank-width' is mostly used for NOR devices and all other devices must
use 'gpmc,device-width' update the error message accordingly.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 Changes:
 v2: update commit log

 drivers/memory/omap-gpmc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Roger Quadros Nov. 7, 2017, 10:54 a.m. UTC | #1
On 06/11/17 12:41, Ladislav Michl wrote:
> Error out only if both 'bank-width' and 'gpmc,device-width' are missing.
> As 'bank-width' is mostly used for NOR devices and all other devices must
> use 'gpmc,device-width' update the error message accordingly.
> 
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>

Looks good to me. I'll queue it for v4.16. Thanks.

> ---
>  Changes:
>  v2: update commit log
> 
>  drivers/memory/omap-gpmc.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
> index 6383152e9826..90a66b3f7ae1 100644
> --- a/drivers/memory/omap-gpmc.c
> +++ b/drivers/memory/omap-gpmc.c
> @@ -2157,8 +2157,9 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
>  	} else {
>  		ret = of_property_read_u32(child, "bank-width",
>  					   &gpmc_s.device_width);
> -		if (ret < 0) {
> -			dev_err(&pdev->dev, "%pOF has no 'bank-width' property\n",
> +		if (ret < 0 && !gpmc_s.device_width) {
> +			dev_err(&pdev->dev,
> +				"%pOF has no 'gpmc,device-width' property\n",
>  				child);
>  			goto err;
>  		}
>

Patch
diff mbox

diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index 6383152e9826..90a66b3f7ae1 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -2157,8 +2157,9 @@  static int gpmc_probe_generic_child(struct platform_device *pdev,
 	} else {
 		ret = of_property_read_u32(child, "bank-width",
 					   &gpmc_s.device_width);
-		if (ret < 0) {
-			dev_err(&pdev->dev, "%pOF has no 'bank-width' property\n",
+		if (ret < 0 && !gpmc_s.device_width) {
+			dev_err(&pdev->dev,
+				"%pOF has no 'gpmc,device-width' property\n",
 				child);
 			goto err;
 		}