diff mbox series

[v2] mtd: hyperbus: Add proper error message for missing compatible

Message ID 20200204071043.3602-1-dirk.behme@de.bosch.com
State Accepted
Delegated to: Vignesh R
Headers show
Series [v2] mtd: hyperbus: Add proper error message for missing compatible | expand

Commit Message

Behme Dirk (CM/ESO2) Feb. 4, 2020, 7:10 a.m. UTC
In case the compatible "cypress,hyperflash" is not given
output a proper error message.

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
---
Changes in v2: Use dev_err and '"'

 drivers/mtd/hyperbus/hyperbus-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Raghavendra, Vignesh March 13, 2020, 5:21 a.m. UTC | #1
On 04/02/20 12:40 pm, Dirk Behme wrote:
> In case the compatible "cypress,hyperflash" is not given
> output a proper error message.
> 
> Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>

Thanks!

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git cfi/next

Regards
Vignesh
diff mbox series

Patch

diff --git a/drivers/mtd/hyperbus/hyperbus-core.c b/drivers/mtd/hyperbus/hyperbus-core.c
index 6af9ea34117d..c1916cca1701 100644
--- a/drivers/mtd/hyperbus/hyperbus-core.c
+++ b/drivers/mtd/hyperbus/hyperbus-core.c
@@ -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;