memory: omap-gpmc: Make 'bank-width' property optional
authorLadislav Michl <ladis@linux-mips.org>
Mon, 6 Nov 2017 10:41:04 +0000 (11:41 +0100)
committerRoger Quadros <rogerq@ti.com>
Fri, 1 Dec 2017 13:37:49 +0000 (15:37 +0200)
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>
Signed-off-by: Roger Quadros <rogerq@ti.com>
drivers/memory/omap-gpmc.c

index a385a35c7de92c0b5b1050a7556e084b305314de..0e30ee1c86777e5994cb77bc8a0f0003aca475ec 100644 (file)
@@ -2077,8 +2077,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;
                }