mtd: hyperbus: Add proper error message for missing compatible

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>
This commit is contained in:
Dirk Behme 2020-02-04 08:10:43 +01:00 committed by Vignesh Raghavendra
parent 11a48a5a18
commit cb6176ef25

View 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;