linux/drivers/rtc/rtc-ds1685.c
/**
 * ds1685_rtc_sysfs_battery_show - sysfs file for main battery status.
 * @dev: pointer to device structure.
 * @attr: pointer to device_attribute structure.
 * @buf: pointer to char array to hold the output.
 */
sysfs file for main battery status.
@dev: pointer to device structure.
@attr: pointer to device_attribute structure.
@buf: pointer to char array to hold the output.
sysfs file for main battery status . @dev : pointer to device structure . @attr : pointer to device_attribute structure . @buf : pointer to char array to hold the output .
static ssize_t
ds1685_rtc_sysfs_battery_show(struct device *dev,
			      struct device_attribute *attr, char *buf)
{
	struct ds1685_priv *rtc = dev_get_drvdata(dev);
	u8 ctrld;
	ctrld = rtc->read(rtc, RTC_CTRL_D);
	return sprintf(buf, "%s\n",
			(ctrld & RTC_CTRL_D_VRT) ? "ok" : "not ok or N/A");
}
static ssize_t ds1685_rtc_sysfs_battery_show ( struct device * dev , struct device_attribute * attr , char * buf ) { struct ds1685_priv * rtc = dev_get_drvdata ( dev ) ; u8 ctrld ; ctrld = rtc -> read ( rtc , RTC_CTRL_D ) ; return sprintf ( buf , " \n " , ( ctrld & RTC_CTRL_D_VRT ) ? " " : " " ) ; }
ds1685_rtc_sysfs_battery_show - sysfs file for main battery status.
ds1685_rtc_sysfs_battery_show - sysfs file for main battery status .