/* ----------------------------------------------------------------------- */
/* SysFS interface */
-#ifdef CONFIG_SYSFS
/**
* ds1685_rtc_sysfs_battery_show - sysfs file for main battery status.
* @dev: pointer to device structure.
.attrs = ds1685_rtc_sysfs_misc_attrs,
};
-/**
- * ds1685_rtc_sysfs_register - register sysfs files.
- * @dev: pointer to device structure.
- */
-static int
-ds1685_rtc_sysfs_register(struct device *dev)
-{
- int ret = 0;
-
- ret = sysfs_create_group(&dev->kobj, &ds1685_rtc_sysfs_misc_grp);
- if (ret)
- return ret;
-
- return 0;
-}
-
-/**
- * ds1685_rtc_sysfs_unregister - unregister sysfs files.
- * @dev: pointer to device structure.
- */
-static int
-ds1685_rtc_sysfs_unregister(struct device *dev)
-{
- sysfs_remove_group(&dev->kobj, &ds1685_rtc_sysfs_misc_grp);
-
- return 0;
-}
-#endif /* CONFIG_SYSFS */
-
-
-
/* ----------------------------------------------------------------------- */
/* Driver Probe/Removal */
/* Setup complete. */
ds1685_rtc_switch_to_bank0(rtc);
-#ifdef CONFIG_SYSFS
- ret = ds1685_rtc_sysfs_register(&pdev->dev);
+ ret = rtc_add_group(rtc_dev, &ds1685_rtc_sysfs_misc_grp);
if (ret)
return ret;
-#endif
rtc_dev->nvram_old_abi = true;
nvmem_cfg.priv = rtc;
{
struct ds1685_priv *rtc = platform_get_drvdata(pdev);
-#ifdef CONFIG_SYSFS
- ds1685_rtc_sysfs_unregister(&pdev->dev);
-#endif
-
/* Read Ctrl B and clear PIE/AIE/UIE. */
rtc->write(rtc, RTC_CTRL_B,
(rtc->read(rtc, RTC_CTRL_B) &