[PATCH] spi: unregister dev if master->setup fails

franck.jullien at gmail.com franck.jullien at gmail.com
Tue Jul 5 18:14:49 EDT 2011


From: Franck Jullien <franck.jullien at gmail.com>

If the device setup executed by the spi master fails,
unregister the created device.

Signed-off-by: Franck Jullien <franck.jullien at gmail.com>
---
 drivers/spi/spi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 6456897..aefb916 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -91,6 +91,7 @@ struct spi_device *spi_new_device(struct spi_master *master,
 	return proxy;
 
 fail:
+	unregister_device(&proxy->dev);
 	free(proxy);
 	return NULL;
 }
-- 
1.7.0.4




More information about the barebox mailing list