Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3803936rwd; Sat, 3 Jun 2023 12:17:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4E8a+S9jxoWKbPYi9YkbjByp6LvjmgTI9+CKhPOS/FbT+kvYP/MB+vYmgPvuX2I25M0DNi X-Received: by 2002:a05:6a20:1450:b0:10a:b812:bcc7 with SMTP id a16-20020a056a20145000b0010ab812bcc7mr2553659pzi.17.1685819820648; Sat, 03 Jun 2023 12:17:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685819820; cv=none; d=google.com; s=arc-20160816; b=ulApdiBWDRUEa8whcPVKvSuarWLEIo/KCqiqs+zZ35t4H9kBE8/8WA7iJUACXbVKF2 j7a5nd0K8OrVqf6bFRhfzWtWBEXrHYOceklBctk6m9XbYOGfozGaXE0eoyVWSteCYiyU kLWjMLhyUe0wNF+PsyyHF8KoQePHIxATPVNyGSr5gqFqPTYBS1Q0DUzt2qe0CHuY8x+U Fn0KdsdXGMBkBNpvrKs2p54O97uSvuacP7N4szKcSwJC1rVc42uMb47ZAAn/T2WSrnu5 cnSbFnwvUhje6pYxf4qxVxDGreeOvaXfrzjhK+4Gj1D4jOygUgYAMId/FO0UTQo75ofN bQNg== 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=jZ3VuXi3xgyZmz5xmMdGqrMRZ2L93IMNhehQp9wD2iY=; b=Fny68p/dcANJ5oC4NXevQUZB8MSPP0vYCR8gJ23phnRIDp7XbJyUZzPHBKzFnpZnGb TAA7QrHES7+NQcMId/3Z72Plc2sbzdycee3ijG59idnU029E9dTntzOwTGDqvGbxD7Fi TAW3+QAvPyz0d8NtQ8BEgDHlxigz4q+a7PriQIBdisnKAZ8uw1h4YDGQ6khWjLvWhyEa mJD1YXJlgIf2butq96CZ/YGRM+Z350x1kRL3A9yteYIbX/Ahvt1ywspaygXU4+AvxIFj zJSP3YPT3i7HxEGG3PAw0ldwRMwWDjC0QT/n5lyTh/x/DVV0HYRXYACn8WeDZmL6UjuQ cqmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=DHHO5had; 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 a72-20020a63904b000000b0054170e0ef60si3012265pge.210.2023.06.03.12.16.44; Sat, 03 Jun 2023 12:17:00 -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=DHHO5had; 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 S229751AbjFCSy4 (ORCPT + 99 others); Sat, 3 Jun 2023 14:54:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbjFCSyw (ORCPT ); Sat, 3 Jun 2023 14:54:52 -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 257541BB; Sat, 3 Jun 2023 11:54:47 -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 C34646606EBA; Sat, 3 Jun 2023 19:54:41 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1685818485; bh=VNGGZRi4A9Mnt5jeD15aqWDciGe58NwxbjwHqV5hKJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DHHO5hadMuUConDV8846JqFF0fEN4sAW4K7ZCgLW6LZWp+8WyoG24cTXNJbQLacZ1 0dfcHQ8V9cTbYNz2h0bKmouSVvohMYfSOD33ZKCuh7uE+3swL2Ce9F1A1zIiYe4GMz e0/x8jwu4qm9LDAyOZq/AZDaHWs1znkt+fR/9sS/tfSpFIIpcjSd1Ma8Io0cn2xm7C KgDtdboWl2RGlg5HAt2JIff7gB2A5rp7BakXcsf6ha7HsdkSw30+FXsYVllZWOMgpy uSihtW6RhfM0ziXzfj9e502/HYHCrYSx36U648Z7OZhyzIlK5T61sUC2LamtTPc7R3 OkXPGJm/ygVTA== 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, gustavo.padovan@collabora.com, kernel@collabora.com, serge.broslavsky@collabora.com, Shreeya Patel , AngeloGioacchino Del Regno Subject: [PATCH v3 4/8] iio: adc: rockchip_saradc: Use of_device_get_match_data Date: Sun, 4 Jun 2023 00:23:36 +0530 Message-Id: <20230603185340.13838-5-shreeya.patel@collabora.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230603185340.13838-1-shreeya.patel@collabora.com> References: <20230603185340.13838-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 v3 - No change 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 ac424ea50787..cbe347fe8df7 100644 --- a/drivers/iio/adc/rockchip_saradc.c +++ b/drivers/iio/adc/rockchip_saradc.c @@ -415,10 +415,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; @@ -432,13 +432,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