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.

iio: resolver: ad2s1210: replace sprintf() with sysfs_emit()

Update the ad2s1210_read_label() and ad2s1210_read_event_label() functions
to use sysfs_emit() for generating labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Nuno Sá and committed by
Jonathan Cameron
7798b50e dd72a388

+15 -15
+15 -15
drivers/iio/resolver/ad2s1210.c
··· 1132 1132 { 1133 1133 if (chan->type == IIO_ANGL) { 1134 1134 if (chan->channel == 0) 1135 - return sprintf(label, "position\n"); 1135 + return sysfs_emit(label, "position\n"); 1136 1136 if (chan->channel == 1) 1137 - return sprintf(label, "tracking error\n"); 1137 + return sysfs_emit(label, "tracking error\n"); 1138 1138 } 1139 1139 if (chan->type == IIO_ANGL_VEL) 1140 - return sprintf(label, "velocity\n"); 1140 + return sysfs_emit(label, "velocity\n"); 1141 1141 if (chan->type == IIO_PHASE) 1142 - return sprintf(label, "synthetic reference\n"); 1142 + return sysfs_emit(label, "synthetic reference\n"); 1143 1143 if (chan->type == IIO_ALTVOLTAGE) { 1144 1144 if (chan->output) 1145 - return sprintf(label, "excitation\n"); 1145 + return sysfs_emit(label, "excitation\n"); 1146 1146 if (chan->channel == 0) 1147 - return sprintf(label, "monitor signal\n"); 1147 + return sysfs_emit(label, "monitor signal\n"); 1148 1148 if (chan->channel == 1) 1149 - return sprintf(label, "cosine\n"); 1149 + return sysfs_emit(label, "cosine\n"); 1150 1150 if (chan->channel == 2) 1151 - return sprintf(label, "sine\n"); 1151 + return sysfs_emit(label, "sine\n"); 1152 1152 } 1153 1153 1154 1154 return -EINVAL; ··· 1239 1239 char *label) 1240 1240 { 1241 1241 if (chan->type == IIO_ANGL) 1242 - return sprintf(label, "LOT\n"); 1242 + return sysfs_emit(label, "LOT\n"); 1243 1243 if (chan->type == IIO_ANGL_VEL) 1244 - return sprintf(label, "max tracking rate\n"); 1244 + return sysfs_emit(label, "max tracking rate\n"); 1245 1245 if (chan->type == IIO_PHASE) 1246 - return sprintf(label, "phase lock\n"); 1246 + return sysfs_emit(label, "phase lock\n"); 1247 1247 if (chan->type == IIO_ALTVOLTAGE) { 1248 1248 if (chan->channel == 0) { 1249 1249 if (type == IIO_EV_TYPE_THRESH && 1250 1250 dir == IIO_EV_DIR_FALLING) 1251 - return sprintf(label, "LOS\n"); 1251 + return sysfs_emit(label, "LOS\n"); 1252 1252 if (type == IIO_EV_TYPE_THRESH && 1253 1253 dir == IIO_EV_DIR_RISING) 1254 - return sprintf(label, "DOS overrange\n"); 1254 + return sysfs_emit(label, "DOS overrange\n"); 1255 1255 if (type == IIO_EV_TYPE_MAG) 1256 - return sprintf(label, "DOS mismatch\n"); 1256 + return sysfs_emit(label, "DOS mismatch\n"); 1257 1257 } 1258 1258 if (chan->channel == 1 || chan->channel == 2) 1259 - return sprintf(label, "clipped\n"); 1259 + return sysfs_emit(label, "clipped\n"); 1260 1260 } 1261 1261 1262 1262 return -EINVAL;