The patch titled RTC: handle sysfs errors has been added to the -mm tree. Its filename is rtc-handle-sysfs-errors.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: RTC: handle sysfs errors From: Jeff Garzik <jeff@xxxxxxxxxx> Signed-off-by: Jeff Garzik <jeff@xxxxxxxxxx> Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/rtc/rtc-ds1672.c | 9 +++++++-- drivers/rtc/rtc-rs5c372.c | 12 ++++++++++-- drivers/rtc/rtc-test.c | 9 ++++++++- drivers/rtc/rtc-x1205.c | 12 ++++++++++-- 4 files changed, 35 insertions(+), 7 deletions(-) diff -puN drivers/rtc/rtc-ds1672.c~rtc-handle-sysfs-errors drivers/rtc/rtc-ds1672.c --- a/drivers/rtc/rtc-ds1672.c~rtc-handle-sysfs-errors +++ a/drivers/rtc/rtc-ds1672.c @@ -237,17 +237,22 @@ static int ds1672_probe(struct i2c_adapt /* read control register */ err = ds1672_get_control(client, &control); if (err) - goto exit_detach; + goto exit_devreg; if (control & DS1672_REG_CONTROL_EOSC) dev_warn(&client->dev, "Oscillator not enabled. " "Set time to enable.\n"); /* Register sysfs hooks */ - device_create_file(&client->dev, &dev_attr_control); + err = device_create_file(&client->dev, &dev_attr_control); + if (err) + goto exit_devreg; return 0; +exit_devreg: + rtc_device_unregister(rtc); + exit_detach: i2c_detach_client(client); diff -puN drivers/rtc/rtc-rs5c372.c~rtc-handle-sysfs-errors drivers/rtc/rtc-rs5c372.c --- a/drivers/rtc/rtc-rs5c372.c~rtc-handle-sysfs-errors +++ a/drivers/rtc/rtc-rs5c372.c @@ -238,11 +238,19 @@ static int rs5c372_probe(struct i2c_adap i2c_set_clientdata(client, rtc); - device_create_file(&client->dev, &dev_attr_trim); - device_create_file(&client->dev, &dev_attr_osc); + err = device_create_file(&client->dev, &dev_attr_trim); + if (err) goto exit_devreg; + err = device_create_file(&client->dev, &dev_attr_osc); + if (err) goto exit_trim; return 0; +exit_trim: + device_remove_file(&client->dev, &dev_attr_trim); + +exit_devreg: + rtc_device_unregister(rtc); + exit_detach: i2c_detach_client(client); diff -puN drivers/rtc/rtc-test.c~rtc-handle-sysfs-errors drivers/rtc/rtc-test.c --- a/drivers/rtc/rtc-test.c~rtc-handle-sysfs-errors +++ a/drivers/rtc/rtc-test.c @@ -121,11 +121,18 @@ static int test_probe(struct platform_de 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) diff -puN drivers/rtc/rtc-x1205.c~rtc-handle-sysfs-errors drivers/rtc/rtc-x1205.c --- a/drivers/rtc/rtc-x1205.c~rtc-handle-sysfs-errors +++ a/drivers/rtc/rtc-x1205.c @@ -562,11 +562,19 @@ static int x1205_probe(struct i2c_adapte else dev_err(&client->dev, "couldn't read status\n"); - device_create_file(&client->dev, &dev_attr_atrim); - device_create_file(&client->dev, &dev_attr_dtrim); + err = device_create_file(&client->dev, &dev_attr_atrim); + if (err) goto exit_devreg; + err = device_create_file(&client->dev, &dev_attr_dtrim); + if (err) goto exit_atrim; return 0; +exit_atrim: + device_remove_file(&client->dev, &dev_attr_atrim); + +exit_devreg: + rtc_device_unregister(rtc); + exit_detach: i2c_detach_client(client); _ Patches currently in -mm which might be from jeff@xxxxxxxxxx are origin.patch fix-up-a-multitude-of-acpi-compiler-warnings-on-x86_64.patch cpufreq-handle-sysfs-errors.patch drm-fix-error-returns-sysfs-error-handling.patch git-dvb.patch drivers-media-video-handle-sysfs-errors.patch i2c-buses-scx200_acb-handle-pci-errors.patch input-handle-sysfs-errors.patch input-drivers-handle-sysfs-errors.patch git-libata-all.patch ata-must-depend-on-block.patch via-pata-controller-xfer-fixes.patch ahci-ati-sb600-sata-support-for-various-modes.patch drivers-mmcmisc-handle-pci-errors-on-resume.patch git-mtd.patch git-netdev-all.patch libphy-dont-do-that.patch update-smc91x-driver-with-arm-versatile-board-info.patch 8139too-force-media-setting-fix.patch tulip-fix-shutdown-dma-irq-race.patch drivers-dma-handle-sysfs-errors.patch atm-firestream-handle-thrown-error.patch wan-pc300-handle-propagate-minor-errors.patch pcmcia-handle-sysfs-pci-errors.patch r8169-driver-corega-support-patch.patch git-pciseg.patch scsi-minor-bug-fixes-and-cleanups.patch mpt-fusion-handle-pci-layer-error-on-resume.patch git-watchdog.patch airo-suspend-fix.patch drivers-led-handle-sysfs-errors.patch i2o-handle-a-few-sysfs-errors.patch fs-partitions-check-add-sysfs-error-handling.patch rtc-fix-printk-of-64-bit-res-on-32-bit-platform.patch i2o-more-error-checking.patch pnp-handle-sysfs-errors.patch rtc-handle-sysfs-errors.patch sound-oss-emu10k1-handle-userspace-copy-errors.patch scsi-aha1740-handle-scsi-api-errors.patch scsi-qla2xxx-handle-sysfs-errors.patch serial-handle-pci_enable_device-failure-upon-resume.patch spi-improve-sysfs-compiler-complaint-handling.patch usb-gadget-net2280-handle-sysfs-errors.patch net-atm-handle-sysfs-errors.patch net-bluetooth-handle-sysfs-errors.patch isdn-fix-drivers-by-handling-errors-thrown-by-readstat.patch isdn-check-for-userspace-copy-faults.patch atyfb-rivafb-minor-fixes.patch md-conditionalize-some-code.patch git-gccbug.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html