From patchwork Sat Aug 12 18:07:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13351912 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1381C0015E for ; Sat, 12 Aug 2023 18:07:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229493AbjHLSHE (ORCPT ); Sat, 12 Aug 2023 14:07:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjHLSHD (ORCPT ); Sat, 12 Aug 2023 14:07:03 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 46CB1CC; Sat, 12 Aug 2023 11:07:06 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.01,168,1684767600"; d="scan'208";a="172774474" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 13 Aug 2023 03:07:05 +0900 Received: from localhost.localdomain (unknown [10.226.92.6]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 1B724406C47F; Sun, 13 Aug 2023 03:07:02 +0900 (JST) From: Biju Das To: Jonathan Cameron Cc: Biju Das , Lars-Peter Clausen , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Andy Shevchenko , linux-iio@vger.kernel.org, Geert Uytterhoeven , linux-renesas-soc@vger.kernel.org Subject: [PATCH] iio: pressure: ms5637: Use i2c_get_match_data() Date: Sat, 12 Aug 2023 19:07:00 +0100 Message-Id: <20230812180700.246314-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Replace device_get_match_data() and id lookup for retrieving match data by i2c_get_match_data(). While at it, drop ununsed variable id from probe(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko --- 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;