Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1564825rwd; Thu, 25 May 2023 14:42:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6en0tMgvqGlDemGBJgsC4LS7ZiEcdRig3KffqqBJfAVPnLj8Q6iRnXKHgM18s6XJUMJG2a X-Received: by 2002:a05:6a20:4282:b0:10c:6:61d1 with SMTP id o2-20020a056a20428200b0010c000661d1mr16239755pzj.39.1685050937878; Thu, 25 May 2023 14:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685050937; cv=none; d=google.com; s=arc-20160816; b=sbLq3SJuV+UD3swpxZQ1mm1hAv/DeUBjTgDT1JKXJT2g6imlQw9YoFwus97qH1HRJZ nsI8gER4/p7XIZ4+5G8WeRMPAq1RiKQUSINmXnNitHkmAw79NKTzmvmffactr17NS10Q jJw9kRbWLIaMgWf4+L+BPgqMGQo+O3EvFWvJPpwXk+GbKx3KkhJsk7bodkPfpIEkt9XJ HLtwjvrdfrN1FYXCHRLkG37i8FH06zXb7nWMl81f1Owjau9ndjPBbuh16FKSLcdRO1XO m/d1u49Wi0CATbRU6oR6T7P5VLsqWO6Fa4tD4K10JBFFY4bFH7SuUH1Xmqxc+rVVxOUR 2XOQ== 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 :dkim-signature; bh=Q3aVBIb2UQThMWSJBc3+LBZO+xAU5esCX+XztnVfgbM=; b=XBVlJH9BRKd/Dtvh/q9V9I5yAzdEEeEiv1LJLYaxdv26HAXsA2zoWK2bCt+7geAv/B v6aaa+6rC1S4MdqeoX5KE+UHL4lXz3gNsoIBbrkDsQaSttAO8C5SeVaaXzS5DfxltG3Z Q2AJ1KrSuwHCNBMpct4KuLVVhSN8CvwWM+bBK6EOL3IFFuUPIFfoAdjKZldu8f1nzuGt pfoCrCU9PJlOwrXrTVlmzQM6ZIRokt4KJMViMF/JKOhwhzcaWXr7xsfXvChwX1Oe599h a7y1gdu9HXd1vRiljYIYejka9g/rc3425h0jbo9BJMx1sId93DsbCDaZ2R3XAZ6cm0aV fu/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=UF0qvBDP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m17-20020a637111000000b00534842ba603si1943809pgc.820.2023.05.25.14.42.04; Thu, 25 May 2023 14:42:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=UF0qvBDP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235747AbjEYV2e (ORCPT + 99 others); Thu, 25 May 2023 17:28:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232645AbjEYV2c (ORCPT ); Thu, 25 May 2023 17:28:32 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C877E58; Thu, 25 May 2023 14:28:22 -0700 (PDT) Received: from localhost.localdomain (unknown [IPv6:2405:201:0:21ea:e49:10dd:40c0:e842]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: shreeya) by madras.collabora.co.uk (Postfix) with ESMTPSA id 6140C6601F54; Thu, 25 May 2023 22:28:17 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1685050101; bh=7hciE8XoQj7YqlZBospZkfZLJzFdMH510lvKyu7BdNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UF0qvBDPNvxoe16vml3vZK/8BatpX4/GsrtRd3QOH/jD1xufqG2yBD7FFWze7l1NK ngN34u7iM26d6UurhdFCBGS/KtTyUPFVGysd+qIlj9kZH4amPZuReUotzwENmWg08E TQNZAEBHslxP0Xo21v0FoLSiaZiEAUijpZsS+vreK/K1Zvsu6ZVMNvDYRUuUAAJjfJ k9X0Fu4yza4WvjOUY1QhqVanVn06opgwniw7kJ8XywWzzWEu5elkrm2dtrmouvnoNI H1d2Ko6fiLjHtcUOxuGxN0y0sdMFwjRlER9NWtj+fPgbz8F3Yh549tmEnWP6ZSTTZR rQ15X7TtjtufQ== From: Shreeya Patel To: jic23@kernel.org, lars@metafoo.de, heiko@sntech.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, sebastian.reichel@collabora.com Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@collabora.com, gustavo.padovan@collabora.com, serge.broslavsky@collabora.com, Shreeya Patel , AngeloGioacchino Del Regno Subject: [PATCH v2 4/8] iio: adc: rockchip_saradc: Use of_device_get_match_data Date: Fri, 26 May 2023 02:57:08 +0530 Message-Id: <20230525212712.255406-5-shreeya.patel@collabora.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230525212712.255406-1-shreeya.patel@collabora.com> References: <20230525212712.255406-1-shreeya.patel@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use of_device_get_match_data() to simplify the code. Signed-off-by: Shreeya Patel Reviewed-by: AngeloGioacchino Del Regno --- Changes in v2 - Add a Reviewed-by tag. drivers/iio/adc/rockchip_saradc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c index 41226b76a995..1a5790264ec1 100644 --- a/drivers/iio/adc/rockchip_saradc.c +++ b/drivers/iio/adc/rockchip_saradc.c @@ -414,10 +414,10 @@ static void rockchip_saradc_regulator_unreg_notifier(void *data) static int rockchip_saradc_probe(struct platform_device *pdev) { + const struct rockchip_saradc_data *match_data; struct rockchip_saradc *info = NULL; struct device_node *np = pdev->dev.of_node; struct iio_dev *indio_dev = NULL; - const struct of_device_id *match; int ret; int irq; @@ -431,13 +431,13 @@ static int rockchip_saradc_probe(struct platform_device *pdev) } info = iio_priv(indio_dev); - match = of_match_device(rockchip_saradc_match, &pdev->dev); - if (!match) { + match_data = of_device_get_match_data(&pdev->dev); + if (!match_data) { dev_err(&pdev->dev, "failed to match device\n"); return -ENODEV; } - info->data = match->data; + info->data = match_data; /* Sanity check for possible later IP variants with more channels */ if (info->data->num_channels > SARADC_MAX_CHANNELS) { -- 2.30.2