From nobody Thu Dec 18 09:44:33 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 C6271EC8748 for ; Sun, 10 Sep 2023 06:54:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346340AbjIJGy7 (ORCPT ); Sun, 10 Sep 2023 02:54:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237352AbjIJGy7 (ORCPT ); Sun, 10 Sep 2023 02:54:59 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2FA441B8 for ; Sat, 9 Sep 2023 23:54:54 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,241,1688396400"; d="scan'208";a="179288419" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 10 Sep 2023 15:54:51 +0900 Received: from localhost.localdomain (unknown [10.226.92.9]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 45E124005B40; Sun, 10 Sep 2023 15:54:49 +0900 (JST) From: Biju Das To: Laurent Pinchart Cc: Biju Das , Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org, Biju Das , Andy Shevchenko , Laurent Pinchart Subject: [PATCH v3] regulator: max20086: Drop ID table Date: Sun, 10 Sep 2023 07:54:44 +0100 Message-Id: <20230910065444.25906-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" The driver has an ID table, but it uses the wrong API for retrieving match data and that will lead to a crash, if it is instantiated by user space or using ID. From this, there is no user for the ID table and let's drop it from the driver as it saves some memory. While at it, drop blank lines before MODULE_DEVICE_TABLE* and remove trailing comma in the terminator entry for OF table making code robust against (theoretical) misrebases or other similar things where the new entry goes _after_ the termination without the compiler noticing. Suggested-by: Laurent Pinchart Signed-off-by: Biju Das --- Note: This patch is only compile tested. v2->v3: * Dropped ID table * Updated cpmmit header and description. * Added Suggested-by tag from Laurent. v1->v2: * Removed trailing comma in the terminator entry for OF/ID table. --- drivers/regulator/max20086-regulator.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/regulator/max20086-regulator.c b/drivers/regulator/max= 20086-regulator.c index 32f47b896fd1..0eb0a4fb077f 100644 --- a/drivers/regulator/max20086-regulator.c +++ b/drivers/regulator/max20086-regulator.c @@ -275,16 +275,6 @@ static int max20086_i2c_probe(struct i2c_client *i2c) return 0; } =20 -static const struct i2c_device_id max20086_i2c_id[] =3D { - { "max20086" }, - { "max20087" }, - { "max20088" }, - { "max20089" }, - { /* Sentinel */ }, -}; - -MODULE_DEVICE_TABLE(i2c, max20086_i2c_id); - static const struct of_device_id max20086_dt_ids[] __maybe_unused =3D { { .compatible =3D "maxim,max20086", @@ -311,9 +301,8 @@ static const struct of_device_id max20086_dt_ids[] __ma= ybe_unused =3D { .num_outputs =3D 2, } }, - { /* Sentinel */ }, + { /* Sentinel */ } }; - MODULE_DEVICE_TABLE(of, max20086_dt_ids); =20 static struct i2c_driver max20086_regulator_driver =3D { @@ -323,7 +312,6 @@ static struct i2c_driver max20086_regulator_driver =3D { .of_match_table =3D of_match_ptr(max20086_dt_ids), }, .probe =3D max20086_i2c_probe, - .id_table =3D max20086_i2c_id, }; =20 module_i2c_driver(max20086_regulator_driver); --=20 2.25.1