[PATCH 1/3] eeprom: at25: check return value of devfs_create

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Mon May 30 02:39:51 PDT 2016


Also only emit the message that the device was probed when it
actually was.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
 drivers/eeprom/at25.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/eeprom/at25.c b/drivers/eeprom/at25.c
index 9f054d00b459..f7f8368c4b45 100644
--- a/drivers/eeprom/at25.c
+++ b/drivers/eeprom/at25.c
@@ -354,8 +354,11 @@ static int at25_probe(struct device_d *dev)
 		goto fail;
 	}
 
+	err = devfs_create(&at25->cdev);
+	if (err)
+		goto fail;
+
 	dev_dbg(dev, "%s probed\n", at25->cdev.name);
-	devfs_create(&at25->cdev);
 	of_parse_partitions(&at25->cdev, dev->device_node);
 	return 0;
 
-- 
2.8.1




More information about the barebox mailing list