[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230910065444.25906-1-biju.das.jz@bp.renesas.com>
Date: Sun, 10 Sep 2023 07:54:44 +0100
From: Biju Das <biju.das.jz@...renesas.com>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc: Biju Das <biju.das.jz@...renesas.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, linux-kernel@...r.kernel.org,
Biju Das <biju.das.au@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>
Subject: [PATCH v3] regulator: max20086: Drop ID table
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 <laurent.pinchart+renesas@...asonboard.com>
Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
---
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/max20086-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;
}
-static const struct i2c_device_id max20086_i2c_id[] = {
- { "max20086" },
- { "max20087" },
- { "max20088" },
- { "max20089" },
- { /* Sentinel */ },
-};
-
-MODULE_DEVICE_TABLE(i2c, max20086_i2c_id);
-
static const struct of_device_id max20086_dt_ids[] __maybe_unused = {
{
.compatible = "maxim,max20086",
@@ -311,9 +301,8 @@ static const struct of_device_id max20086_dt_ids[] __maybe_unused = {
.num_outputs = 2,
}
},
- { /* Sentinel */ },
+ { /* Sentinel */ }
};
-
MODULE_DEVICE_TABLE(of, max20086_dt_ids);
static struct i2c_driver max20086_regulator_driver = {
@@ -323,7 +312,6 @@ static struct i2c_driver max20086_regulator_driver = {
.of_match_table = of_match_ptr(max20086_dt_ids),
},
.probe = max20086_i2c_probe,
- .id_table = max20086_i2c_id,
};
module_i2c_driver(max20086_regulator_driver);
--
2.25.1
Powered by blists - more mailing lists