Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1466515pxb; Fri, 13 Nov 2020 13:31:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyA/4N9JCWlr7/OY71NZ0JOaZ6JQ+yY0aXpmdRXCwzcsqycBCu29VAA1hLOMuu4gEU/avb X-Received: by 2002:a17:906:1352:: with SMTP id x18mr3883391ejb.476.1605303067212; Fri, 13 Nov 2020 13:31:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605303067; cv=none; d=google.com; s=arc-20160816; b=It+fhOXk91PasLt9TOBgg8O/YYULsnoyTM7/h221/yi6droZuKRBJb44MuQjQZ825X J1A/iXX2DhbuZ19R1mKHY8+SfTv5eR5flw8K+ewajpZ9+1UctT+vyqQOsXfb0+Nxcvj+ PdzLTxmTJus0TrSEPqWoPOjJxxFE6XgezVCjmfOWuFuMdCjlhaIZxOj2T3TOniTKJaKM a55l58snzBAYbAVEgNwZkaIP/s1aU0/WDaUUljThJcxZ3WskhxNlcW0lMVhdnivOFEIb snXbn/+w2Lk/ARApODxMFIH7tEBA5hidFXLMP94IUut23ChIcjOTY+iXdnvdbRuGK81E Gj5Q== 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:date:subject:cc:to:from; bh=UmNJE7h7vbmol3P/xhLHxg4zytkjs6ynrFHvtgYHbC0=; b=p1c87bSvPH3WPEh3AXKGoennzFyfk3WNCRHrMrsHZdz5RVqERx6Sy+JqO7SPug3Kyj /YEqW4/z8wVU2W1n4qVUbZ0X4dKrttzQEHWlj+l4VF1y252CEHssVnlLG/8WTnXHaU3X K9wsp22FzU6D+k1L8YIKhBbeRgdezstEL+YvcYtwk/dqNa3mZ5XYSWDoRmJegu2932Lo eZn2Wtm+KMxlYaLWG7RPj6gCnwgATQxia3Pc9SKB2oNAasUmlgxanynaKB4SVbV+K34g L05vhK6HpHoFBz+uvjj79l1m25R2tQOXEhA5600jAvDNn1N5970FnsfWdfRvR3v8cyHX fHrA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn7si6759114edb.498.2020.11.13.13.30.44; Fri, 13 Nov 2020 13:31:07 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726316AbgKMV1J (ORCPT + 99 others); Fri, 13 Nov 2020 16:27:09 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:39991 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726175AbgKMV1I (ORCPT ); Fri, 13 Nov 2020 16:27:08 -0500 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 21D30240005; Fri, 13 Nov 2020 21:27:04 +0000 (UTC) From: Alexandre Belloni To: Jonathan Cameron 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, Alexandre Belloni Subject: [PATCH 6/9] iio: adc: at91_adc: remove forward declaration Date: Fri, 13 Nov 2020 22:26:47 +0100 Message-Id: <20201113212650.507680-7-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201113212650.507680-1-alexandre.belloni@bootlin.com> References: <20201113212650.507680-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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"); -- 2.28.0