From nobody Thu Dec 18 16:47:46 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 DC3A4C83F11 for ; Mon, 28 Aug 2023 15:57:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231817AbjH1P4d (ORCPT ); Mon, 28 Aug 2023 11:56:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232287AbjH1P4Z (ORCPT ); Mon, 28 Aug 2023 11:56:25 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 791BBA9 for ; Mon, 28 Aug 2023 08:56:22 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,207,1688396400"; d="scan'208";a="177937725" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 29 Aug 2023 00:56:21 +0900 Received: from localhost.localdomain (unknown [10.226.92.234]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id E557F4009430; Tue, 29 Aug 2023 00:56:19 +0900 (JST) From: Biju Das To: Lee Jones Cc: Biju Das , patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Andy Shevchenko , Charles Keepax Subject: [PATCH v2] mfd: arizona-i2c: Simplify probe() Date: Mon, 28 Aug 2023 16:56:17 +0100 Message-Id: <20230828155617.87068-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 Acked-by: Charles Keepax Tested-by: Charles Keepax --- Note: This patch is only compile tested. v1->v2: * Added Ack and Tested-by tag from Charles Keepax * Dropped unnecessary blank line before switch statement. --- drivers/mfd/arizona-i2c.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c index 9b7183ffc928..5f830907d2e6 100644 --- a/drivers/mfd/arizona-i2c.c +++ b/drivers/mfd/arizona-i2c.c @@ -22,19 +22,12 @@ =20 static int arizona_i2c_probe(struct i2c_client *i2c) { - const struct i2c_device_id *id =3D i2c_client_get_device_id(i2c); - const void *match_data; struct arizona *arizona; const struct regmap_config *regmap_config =3D NULL; - unsigned long type =3D 0; + unsigned long type; int ret; =20 - match_data =3D device_get_match_data(&i2c->dev); - if (match_data) - type =3D (unsigned long)match_data; - else if (id) - type =3D id->driver_data; - + type =3D (unsigned long)i2c_get_match_data(i2c); switch (type) { case WM5102: if (IS_ENABLED(CONFIG_MFD_WM5102)) --=20 2.25.1