@@ -572,7 +572,7 @@ static ssize_t elan_sysfs_read_fw_checksum(struct device *dev,
572572 struct i2c_client * client = to_i2c_client (dev );
573573 struct elan_tp_data * data = i2c_get_clientdata (client );
574574
575- return sprintf (buf , "0x%04x\n" , data -> fw_checksum );
575+ return sysfs_emit (buf , "0x%04x\n" , data -> fw_checksum );
576576}
577577
578578static ssize_t elan_sysfs_read_product_id (struct device * dev ,
@@ -582,8 +582,8 @@ static ssize_t elan_sysfs_read_product_id(struct device *dev,
582582 struct i2c_client * client = to_i2c_client (dev );
583583 struct elan_tp_data * data = i2c_get_clientdata (client );
584584
585- return sprintf (buf , ETP_PRODUCT_ID_FORMAT_STRING "\n" ,
586- data -> product_id );
585+ return sysfs_emit (buf , ETP_PRODUCT_ID_FORMAT_STRING "\n" ,
586+ data -> product_id );
587587}
588588
589589static ssize_t elan_sysfs_read_fw_ver (struct device * dev ,
@@ -593,7 +593,7 @@ static ssize_t elan_sysfs_read_fw_ver(struct device *dev,
593593 struct i2c_client * client = to_i2c_client (dev );
594594 struct elan_tp_data * data = i2c_get_clientdata (client );
595595
596- return sprintf (buf , "%d.0\n" , data -> fw_version );
596+ return sysfs_emit (buf , "%d.0\n" , data -> fw_version );
597597}
598598
599599static ssize_t elan_sysfs_read_sm_ver (struct device * dev ,
@@ -603,7 +603,7 @@ static ssize_t elan_sysfs_read_sm_ver(struct device *dev,
603603 struct i2c_client * client = to_i2c_client (dev );
604604 struct elan_tp_data * data = i2c_get_clientdata (client );
605605
606- return sprintf (buf , "%d.0\n" , data -> sm_version );
606+ return sysfs_emit (buf , "%d.0\n" , data -> sm_version );
607607}
608608
609609static ssize_t elan_sysfs_read_iap_ver (struct device * dev ,
@@ -613,7 +613,7 @@ static ssize_t elan_sysfs_read_iap_ver(struct device *dev,
613613 struct i2c_client * client = to_i2c_client (dev );
614614 struct elan_tp_data * data = i2c_get_clientdata (client );
615615
616- return sprintf (buf , "%d.0\n" , data -> iap_version );
616+ return sysfs_emit (buf , "%d.0\n" , data -> iap_version );
617617}
618618
619619static ssize_t elan_sysfs_update_fw (struct device * dev ,
@@ -754,7 +754,7 @@ static ssize_t elan_sysfs_read_mode(struct device *dev,
754754 if (error )
755755 return error ;
756756
757- return sprintf (buf , "%d\n" , (int )mode );
757+ return sysfs_emit (buf , "%d\n" , (int )mode );
758758}
759759
760760static DEVICE_ATTR (product_id , S_IRUGO , elan_sysfs_read_product_id , NULL) ;
@@ -858,7 +858,7 @@ static ssize_t min_show(struct device *dev,
858858 goto out ;
859859 }
860860
861- retval = snprintf (buf , PAGE_SIZE , "%d" , data -> min_baseline );
861+ retval = sysfs_emit (buf , "%d" , data -> min_baseline );
862862
863863out :
864864 mutex_unlock (& data -> sysfs_mutex );
@@ -881,7 +881,7 @@ static ssize_t max_show(struct device *dev,
881881 goto out ;
882882 }
883883
884- retval = snprintf (buf , PAGE_SIZE , "%d" , data -> max_baseline );
884+ retval = sysfs_emit (buf , "%d" , data -> max_baseline );
885885
886886out :
887887 mutex_unlock (& data -> sysfs_mutex );
0 commit comments