Skip to content

Commit bf5cba8

Browse files
committed
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>
1 parent 4a56aea commit bf5cba8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/input/touchscreen/rohm_bu21023.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ static ssize_t swap_xy_show(struct device *dev, struct device_attribute *attr,
756756
struct i2c_client *client = to_i2c_client(dev);
757757
struct rohm_ts_data *ts = i2c_get_clientdata(client);
758758

759-
return sprintf(buf, "%d\n", !!(ts->setup2 & SWAP_XY));
759+
return sysfs_emit(buf, "%d\n", !!(ts->setup2 & SWAP_XY));
760760
}
761761

762762
static ssize_t swap_xy_store(struct device *dev, struct device_attribute *attr,
@@ -781,7 +781,7 @@ static ssize_t inv_x_show(struct device *dev, struct device_attribute *attr,
781781
struct i2c_client *client = to_i2c_client(dev);
782782
struct rohm_ts_data *ts = i2c_get_clientdata(client);
783783

784-
return sprintf(buf, "%d\n", !!(ts->setup2 & INV_X));
784+
return sysfs_emit(buf, "%d\n", !!(ts->setup2 & INV_X));
785785
}
786786

787787
static ssize_t inv_x_store(struct device *dev, struct device_attribute *attr,
@@ -806,7 +806,7 @@ static ssize_t inv_y_show(struct device *dev, struct device_attribute *attr,
806806
struct i2c_client *client = to_i2c_client(dev);
807807
struct rohm_ts_data *ts = i2c_get_clientdata(client);
808808

809-
return sprintf(buf, "%d\n", !!(ts->setup2 & INV_Y));
809+
return sysfs_emit(buf, "%d\n", !!(ts->setup2 & INV_Y));
810810
}
811811

812812
static ssize_t inv_y_store(struct device *dev, struct device_attribute *attr,

0 commit comments

Comments
 (0)