mtd: hyperbus: Add proper error message for missing compatible
authorDirk Behme <dirk.behme@de.bosch.com>
Tue, 4 Feb 2020 07:10:43 +0000 (08:10 +0100)
committerVignesh Raghavendra <vigneshr@ti.com>
Tue, 3 Mar 2020 04:42:39 +0000 (10:12 +0530)
In case the compatible "cypress,hyperflash" is not given
output a proper error message.

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
drivers/mtd/hyperbus/hyperbus-core.c

index 6af9ea3..c1916cc 100644 (file)
@@ -73,8 +73,10 @@ int hyperbus_register_device(struct hyperbus_device *hbdev)
 
        np = hbdev->np;
        ctlr = hbdev->ctlr;
-       if (!of_device_is_compatible(np, "cypress,hyperflash"))
+       if (!of_device_is_compatible(np, "cypress,hyperflash")) {
+               dev_err(ctlr->dev, "\"cypress,hyperflash\" compatible missing\n");
                return -ENODEV;
+       }
 
        hbdev->memtype = HYPERFLASH;