[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>
This commit is contained in:
Akinobu Mita 2006-12-06 20:39:05 -08:00 committed by Linus Torvalds
parent 95362fa903
commit 7b92ff01c2
1 changed files with 2 additions and 0 deletions

View File

@ -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) {