Skip to content

Commit

Permalink
iio:drop IIO_ST macro
Browse files Browse the repository at this point in the history
This macro no longer allows all the elements of the scan_type structure
to be set.  Missinterpretation of the parameters also caused a couple of
recent bugs.  No mainline drivers now use this macro so drop it.

Signed-off-by: Jonathan Cameron <[email protected]>
  • Loading branch information
jic23 committed Feb 15, 2014
1 parent 33be5fd commit 07d4655
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions include/linux/iio/iio.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,16 @@ static inline bool iio_channel_has_info(const struct iio_chan_spec *chan,
(chan->info_mask_shared_by_all & BIT(type));
}

#define IIO_ST(si, rb, sb, sh) \
{ .sign = si, .realbits = rb, .storagebits = sb, .shift = sh }

#define IIO_CHAN_SOFT_TIMESTAMP(_si) \
{ .type = IIO_TIMESTAMP, .channel = -1, \
.scan_index = _si, .scan_type = IIO_ST('s', 64, 64, 0) }
#define IIO_CHAN_SOFT_TIMESTAMP(_si) { \
.type = IIO_TIMESTAMP, \
.channel = -1, \
.scan_index = _si, \
.scan_type = { \
.sign = 's', \
.realbits = 64, \
.storagebits = 64, \
}, \
}

/**
* iio_get_time_ns() - utility function to get a time stamp for events etc
Expand Down

0 comments on commit 07d4655

Please sign in to comment.