|
@@ -327,9 +327,15 @@ static int iio_device_add_event(struct iio_dev *indio_dev,
|
|
for_each_set_bit(i, mask, sizeof(*mask)*8) {
|
|
for_each_set_bit(i, mask, sizeof(*mask)*8) {
|
|
if (i >= ARRAY_SIZE(iio_ev_info_text))
|
|
if (i >= ARRAY_SIZE(iio_ev_info_text))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
- postfix = kasprintf(GFP_KERNEL, "%s_%s_%s",
|
|
|
|
- iio_ev_type_text[type], iio_ev_dir_text[dir],
|
|
|
|
- iio_ev_info_text[i]);
|
|
|
|
|
|
+ if (dir != IIO_EV_DIR_NONE)
|
|
|
|
+ postfix = kasprintf(GFP_KERNEL, "%s_%s_%s",
|
|
|
|
+ iio_ev_type_text[type],
|
|
|
|
+ iio_ev_dir_text[dir],
|
|
|
|
+ iio_ev_info_text[i]);
|
|
|
|
+ else
|
|
|
|
+ postfix = kasprintf(GFP_KERNEL, "%s_%s",
|
|
|
|
+ iio_ev_type_text[type],
|
|
|
|
+ iio_ev_info_text[i]);
|
|
if (postfix == NULL)
|
|
if (postfix == NULL)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
|
|
|