From: andy.shevchenko@gmail.com
To: Petre Rodan <petre.rodan@subdimension.ro>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH v2 4/4] iio: pressure: hsc030pa add triggered buffer
Date: Sun, 4 Feb 2024 18:03:28 +0200 [thread overview]
Message-ID: <Zb-1UGJt27OV-vjc@surfacebook.localdomain> (raw)
In-Reply-To: <20240127160405.19696-5-petre.rodan@subdimension.ro>
Sat, Jan 27, 2024 at 06:03:58PM +0200, Petre Rodan kirjoitti:
> Add triggered buffer feature.
...
> +static irqreturn_t hsc_trigger_handler(int irq, void *private)
> +{
> + struct iio_poll_func *pf = private;
> + struct iio_dev *indio_dev = pf->indio_dev;
> + struct hsc_data *data = iio_priv(indio_dev);
> + int ret;
> +
> + ret = hsc_get_measurement(data);
> + if (ret)
> + goto error;
> + memcpy(&data->scan.chan[0], &data->buffer, 2);
You probably wanted here &data->buffer[0] as currently you use pointer to
the poiner.
> + memcpy(&data->scan.chan[1], &data->buffer[2], 2);
Hmm... We don't have fixed-size memcpy() :-(
> + iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
> + iio_get_time_ns(indio_dev));
> +
> +error:
> + iio_trigger_notify_done(indio_dev->trig);
> +
> + return IRQ_HANDLED;
> +}
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2024-02-04 16:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-27 16:03 [PATCH v2 0/4] iio: pressure: hsc030pa: cleanup and triggered buffer Petre Rodan
2024-01-27 16:03 ` [PATCH v2 1/4] dt-bindings: iio: pressure: honeywell,hsc030pa.yaml add spi props Petre Rodan
2024-01-29 8:23 ` Krzysztof Kozlowski
2024-01-27 16:03 ` [PATCH v2 2/4] iio: pressure: hsc030pa cleanup Petre Rodan
2024-01-27 16:57 ` Jonathan Cameron
2024-01-27 16:03 ` [PATCH v2 3/4] iio: pressure: hsc030pa add mandatory delay Petre Rodan
2024-01-27 16:03 ` [PATCH v2 4/4] iio: pressure: hsc030pa add triggered buffer Petre Rodan
2024-01-27 16:59 ` Jonathan Cameron
2024-02-04 13:44 ` Jonathan Cameron
2024-02-04 16:10 ` Jonathan Cameron
2024-02-04 16:03 ` andy.shevchenko [this message]
2024-02-05 16:39 ` Petre Rodan
2024-02-10 15:09 ` Jonathan Cameron
2024-02-10 15:12 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zb-1UGJt27OV-vjc@surfacebook.localdomain \
--to=andy.shevchenko@gmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=petre.rodan@subdimension.ro \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox