linux/drivers/rtc/rtc-ds1685.c
/**
 * ds1685_rtc_sysfs_serial_show - sysfs file for silicon serial number.
 * @dev: pointer to device structure.
 * @attr: pointer to device_attribute structure.
 * @buf: pointer to char array to hold the output.
 */
sysfs file for silicon serial number.
@dev: pointer to device structure.
@attr: pointer to device_attribute structure.
@buf: pointer to char array to hold the output.
sysfs file for silicon serial number . @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_serial_show(struct device *dev,
			     struct device_attribute *attr, char *buf)
{
	struct ds1685_priv *rtc = dev_get_drvdata(dev);
	u8 ssn[8];
	ds1685_rtc_switch_to_bank1(rtc);
	ds1685_rtc_get_ssn(rtc, ssn);
	ds1685_rtc_switch_to_bank0(rtc);
	return sprintf(buf, "%8phC\n", ssn);
}
static ssize_t ds1685_rtc_sysfs_serial_show ( struct device * dev , struct device_attribute * attr , char * buf ) { struct ds1685_priv * rtc = dev_get_drvdata ( dev ) ; u8 ssn [ 8 ] ; ds1685_rtc_switch_to_bank1 ( rtc ) ; ds1685_rtc_get_ssn ( rtc , ssn ) ; ds1685_rtc_switch_to_bank0 ( rtc ) ; return sprintf ( buf , " \n " , ssn ) ; }
ds1685_rtc_sysfs_serial_show - sysfs file for silicon serial number.
ds1685_rtc_sysfs_serial_show - sysfs file for silicon serial number .