From nobody Thu Dec 18 16:55:13 2025 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 8C6B4C83F37 for ; Thu, 31 Aug 2023 18:53:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346419AbjHaSxi (ORCPT ); Thu, 31 Aug 2023 14:53:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344824AbjHaSxh (ORCPT ); Thu, 31 Aug 2023 14:53:37 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 977CBE66 for ; Thu, 31 Aug 2023 11:53:33 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,217,1688396400"; d="scan'208";a="174628969" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 01 Sep 2023 03:53:33 +0900 Received: from localhost.localdomain (unknown [10.226.92.179]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 97BAE4097B07; Fri, 1 Sep 2023 03:53:31 +0900 (JST) From: Biju Das To: Lee Jones Cc: Biju Das , linux-kernel@vger.kernel.org, Andy Shevchenko Subject: [PATCH v3] mfd: max77541: Simplify probe() Date: Thu, 31 Aug 2023 19:53:29 +0100 Message-Id: <20230831185329.70472-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Simplify probe() by replacing device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das --- v2->v3: * Restored OF table. v1->v2: * Restored error code -EINVAL. --- drivers/mfd/max77541.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/mfd/max77541.c b/drivers/mfd/max77541.c index 10c2e274b4af..d77c31c86e43 100644 --- a/drivers/mfd/max77541.c +++ b/drivers/mfd/max77541.c @@ -162,7 +162,6 @@ static int max77541_pmic_setup(struct device *dev) =20 static int max77541_probe(struct i2c_client *client) { - const struct i2c_device_id *id =3D i2c_client_get_device_id(client); struct device *dev =3D &client->dev; struct max77541 *max77541; =20 @@ -173,10 +172,7 @@ static int max77541_probe(struct i2c_client *client) i2c_set_clientdata(client, max77541); max77541->i2c =3D client; =20 - max77541->id =3D (uintptr_t)device_get_match_data(dev); - if (!max77541->id) - max77541->id =3D (enum max7754x_ids)id->driver_data; - + max77541->id =3D (uintptr_t)i2c_get_match_data(client); if (!max77541->id) return -EINVAL; =20 --=20 2.25.1