From nobody Thu Dec 18 16:38:03 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 DEF7AC83F16 for ; Mon, 28 Aug 2023 15:50:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbjH1PuG (ORCPT ); Mon, 28 Aug 2023 11:50:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230522AbjH1Ptt (ORCPT ); Mon, 28 Aug 2023 11:49:49 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 93B3EC9 for ; Mon, 28 Aug 2023 08:49:46 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,207,1688396400"; d="scan'208";a="174229477" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 29 Aug 2023 00:49:46 +0900 Received: from localhost.localdomain (unknown [10.226.92.234]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 7D41D400D4B8; Tue, 29 Aug 2023 00:49:43 +0900 (JST) From: Biju Das To: Lee Jones Cc: Biju Das , Charles Keepax , Richard Fitzgerald , alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Andy Shevchenko Subject: [PATCH v2] mfd: madera-i2c: Simplify probe() Date: Mon, 28 Aug 2023 16:49:41 +0100 Message-Id: <20230828154941.79780-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 of_device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das Acked-by: Charles Keepax --- Note: This patch is only compile tested. v1->v2: * Added Ack tag from Charles Keepax. * Dropped blank line before switch statement. --- drivers/mfd/madera-i2c.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/mfd/madera-i2c.c b/drivers/mfd/madera-i2c.c index a404ea26bc79..33781c631345 100644 --- a/drivers/mfd/madera-i2c.c +++ b/drivers/mfd/madera-i2c.c @@ -18,21 +18,14 @@ =20 static int madera_i2c_probe(struct i2c_client *i2c) { - const struct i2c_device_id *id =3D i2c_client_get_device_id(i2c); struct madera *madera; const struct regmap_config *regmap_16bit_config =3D NULL; const struct regmap_config *regmap_32bit_config =3D NULL; - const void *of_data; unsigned long type; const char *name; int ret; =20 - of_data =3D of_device_get_match_data(&i2c->dev); - if (of_data) - type =3D (unsigned long)of_data; - else - type =3D id->driver_data; - + type =3D (unsigned long)i2c_get_match_data(i2c); switch (type) { case CS47L15: if (IS_ENABLED(CONFIG_MFD_CS47L15)) { --=20 2.25.1