Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp301062pxb; Tue, 19 Oct 2021 03:14:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/HFbMxi1xXpvRM0sVrGlwiO3Qqff7/uVVowQeX04bjQH1BM5KQHeJgDoAsGbbmApZVqU0 X-Received: by 2002:a17:902:780f:b0:13a:3919:e365 with SMTP id p15-20020a170902780f00b0013a3919e365mr32645863pll.63.1634638476405; Tue, 19 Oct 2021 03:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634638476; cv=none; d=google.com; s=arc-20160816; b=Sq4TQuQvtG/78hpM3o2sSeBEvMaJVlXsOC1v8rvhB/twiy8XZr6bbB4yoKMqB9KLzc 3bYWyydBPeUsEXnDEkDViWFHuC94D11OY+m5a4/85LHR5XstypZhbatiYMXVD8oDChl4 fURBf2B4VOpxl5pOahMrLGItx2mikQu5yP1yEu908dSXUWzxltcHQRGL6r3LWnj8Xsyb CLZhj4K2ReZWSIOya0e22deJqZ5RYhmwnLyLq/d1yZT56S66d4ySnbPXk/vbCCcdmCqh BnA7odl4XhcfMpKqU2Kyw+6gGNAxsw3rGIWsT1C9Y34xo8wpTZP4FkRy9R/1AuFUBrz4 G9mA== 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=tH9hZrrFr0ITz3bsn61FFv5UwZ9QvwJRwHY5992ydRw=; b=RcwFeJJ45rfXY9OoWlxfc712dir5XxmAXFD6oDQN719RAyYhdgK+OM+7KkaQalACtB wkLJUwpYezYDLz589ufM6hWY973VwEiMwMOg9KOXsf/z4Q3pdzwJ9ReR9HSr4+pAvZFZ gJwT1TPdBzoEtuGgVR5IvT1cAJKbJj1TUD2BrWWphW0x5dhaKSEaiP20uaG1BgDovGeF o3hh0vgYFkSvoBXl87oDWXvxfzAXwVHhngC3r1DQ6/vKcNn59uUa/AY2Ftb+5NBYAB82 UUB/zIDdtmSgCgVWgghOKFojN0sakuTLyErO/VpvU7DwfCQHqhbcW8fFe6NrwTr3TZ+u 2pxg== 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 b5si25034254pgt.22.2021.10.19.03.14.23; Tue, 19 Oct 2021 03:14:36 -0700 (PDT) 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 S235147AbhJSKMY (ORCPT + 99 others); Tue, 19 Oct 2021 06:12:24 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:10102 "EHLO cmccmta3.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235137AbhJSKMY (ORCPT ); Tue, 19 Oct 2021 06:12:24 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.5]) by rmmx-syy-dmz-app12-12012 (RichMail) with SMTP id 2eec616e9736f35-fb483; Tue, 19 Oct 2021 18:00:23 +0800 (CST) X-RM-TRANSID: 2eec616e9736f35-fb483 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.112.105.130]) by rmsmtp-syy-appsvr03-12003 (RichMail) with SMTP id 2ee3616e97244be-dc621; Tue, 19 Oct 2021 18:00:23 +0800 (CST) X-RM-TRANSID: 2ee3616e97244be-dc621 From: Tang Bin To: jic23@kernel.org, lars@metafoo.de, heiko@sntech.de Cc: linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Tang Bin Subject: [PATCH 2/3] iio: adc: max9611: Use of_device_get_match_data to simplify code Date: Tue, 19 Oct 2021 18:00:12 +0800 Message-Id: <20211019100013.27312-3-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.20.1.windows.1 In-Reply-To: <20211019100013.27312-1-tangbin@cmss.chinamobile.com> References: <20211019100013.27312-1-tangbin@cmss.chinamobile.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Retrieve OF match data, it's better and cleaner to use 'of_device_get_match_data' over 'of_match_device'. Signed-off-by: Tang Bin --- drivers/iio/adc/max9611.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c index 052ab23f1..4e754c072 100644 --- a/drivers/iio/adc/max9611.c +++ b/drivers/iio/adc/max9611.c @@ -514,8 +514,6 @@ static int max9611_probe(struct i2c_client *client, { const char * const shunt_res_prop = "shunt-resistor-micro-ohms"; const struct device_node *of_node = client->dev.of_node; - const struct of_device_id *of_id = - of_match_device(max9611_of_table, &client->dev); struct max9611_dev *max9611; struct iio_dev *indio_dev; unsigned int of_shunt; @@ -545,7 +543,7 @@ static int max9611_probe(struct i2c_client *client, if (ret) return ret; - indio_dev->name = of_id->data; + indio_dev->name = of_device_get_match_data(&client->dev); indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->info = &indio_info; indio_dev->channels = max9611_channels; -- 2.20.1.windows.1