[PATCH v5 08/10] iio: light: gp2ap020a00f: Explicitly use string literal for driver name
From: Ethan Tidmore
Date: Sun Feb 22 2026 - 22:42:48 EST
From: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
The driver name should be easily greppable and clearly spelled.
Replace a level of indirection and explicitly use string literal.
While at it, remove useless blank lines before module_*() and
MODULE_*() macros.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Signed-off-by: Ethan Tidmore <ethantidmore06@xxxxxxxxx>
---
v5:
- No change.
v4:
- Integrate Andy Shevchenko's cleanups.
drivers/iio/light/gp2ap020a00f.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/iio/light/gp2ap020a00f.c b/drivers/iio/light/gp2ap020a00f.c
index 97630ce9ade0..0d7262e1c5c9 100644
--- a/drivers/iio/light/gp2ap020a00f.c
+++ b/drivers/iio/light/gp2ap020a00f.c
@@ -55,8 +55,6 @@
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
-#define GP2A_I2C_NAME "gp2ap020a00f"
-
/* Registers */
#define GP2AP020A00F_OP_REG 0x00 /* Basic operations */
#define GP2AP020A00F_ALS_REG 0x01 /* ALS related settings */
@@ -1535,10 +1533,9 @@ static void gp2ap020a00f_remove(struct i2c_client *client)
}
static const struct i2c_device_id gp2ap020a00f_id[] = {
- { GP2A_I2C_NAME },
+ { "gp2ap020a00f" },
{ }
};
-
MODULE_DEVICE_TABLE(i2c, gp2ap020a00f_id);
static const struct of_device_id gp2ap020a00f_of_match[] = {
@@ -1549,14 +1546,13 @@ MODULE_DEVICE_TABLE(of, gp2ap020a00f_of_match);
static struct i2c_driver gp2ap020a00f_driver = {
.driver = {
- .name = GP2A_I2C_NAME,
+ .name = "gp2ap020a00f",
.of_match_table = gp2ap020a00f_of_match,
},
.probe = gp2ap020a00f_probe,
.remove = gp2ap020a00f_remove,
.id_table = gp2ap020a00f_id,
};
-
module_i2c_driver(gp2ap020a00f_driver);
MODULE_AUTHOR("Jacek Anaszewski <j.anaszewski@xxxxxxxxxxx>");
--
2.53.0