From nobody Mon Feb 9 10:55:12 2026 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 7CFFBC83F2C for ; Sun, 3 Sep 2023 16:03:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244232AbjICQDO (ORCPT ); Sun, 3 Sep 2023 12:03:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232636AbjICQDO (ORCPT ); Sun, 3 Sep 2023 12:03:14 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 35A35100 for ; Sun, 3 Sep 2023 09:03:09 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,224,1688396400"; d="scan'208";a="178558807" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 04 Sep 2023 01:03:08 +0900 Received: from localhost.localdomain (unknown [10.226.92.30]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 2A61F4011DF1; Mon, 4 Sep 2023 01:03:05 +0900 (JST) From: Biju Das To: Saravanan Sekar Cc: Biju Das , Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org, Biju Das , Andy Shevchenko Subject: [PATCH v2] regulator: mp5416: Make similar OF and ID table Date: Sun, 3 Sep 2023 17:03:01 +0100 Message-Id: <20230903160301.79111-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" Make similar OF and ID table to extend support for ID match using i2c_match_data(). Currently it works only for OF match tables as the driver_data is wrong for ID match. While at it, remove trailing comma in the terminator entry for OF/ID table and drop a space from terminator entry for ID table. Signed-off-by: Biju Das --- Note: This patch is only compile tested. v1->v2: * Removed trailing comma in the terminator entry for OF/ID table and drop a space from terminator entry for ID table. --- drivers/regulator/mp5416.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/mp5416.c b/drivers/regulator/mp5416.c index d068ac93d373..3457e650a994 100644 --- a/drivers/regulator/mp5416.c +++ b/drivers/regulator/mp5416.c @@ -200,7 +200,7 @@ static int mp5416_i2c_probe(struct i2c_client *client) return PTR_ERR(regmap); } =20 - desc =3D of_device_get_match_data(dev); + desc =3D i2c_get_match_data(client); if (!desc) return -ENODEV; =20 @@ -223,14 +223,14 @@ static int mp5416_i2c_probe(struct i2c_client *client) static const struct of_device_id mp5416_of_match[] =3D { { .compatible =3D "mps,mp5416", .data =3D &mp5416_regulators_desc }, { .compatible =3D "mps,mp5496", .data =3D &mp5496_regulators_desc }, - {}, + {} }; MODULE_DEVICE_TABLE(of, mp5416_of_match); =20 static const struct i2c_device_id mp5416_id[] =3D { - { "mp5416", }, - { "mp5496", }, - { }, + { "mp5416", (kernel_ulong_t)&mp5416_regulators_desc }, + { "mp5496", (kernel_ulong_t)&mp5496_regulators_desc }, + {} }; MODULE_DEVICE_TABLE(i2c, mp5416_id); =20 --=20 2.25.1