{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ad9834_state *st = iio_priv(indio_dev);
- char *str;
if (st->devid == ID_AD9833 || st->devid == ID_AD9837)
- str = "sine triangle square";
- else if (st->control & AD9834_OPBITEN)
- str = "sine";
- else
- str = "sine triangle";
-
- return sprintf(buf, "%s\n", str);
+ return sysfs_emit(buf, "sine triangle square\n");
+ if (st->control & AD9834_OPBITEN)
+ return sysfs_emit(buf, "sine\n");
+ return sysfs_emit(buf, "sine triangle\n");
}
static IIO_DEVICE_ATTR(out_altvoltage0_out0_wavetype_available, 0444,
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ad9834_state *st = iio_priv(indio_dev);
- char *str;
if (st->control & AD9834_MODE)
- str = "";
- else
- str = "square";
-
- return sprintf(buf, "%s\n", str);
+ return sysfs_emit(buf, "\n");
+ return sysfs_emit(buf, "square\n");
}
static IIO_DEVICE_ATTR(out_altvoltage0_out1_wavetype_available, 0444,