From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52D02C433DF for ; Sun, 31 May 2020 14:32:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 33B8E2076B for ; Sun, 31 May 2020 14:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590935563; bh=OBpQx/MAxbnDUPvygnhKRHE92gg4+Whs9mb2nJw00e0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=YAusMq/yOa60TH6xiTvEYHPFEdLYypiB10hfT100V3qi7/9GKJxrRch8Jemd+o586 p8uVu7gCh/Jc+f6rAQJZ9ZoVIvlKdhH60ilmDm1bsZg6JLjnRzmX6i8BWQKHFv6x+Z 3Bq12sxewB1WXtQhokaQeOtUNdCP72rN3kwbFXjM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727084AbgEaOci (ORCPT ); Sun, 31 May 2020 10:32:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:38458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbgEaOci (ORCPT ); Sun, 31 May 2020 10:32:38 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 876A32076B; Sun, 31 May 2020 14:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590935558; bh=OBpQx/MAxbnDUPvygnhKRHE92gg4+Whs9mb2nJw00e0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZPwpKij/7X9I3MTTHAHIMQO+BdbRr0l17BAAvPgS8y8YA7BWV+aeE0PtjIRJc86Mo cHtSGp06CYq7rlnt1P07t9aOI8QrbNvMuwrHh7sxZ7H0jOYnJus2bvBaMea8q8K05Y 1czY2vwXuaqJ2pLTuJzXhSN5zeVkvKP91nS6LWjw= Date: Sun, 31 May 2020 15:32:33 +0100 From: Jonathan Cameron To: Alexandru Ardelean Cc: , Subject: Re: [PATCH] iio: dac: ad5592r: remove usage of iio_priv_to_dev() helper Message-ID: <20200531153233.2fff02e3@archlinux> In-Reply-To: <20200525131034.230738-1-alexandru.ardelean@analog.com> References: <20200525131034.230738-1-alexandru.ardelean@analog.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Mon, 25 May 2020 16:10:34 +0300 Alexandru Ardelean wrote: > This was partially removed when the mlock cleanup was done. Only one more > call is left in the ad5592r_alloc_channels() function. > This one is simple. We just need to pass the iio_dev object and get the > state via iio_priv(). > > Signed-off-by: Alexandru Ardelean Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to poke at. Thanks, Jonathan > --- > drivers/iio/dac/ad5592r-base.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c > index 410e90e5f75f..272c97bb841c 100644 > --- a/drivers/iio/dac/ad5592r-base.c > +++ b/drivers/iio/dac/ad5592r-base.c > @@ -508,11 +508,11 @@ static void ad5592r_setup_channel(struct iio_dev *iio_dev, > chan->ext_info = ad5592r_ext_info; > } > > -static int ad5592r_alloc_channels(struct ad5592r_state *st) > +static int ad5592r_alloc_channels(struct iio_dev *iio_dev) > { > + struct ad5592r_state *st = iio_priv(iio_dev); > unsigned i, curr_channel = 0, > num_channels = st->num_channels; > - struct iio_dev *iio_dev = iio_priv_to_dev(st); > struct iio_chan_spec *channels; > struct fwnode_handle *child; > u32 reg, tmp; > @@ -636,7 +636,7 @@ int ad5592r_probe(struct device *dev, const char *name, > if (ret) > goto error_disable_reg; > > - ret = ad5592r_alloc_channels(st); > + ret = ad5592r_alloc_channels(iio_dev); > if (ret) > goto error_disable_reg; >