Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1993387pxb; Sat, 14 Nov 2020 09:12:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxHxjW9oSvzxxlYhBDr5O3wrtPPYKNwjK+jRgG8QVka6WfgwnyhNK1LvjqV6q+4gSIjP3n X-Received: by 2002:aa7:d2d2:: with SMTP id k18mr7885331edr.290.1605373940223; Sat, 14 Nov 2020 09:12:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605373940; cv=none; d=google.com; s=arc-20160816; b=UgKC3RTY00fjCi5hDsdpjxwREr+1EBm2xt6cQNKcF6b32+bb4/4lOp+YTal8OA5tTW tYf5ccEkeLdAAlJ246onNLwh0r2sciiI3XPAfPbdCfEACi+fIGXI0e28W9jD8Y/S/Gc5 /epGY9BMpAo6/3r0cMd9LaPXKt/gJg2582U1dvBxE6zIIrl6KSewtZsWUl52ab6zLqNt 9hwTy13DwTDnIznKukEgd8a8qTyaF71CsuzSrTDHcYrT6VJc2aSR8JZVC089LrrZSWc0 K5kY0MVPiLoTGGVlpC+FWOuL1LuAVQlVPc25K9qv3zotAGL9q8BSTWbGMJTaZYs8A4IB v4Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=i0yKfWqop1vfeisvphSpz+gvjPhFBFfFK5cPkfe9/G0=; b=jUWESaJ8TykbkHz22p8le9EejxU0hc0ulfNditvHuMM7m9T75lkY2qkZkwtePhq1GG w8UsJrXWRv+8eQTqrU+IUsxL0bZOAllzNN1PQ6ecabl+QsYtUh2H7LtmM3YK9LoMNOCy Jv5SABYEOzM55H27kCAW7BIQloe0Ufsl7H6BQvbtqI17r5ewvIhl2U8/hSs8gk3m7rQ3 0X4LxzdIVT8FTk3vvXxOyLSO8ZodLe5YnzlpWAd9hSi5ERQTE6pgVuFDaycIeWKIC/kr eajGXEsXrhCnYqgjk/QIeesAhwSvxA+CUbMRrdDvpbe4IzWxncL6Y1/H6nALt0qIO7t5 bZZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BT82qd+W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o10si8331721ejg.80.2020.11.14.09.11.50; Sat, 14 Nov 2020 09:12:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BT82qd+W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726196AbgKNRJO (ORCPT + 99 others); Sat, 14 Nov 2020 12:09:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:36728 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726172AbgKNRJO (ORCPT ); Sat, 14 Nov 2020 12:09:14 -0500 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 C4A5820A8B; Sat, 14 Nov 2020 17:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605373753; bh=IepkTZQ0wdLVptnurilT8/x+AIShJuf60u32T7BRUBg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BT82qd+W6yRBTZO9p2N0nnE4ymQZD3ZdR7aW/jeTid+WKNIfZB0JnhH0p0czeWSTV Vtlf+Hz/n3J+AJNd9kAY9HyqKB19nsZ9l5i/hgWOnNZrYED71XqFd9hsSCUdNT/8M+ tq/Kt5+CzsPXkWinu1r4ytYuWakD/FPmU0V64PJ4= Date: Sat, 14 Nov 2020 17:09:08 +0000 From: Jonathan Cameron To: Alexandre Belloni Cc: Lars-Peter Clausen , Peter Meerwald-Stadler , Nicolas Ferre , Ludovic Desroches , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/9] iio: adc: at91_adc: remove forward declaration Message-ID: <20201114170908.234f0141@archlinux> In-Reply-To: <20201113212650.507680-7-alexandre.belloni@bootlin.com> References: <20201113212650.507680-1-alexandre.belloni@bootlin.com> <20201113212650.507680-7-alexandre.belloni@bootlin.com> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 13 Nov 2020 22:26:47 +0100 Alexandre Belloni wrote: > Remove the forward declaration of at91_adc_dt_ids by using > device_get_match_data. Also add const were possible since it is not > discarded by the cast anymore. > > Signed-off-by: Alexandre Belloni Ignore comment on previous patch ;) Jonathan > --- > drivers/iio/adc/at91_adc.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c > index 9f05eb722f5e..76aeebce6f4d 100644 > --- a/drivers/iio/adc/at91_adc.c > +++ b/drivers/iio/adc/at91_adc.c > @@ -224,7 +224,6 @@ struct at91_adc_state { > struct mutex lock; > u8 num_channels; > void __iomem *reg_base; > - struct at91_adc_reg_desc *registers; > u32 startup_time; > u8 sample_hold_time; > bool sleep_mode; > @@ -233,7 +232,8 @@ struct at91_adc_state { > u32 vref_mv; > u32 res; /* resolution used for convertions */ > wait_queue_head_t wq_data_avail; > - struct at91_adc_caps *caps; > + const struct at91_adc_caps *caps; > + const struct at91_adc_reg_desc *registers; > > /* > * Following ADC channels are shared by touchscreen: > @@ -569,7 +569,7 @@ static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state) > { > struct iio_dev *idev = iio_trigger_get_drvdata(trig); > struct at91_adc_state *st = iio_priv(idev); > - struct at91_adc_reg_desc *reg = st->registers; > + const struct at91_adc_reg_desc *reg = st->registers; > u32 status = at91_adc_readl(st, reg->trigger_register); > int value; > u8 bit; > @@ -796,8 +796,6 @@ static u32 calc_startup_ticks_9x5(u32 startup_time, u32 adc_clk_khz) > return ticks; > } > > -static const struct of_device_id at91_adc_dt_ids[]; > - > static int at91_adc_probe_dt_ts(struct device_node *node, > struct at91_adc_state *st, struct device *dev) > { > @@ -1011,8 +1009,7 @@ static int at91_adc_probe(struct platform_device *pdev) > > st = iio_priv(idev); > > - st->caps = (struct at91_adc_caps *) > - of_match_device(at91_adc_dt_ids, &pdev->dev)->data; > + st->caps = device_get_match_data(&pdev->dev); > > st->use_external = of_property_read_bool(node, "atmel,adc-use-external-triggers"); >