]> www.infradead.org Git - users/hch/misc.git/commitdiff
iio: Remove single use of macro definition for regmap name
authorWaqar Hameed <waqar.hameed@axis.com>
Tue, 27 May 2025 14:45:42 +0000 (16:45 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 9 Jun 2025 06:45:36 +0000 (07:45 +0100)
There is really no reason for having the `regmap` name as a macro
definition if it is only used once directly in `struct regmap_config`.
It is also more readable this way. Remove these macro definitions and
instead use the string literal directly.

Signed-off-by: Waqar Hameed <waqar.hameed@axis.com>
Link: https://patch.msgid.link/3a8572de8316c7d2746c2ccea8c478f594221319.1748356671.git.waqar.hameed@axis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
14 files changed:
drivers/iio/accel/mxc4005.c
drivers/iio/accel/mxc6255.c
drivers/iio/chemical/atlas-sensor.c
drivers/iio/health/max30100.c
drivers/iio/health/max30102.c
drivers/iio/light/adux1020.c
drivers/iio/light/apds9160.c
drivers/iio/light/apds9960.c
drivers/iio/light/jsa1212.c
drivers/iio/light/ltr501.c
drivers/iio/light/rpr0521.c
drivers/iio/light/stk3310.c
drivers/iio/light/vcnl4035.c
drivers/iio/magnetometer/mmc35240.c

index 7e048c4eadd79eba81992fd9c707dd4f90841170..ac973d871c8bbb649dde3fd5cd54744ace5f6582 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/iio/trigger_consumer.h>
 
 #define MXC4005_DRV_NAME               "mxc4005"
-#define MXC4005_REGMAP_NAME            "mxc4005_regmap"
 
 #define MXC4005_REG_XOUT_UPPER         0x03
 #define MXC4005_REG_XOUT_LOWER         0x04
@@ -137,7 +136,7 @@ static bool mxc4005_is_writeable_reg(struct device *dev, unsigned int reg)
 }
 
 static const struct regmap_config mxc4005_regmap_config = {
-       .name = MXC4005_REGMAP_NAME,
+       .name = "mxc4005_regmap",
 
        .reg_bits = 8,
        .val_bits = 8,
index a8abda7b2a6398811bc19d4ed7ab5930b66801af..fc3ed84d19331b1ec48472d08b8c702f97c416e8 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/iio/sysfs.h>
 
 #define MXC6255_DRV_NAME               "mxc6255"
-#define MXC6255_REGMAP_NAME            "mxc6255_regmap"
 
 #define MXC6255_REG_XOUT               0x00
 #define MXC6255_REG_YOUT               0x01
@@ -105,7 +104,7 @@ static bool mxc6255_is_readable_reg(struct device *dev, unsigned int reg)
 }
 
 static const struct regmap_config mxc6255_regmap_config = {
-       .name = MXC6255_REGMAP_NAME,
+       .name = "mxc6255_regmap",
 
        .reg_bits = 8,
        .val_bits = 8,
index cb6662b9213740f4a88b8412e6a0f01bc5a314d6..1daaa36f87a9c566448457cb3aea7619d8d88d97 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/iio/triggered_buffer.h>
 #include <linux/pm_runtime.h>
 
-#define ATLAS_REGMAP_NAME      "atlas_regmap"
 #define ATLAS_DRV_NAME         "atlas"
 
 #define ATLAS_REG_DEV_TYPE             0x00
@@ -96,7 +95,7 @@ struct atlas_data {
 };
 
 static const struct regmap_config atlas_regmap_config = {
-       .name = ATLAS_REGMAP_NAME,
+       .name = "atlas_regmap",
        .reg_bits = 8,
        .val_bits = 8,
 };
index 846664a4ee905caabb146ffd08b6a474d61064a0..814f521e47aef46b56dd7b7c70e6bf2336190d3e 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/iio/buffer.h>
 #include <linux/iio/kfifo_buf.h>
 
-#define MAX30100_REGMAP_NAME   "max30100_regmap"
 #define MAX30100_DRV_NAME      "max30100"
 
 #define MAX30100_REG_INT_STATUS                        0x00
@@ -94,7 +93,7 @@ static bool max30100_is_volatile_reg(struct device *dev, unsigned int reg)
 }
 
 static const struct regmap_config max30100_regmap_config = {
-       .name = MAX30100_REGMAP_NAME,
+       .name = "max30100_regmap",
 
        .reg_bits = 8,
        .val_bits = 8,
index f5f29d2fec574357f2287991c954a3caa501a624..a48c0881a4c728f081ee7525f693f582e6d894fb 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/iio/buffer.h>
 #include <linux/iio/kfifo_buf.h>
 
-#define MAX30102_REGMAP_NAME   "max30102_regmap"
 #define MAX30102_DRV_NAME      "max30102"
 #define MAX30102_PART_NUMBER   0x15
 
@@ -112,7 +111,7 @@ struct max30102_data {
 };
 
 static const struct regmap_config max30102_regmap_config = {
-       .name = MAX30102_REGMAP_NAME,
+       .name = "max30102_regmap",
 
        .reg_bits = 8,
        .val_bits = 8,
index e321f89c534042c417dbe26cabb35a7dde9ae42b..66ff9c5fb66a2b89febdfa8fe3fec9a468924f12 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/iio/sysfs.h>
 #include <linux/iio/events.h>
 
-#define ADUX1020_REGMAP_NAME           "adux1020_regmap"
 #define ADUX1020_DRV_NAME              "adux1020"
 
 /* System registers */
@@ -114,7 +113,7 @@ static const struct adux1020_mode_data adux1020_modes[] = {
 };
 
 static const struct regmap_config adux1020_regmap_config = {
-       .name = ADUX1020_REGMAP_NAME,
+       .name = "adux1020_regmap",
        .reg_bits = 8,
        .val_bits = 16,
        .max_register = 0x6F,
index d3f415930ec953b070a3ed5e40631f89d9cc1adc..9b8af11b7b67a6e831daff5360f8995748b69de3 100644 (file)
@@ -25,8 +25,6 @@
 
 #include <linux/unaligned.h>
 
-#define APDS9160_REGMAP_NAME "apds9160_regmap"
-
 /* Main control register */
 #define APDS9160_REG_CTRL 0x00
 #define APDS9160_CTRL_SWRESET BIT(4) /* 1: Activate reset */
@@ -161,7 +159,7 @@ static const struct regmap_access_table apds9160_volatile_table = {
 };
 
 static const struct regmap_config apds9160_regmap_config = {
-       .name = APDS9160_REGMAP_NAME,
+       .name = "apds9160_regmap",
        .reg_bits = 8,
        .val_bits = 8,
        .use_single_read = true,
index 0003a29bf264e93ee4e0949f65ffaf31fed17ce7..b92d0fce5aec620e1404a12e43676f0cc9c3d1f0 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/iio/kfifo_buf.h>
 #include <linux/iio/sysfs.h>
 
-#define APDS9960_REGMAP_NAME   "apds9960_regmap"
 #define APDS9960_DRV_NAME      "apds9960"
 
 #define APDS9960_REG_RAM_START 0x00
@@ -221,7 +220,7 @@ static const struct regmap_access_table apds9960_writeable_table = {
 };
 
 static const struct regmap_config apds9960_regmap_config = {
-       .name = APDS9960_REGMAP_NAME,
+       .name = "apds9960_regmap",
        .reg_bits = 8,
        .val_bits = 8,
        .use_single_read = true,
index fa4677c2893133a74f4b83225b945a647a91b0b1..6978d02a4df59291ede18c75dc7c5bec9903fb03 100644 (file)
 #define JSA1212_PXS_DELAY_MS   100
 
 #define JSA1212_DRIVER_NAME    "jsa1212"
-#define JSA1212_REGMAP_NAME    "jsa1212_regmap"
 
 enum jsa1212_op_mode {
        JSA1212_OPMODE_ALS_EN,
@@ -300,7 +299,7 @@ static bool jsa1212_is_volatile_reg(struct device *dev, unsigned int reg)
 }
 
 static const struct regmap_config jsa1212_regmap_config = {
-       .name =  JSA1212_REGMAP_NAME,
+       .name = "jsa1212_regmap",
        .reg_bits = 8,
        .val_bits = 8,
        .max_register = JSA1212_MAX_REG,
index 28a3aabfc7efc552b1e08fd8415fc08aba7b8a2f..db0cc3642bd8010358de8515c24337d7385bce38 100644 (file)
@@ -63,8 +63,6 @@
 #define LTR501_ALS_DEF_PERIOD 500000
 #define LTR501_PS_DEF_PERIOD 100000
 
-#define LTR501_REGMAP_NAME "ltr501_regmap"
-
 #define LTR501_LUX_CONV(vis_coeff, vis_data, ir_coeff, ir_data) \
                        ((vis_coeff * vis_data) - (ir_coeff * ir_data))
 
@@ -1402,7 +1400,7 @@ static bool ltr501_is_volatile_reg(struct device *dev, unsigned int reg)
 }
 
 static const struct regmap_config ltr501_regmap_config = {
-       .name =  LTR501_REGMAP_NAME,
+       .name = "ltr501_regmap",
        .reg_bits = 8,
        .val_bits = 8,
        .max_register = LTR501_MAX_REG,
index 9fca376d17c070dac8787a2bba51ea50be190e8a..c50183f07240316890cede1d7c55715422669386 100644 (file)
@@ -69,7 +69,6 @@
 #define RPR0521_DEFAULT_MEAS_TIME      0x06 /* ALS - 100ms, PXS - 100ms */
 
 #define RPR0521_DRV_NAME               "RPR0521"
-#define RPR0521_REGMAP_NAME            "rpr0521_regmap"
 
 #define RPR0521_SLEEP_DELAY_MS 2000
 
@@ -913,7 +912,7 @@ static bool rpr0521_is_volatile_reg(struct device *dev, unsigned int reg)
 }
 
 static const struct regmap_config rpr0521_regmap_config = {
-       .name           = RPR0521_REGMAP_NAME,
+       .name           = "rpr0521_regmap",
 
        .reg_bits       = 8,
        .val_bits       = 8,
index d52133d23abdfb3c0fb9643086e55a1d3ea5a143..81dd2bfc22c05fb5a4826b2f6a9dcec916434d11 100644 (file)
@@ -46,7 +46,6 @@
 #define STK3310_PS_MAX_VAL                     0xFFFF
 
 #define STK3310_DRIVER_NAME                    "stk3310"
-#define STK3310_REGMAP_NAME                    "stk3310_regmap"
 
 #define STK3310_SCALE_AVAILABLE                        "6.4 1.6 0.4 0.1"
 
@@ -526,7 +525,7 @@ static bool stk3310_is_volatile_reg(struct device *dev, unsigned int reg)
 }
 
 static const struct regmap_config stk3310_regmap_config = {
-       .name = STK3310_REGMAP_NAME,
+       .name = "stk3310_regmap",
        .reg_bits = 8,
        .val_bits = 8,
        .max_register = STK3310_MAX_REG,
index 796677ebcdf72f0e8d10ffa03d0892a5daae5f71..01bc99564f985ff9d4f7b725e2e7987d4a02adb8 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/iio/triggered_buffer.h>
 
 #define VCNL4035_DRV_NAME      "vcnl4035"
-#define VCNL4035_REGMAP_NAME   "vcnl4035_regmap"
 
 /* Device registers */
 #define VCNL4035_ALS_CONF      0x00
@@ -502,7 +501,7 @@ static bool vcnl4035_is_volatile_reg(struct device *dev, unsigned int reg)
 }
 
 static const struct regmap_config vcnl4035_regmap_config = {
-       .name           = VCNL4035_REGMAP_NAME,
+       .name           = "vcnl4035_regmap",
        .reg_bits       = 8,
        .val_bits       = 16,
        .max_register   = VCNL4035_DEV_ID,
index e08a57cd6de264a4f1a3b8b070c7846144694bc7..f3d48d03f7c3a47c78c366dcc131f3a0e918d9aa 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/iio/sysfs.h>
 
 #define MMC35240_DRV_NAME "mmc35240"
-#define MMC35240_REGMAP_NAME "mmc35240_regmap"
 
 #define MMC35240_REG_XOUT_L    0x00
 #define MMC35240_REG_XOUT_H    0x01
@@ -463,7 +462,7 @@ static const struct reg_default mmc35240_reg_defaults[] = {
 };
 
 static const struct regmap_config mmc35240_regmap_config = {
-       .name = MMC35240_REGMAP_NAME,
+       .name = "mmc35240_regmap",
 
        .reg_bits = 8,
        .val_bits = 8,