[PATCH] RTC: handle sysfs errors

Signed-off-by: Jeff Garzik <jeff@garzik.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Jeff Garzik
2006-12-06 20:35:34 -08:00
committed by Linus Torvalds
parent bfc7ee2070
commit 91046a8a69
4 changed files with 35 additions and 7 deletions

View File

@@ -123,11 +123,18 @@ static int test_probe(struct platform_device *plat_dev)
err = PTR_ERR(rtc);
return err;
}
device_create_file(&plat_dev->dev, &dev_attr_irq);
err = device_create_file(&plat_dev->dev, &dev_attr_irq);
if (err)
goto err;
platform_set_drvdata(plat_dev, rtc);
return 0;
err:
rtc_device_unregister(rtc);
return err;
}
static int __devexit test_remove(struct platform_device *plat_dev)