Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp788277rdb; Sun, 3 Sep 2023 10:21:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF1seLQnnL13vKb6JrBMuT+U3orT+VxMINjeESZie+FI8SUHQ9hiXCbqEiz4KWH16ku7iOE X-Received: by 2002:a17:907:a056:b0:9a2:139:f466 with SMTP id gz22-20020a170907a05600b009a20139f466mr5715459ejc.13.1693761670219; Sun, 03 Sep 2023 10:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693761670; cv=none; d=google.com; s=arc-20160816; b=nvs9EpjVI8rbgrdadyzK9LX66tr3uRoLDEZHzSSE6F1VWeomHbQOAZAUi0EyIVcGam qgFvhtqq9xuEGyYNRlGgzasupqOPOXK/WSzFzMsB8p1qpBucRz1hsawz2i+U4qU+1+Iy vHfIlEgmc8rKdtAb7JNiuTF81O+zlVjR8+4VIhoeMFqzC93TCtjZ9tE/S9nx93BbdfWy 5YEI5HNfhcWLe78l6pIiterXLmnNeMw8dFqyfkdTQ4MkOS9odUrN9o2FUCm/xkp0q+cH DoOBv+FThcxQlzVywOTciGJVAwAweV+IGaVgUqVMyyqBYlvM2n6ZAZgCvNizJGaaScXa ZSsg== 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 :message-id:date:subject:cc:to:from; bh=6VamsOHXx/BevyAD7gQyeZbo2rbFeIql4sUoiLrwsLo=; fh=wYd0UWckwCv7pCsCrogX3XMV89SNZH69aEIor0d2YTc=; b=tq0v6O2OUGPRN0pTfwn2ZRoyjOy2alkAtfn1igmpvoI1sJwCWUCd2A7+1+6xr5nsQT 3ksn4hhI7+wlhd3sgoeT81+IRyGNdDLjWCyiIuxcjSgbueTfBZ2VTrIRuxk/ydtr/lf0 fR3y1iiIH+Pzc/DaWrc+/PjlES8xxynd09im0hCJ/77lI5cEvU2c8z361rCXkqHKg1Uc z1EOEPakIz6C51/z1PlGlmmP3LrSFKtOzWFsMezA17m5/AyLUcY8bOWsceF1G41OLIK2 PwCmA0n4jZaMTHIm8XO0TjHVMsdUo2YDotjfsk6iTEhFDWVDeG3oaoCvxVKs2ob3AF6T uJ7w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga22-20020a170906b85600b00988907e3aaesi4669166ejb.428.2023.09.03.10.20.42; Sun, 03 Sep 2023 10:21:10 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241890AbjICO7l (ORCPT + 99 others); Sun, 3 Sep 2023 10:59:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbjICO7i (ORCPT ); Sun, 3 Sep 2023 10:59:38 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 36BA1115; Sun, 3 Sep 2023 07:59:33 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,224,1688396400"; d="scan'208";a="174848488" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 03 Sep 2023 23:59:33 +0900 Received: from localhost.localdomain (unknown [10.226.92.30]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id B031D40031D3; Sun, 3 Sep 2023 23:59:30 +0900 (JST) From: Biju Das To: Jonathan Cameron Cc: Biju Das , Lars-Peter Clausen , Andy Shevchenko , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das Subject: [PATCH V2 RESEND] iio: pressure: ms5637: Use i2c_get_match_data() Date: Sun, 3 Sep 2023 15:59:26 +0100 Message-Id: <20230903145926.66855-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 Simplify probe() by replacing id lookup for retrieving match data and device_get_match_data() by i2c_get_match_data(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko --- v1->v2: * Added Rb tag from Andy * Dropped id variable removal from commit description. --- drivers/iio/pressure/ms5637.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/iio/pressure/ms5637.c b/drivers/iio/pressure/ms5637.c index 9b3abffb724b..ac30d76285d1 100644 --- a/drivers/iio/pressure/ms5637.c +++ b/drivers/iio/pressure/ms5637.c @@ -144,7 +144,6 @@ static const struct iio_info ms5637_info = { static int ms5637_probe(struct i2c_client *client) { - const struct i2c_device_id *id = i2c_client_get_device_id(client); const struct ms_tp_data *data; struct ms_tp_dev *dev_data; struct iio_dev *indio_dev; @@ -159,10 +158,7 @@ static int ms5637_probe(struct i2c_client *client) return -EOPNOTSUPP; } - if (id) - data = (const struct ms_tp_data *)id->driver_data; - else - data = device_get_match_data(&client->dev); + data = i2c_get_match_data(client); if (!data) return -EINVAL; -- 2.25.1