summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2006-12-06 20:39:05 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 08:39:42 -0800
commit7b92ff01c2cd21567c3342c1c77d5e4f1a2bd699 (patch)
tree1199e6eefd7bd544321a7f12560f34db1a1f3516
parent95362fa90312ff2d52c0b4d42412cd7ceeb3b89b (diff)
[PATCH] spi: check platform_device_register_simple() error
Check the return value of platform_device_register_simple(). Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/spi/spi_butterfly.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/spi/spi_butterfly.c b/drivers/spi/spi_butterfly.c
index c2f601f8e4f2..312987a03210 100644
--- a/drivers/spi/spi_butterfly.c
+++ b/drivers/spi/spi_butterfly.c
@@ -251,6 +251,8 @@ static void butterfly_attach(struct parport *p)
* setting up a platform device like this is an ugly kluge...
*/
pdev = platform_device_register_simple("butterfly", -1, NULL, 0);
+ if (IS_ERR(pdev))
+ return;
master = spi_alloc_master(&pdev->dev, sizeof *pp);
if (!master) {