[PATCH 05/18] spi: core: don't ignore register_device failures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add missing error handling for spi_new_device().

Signed-off-by: Marco Felsch <m.felsch@xxxxxxxxxxxxxx>
---
 drivers/spi/spi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 0694f14c39..8421d9d7c1 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -103,7 +103,9 @@ struct spi_device *spi_new_device(struct spi_controller *ctrl,
 		goto fail;
 	}
 
-	register_device(&proxy->dev);
+	status = register_device(&proxy->dev);
+	if (status)
+		goto fail;
 
 	return proxy;
 fail:
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux