Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: rohm_bu21023 - switch to using sysfs_emit()

sysfs_emit() is preferred over snprintf() for sysfs attribute handling.

Link: https://lore.kernel.org/r/20240609235134.614592-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+3 -3
+3 -3
drivers/input/touchscreen/rohm_bu21023.c
··· 756 756 struct i2c_client *client = to_i2c_client(dev); 757 757 struct rohm_ts_data *ts = i2c_get_clientdata(client); 758 758 759 - return sprintf(buf, "%d\n", !!(ts->setup2 & SWAP_XY)); 759 + return sysfs_emit(buf, "%d\n", !!(ts->setup2 & SWAP_XY)); 760 760 } 761 761 762 762 static ssize_t swap_xy_store(struct device *dev, struct device_attribute *attr, ··· 781 781 struct i2c_client *client = to_i2c_client(dev); 782 782 struct rohm_ts_data *ts = i2c_get_clientdata(client); 783 783 784 - return sprintf(buf, "%d\n", !!(ts->setup2 & INV_X)); 784 + return sysfs_emit(buf, "%d\n", !!(ts->setup2 & INV_X)); 785 785 } 786 786 787 787 static ssize_t inv_x_store(struct device *dev, struct device_attribute *attr, ··· 806 806 struct i2c_client *client = to_i2c_client(dev); 807 807 struct rohm_ts_data *ts = i2c_get_clientdata(client); 808 808 809 - return sprintf(buf, "%d\n", !!(ts->setup2 & INV_Y)); 809 + return sysfs_emit(buf, "%d\n", !!(ts->setup2 & INV_Y)); 810 810 } 811 811 812 812 static ssize_t inv_y_store(struct device *dev, struct device_attribute *attr,