lkml.org 
[lkml]   [2024]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/2] iio: adc: Add support for AD4000

>
> > +
> > + ret = ad4000_read_sample(st, chan);
> > + if (ret)
> > + return ret;
> > +
> > + if (st->cnv_gpio)
> > + gpiod_set_value_cansleep(st->cnv_gpio, GPIOD_OUT_LOW);
> > +
> > + if (chan->scan_type.storagebits > 16)
> > + sample = get_unaligned_be32(&st->scan.data);
> > + else
> > + sample = get_unaligned_be16(&st->scan.data);
>
> data is aligned, so be32/16_to_cpu() should be fine. Also, Jonathan
> will suggest to use &st->scan.data.sample_b32/16 here too. :-)

Sparse may well complain as well and no one likes build warnings ;)


\
 
 \ /
  Last update: 2024-05-27 16:39    [W:0.070 / U:0.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site