From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <4FAE20E1.10504@kernel.org> Date: Sat, 12 May 2012 09:35:45 +0100 From: Jonathan Cameron MIME-Version: 1.0 To: Lars-Peter Clausen CC: Jonathan Cameron , linux-iio@vger.kernel.org Subject: Re: [PATCH 09/24] staging:iio:ade7758_spi_read_burst: Pass IIO device directly References: <1336741127-29552-1-git-send-email-lars@metafoo.de> <1336741127-29552-9-git-send-email-lars@metafoo.de> In-Reply-To: <1336741127-29552-9-git-send-email-lars@metafoo.de> Content-Type: text/plain; charset=ISO-8859-1 List-ID: On 05/11/2012 01:58 PM, Lars-Peter Clausen wrote: > When calling ade7758_spi_read_burst we pass the device struct of embedded in the > IIO device only to look up the IIO device from the device struct again right > away. This patch changes the code to pass the IIO device directly. > > Signed-off-by: Lars-Peter Clausen Acked-by: Jonathan Cameron > --- > drivers/staging/iio/meter/ade7758_ring.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/iio/meter/ade7758_ring.c b/drivers/staging/iio/meter/ade7758_ring.c > index 7b9be8a..a31bf21 100644 > --- a/drivers/staging/iio/meter/ade7758_ring.c > +++ b/drivers/staging/iio/meter/ade7758_ring.c > @@ -19,11 +19,10 @@ > > /** > * ade7758_spi_read_burst() - read data registers > - * @dev: device associated with child of actual device (iio_dev or iio_trig) > + * @indio_dev: The IIO device > **/ > -static int ade7758_spi_read_burst(struct device *dev) > +static int ade7758_spi_read_burst(struct iio_dev *indio_dev) > { > - struct iio_dev *indio_dev = dev_get_drvdata(dev); > struct ade7758_state *st = iio_priv(indio_dev); > int ret; > > @@ -68,7 +67,7 @@ static irqreturn_t ade7758_trigger_handler(int irq, void *p) > u32 *dat32 = (u32 *)dat64; > > if (!bitmap_empty(indio_dev->active_scan_mask, indio_dev->masklength)) > - if (ade7758_spi_read_burst(&indio_dev->dev) >= 0) > + if (ade7758_spi_read_burst(indio_dev) >= 0) > *dat32 = get_unaligned_be32(&st->rx_buf[5]) & 0xFFFFFF; > > /* Guaranteed to be aligned with 8 byte boundary */