]> www.infradead.org Git - users/hch/misc.git/commitdiff
iio: Remove single use of macro definition for driver name
authorWaqar Hameed <waqar.hameed@axis.com>
Tue, 27 May 2025 14:45:41 +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 driver name as a macro
definition if it is only used once (often as `.name` in `struct
device_driver`). 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/4840779a167e027b8be77c82f7a4f27210ef084a.1748356671.git.waqar.hameed@axis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
13 files changed:
drivers/iio/accel/kxcjk-1013.c
drivers/iio/accel/mma9551.c
drivers/iio/accel/mma9553.c
drivers/iio/accel/sca3300.c
drivers/iio/adc/hi8435.c
drivers/iio/adc/max9611.c
drivers/iio/adc/vf610_adc.c
drivers/iio/dac/max517.c
drivers/iio/dac/mcp4725.c
drivers/iio/humidity/dht11.c
drivers/iio/imu/kmx61.c
drivers/iio/light/ltr501.c
drivers/iio/resolver/ad2s1200.c

index 910d7b5716e194835d6e5b644e68cc263f8d51cd..18e4272877131e3b2cc8bb082026d7fe00722588 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/iio/triggered_buffer.h>
 #include <linux/iio/accel/kxcjk_1013.h>
 
-#define KXCJK1013_DRV_NAME "kxcjk1013"
 #define KXCJK1013_IRQ_NAME "kxcjk1013_event"
 
 #define KXTF9_REG_HP_XOUT_L            0x00
@@ -1674,7 +1673,7 @@ MODULE_DEVICE_TABLE(acpi, kx_acpi_match);
 
 static struct i2c_driver kxcjk1013_driver = {
        .driver = {
-               .name   = KXCJK1013_DRV_NAME,
+               .name   = "kxcjk1013",
                .acpi_match_table = kx_acpi_match,
                .of_match_table = kxcjk1013_of_match,
                .pm     = pm_ptr(&kxcjk1013_pm_ops),
index b89bad9e6fe6224a7c2c73d34b80d1e4be838138..e23383f5d4268fee0155596faf880b4fe44ae82c 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/pm_runtime.h>
 #include "mma9551_core.h"
 
-#define MMA9551_DRV_NAME               "mma9551"
 #define MMA9551_IRQ_NAME               "mma9551_event"
 #define MMA9551_GPIO_COUNT             4
 
@@ -592,7 +591,7 @@ MODULE_DEVICE_TABLE(i2c, mma9551_id);
 
 static struct i2c_driver mma9551_driver = {
        .driver = {
-                  .name = MMA9551_DRV_NAME,
+                  .name = "mma9551",
                   .acpi_match_table = mma9551_acpi_match,
                   .pm = pm_ptr(&mma9551_pm_ops),
        },
index 1bbe660b254fcfc426fe07d25082098caf440e57..8dd26fb586ebaf1b1e08554c5d00f6c2c481d828 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/pm_runtime.h>
 #include "mma9551_core.h"
 
-#define MMA9553_DRV_NAME                       "mma9553"
 #define MMA9553_IRQ_NAME                       "mma9553_event"
 
 /* Pedometer configuration registers (R/W) */
@@ -1230,7 +1229,7 @@ MODULE_DEVICE_TABLE(i2c, mma9553_id);
 
 static struct i2c_driver mma9553_driver = {
        .driver = {
-                  .name = MMA9553_DRV_NAME,
+                  .name = "mma9553",
                   .acpi_match_table = mma9553_acpi_match,
                   .pm = pm_ptr(&mma9553_pm_ops),
        },
index 67416a406e2f43e4e417210410904d44c93111d2..bda370c0f660b2a603d7d70dbe5e088bf96eca7a 100644 (file)
@@ -20,8 +20,6 @@
 #include <linux/iio/trigger_consumer.h>
 #include <linux/iio/triggered_buffer.h>
 
-#define SCA3300_ALIAS "sca3300"
-
 #define SCA3300_CRC8_POLYNOMIAL 0x1d
 
 /* Device mode register */
@@ -674,7 +672,7 @@ MODULE_DEVICE_TABLE(spi, sca3300_ids);
 
 static struct spi_driver sca3300_driver = {
        .driver   = {
-               .name           = SCA3300_ALIAS,
+               .name           = "sca3300",
                .of_match_table = sca3300_dt_ids,
        },
        .probe    = sca3300_probe,
index b4562aae84770d11c281d9ed2886f7ab1d2aff75..86c10ea7ded4e82aa9bd1531252b3cffe4b0e5aa 100644 (file)
@@ -19,8 +19,6 @@
 #include <linux/spi/spi.h>
 #include <linux/gpio/consumer.h>
 
-#define DRV_NAME "hi8435"
-
 /* Register offsets for HI-8435 */
 #define HI8435_CTRL_REG                0x02
 #define HI8435_PSEN_REG                0x04
@@ -536,7 +534,7 @@ MODULE_DEVICE_TABLE(spi, hi8435_id);
 
 static struct spi_driver hi8435_driver = {
        .driver = {
-               .name           = DRV_NAME,
+               .name           = "hi8435",
                .of_match_table = hi8435_dt_ids,
        },
        .probe          = hi8435_probe,
index 14fe42fc4b7dac704ee3178517810a6eaf46b22f..826566d7a85e4f3e8ea224dd764f6e4892d41cc9 100644 (file)
@@ -25,8 +25,6 @@
 #include <linux/mod_devicetable.h>
 #include <linux/property.h>
 
-#define DRIVER_NAME                    "max9611"
-
 /* max9611 register addresses */
 #define MAX9611_REG_CSA_DATA           0x00
 #define MAX9611_REG_RS_DATA            0x02
@@ -553,7 +551,7 @@ static int max9611_probe(struct i2c_client *client)
 
 static struct i2c_driver max9611_driver = {
        .driver = {
-                  .name = DRIVER_NAME,
+                  .name = "max9611",
                   .of_match_table = max9611_of_table,
        },
        .probe = max9611_probe,
index 6404b015234a4dea0ae3404d31739d1f0d74916b..1b3b1843a8012cb0e2c4ca1964d54b86f1c1bd7b 100644 (file)
@@ -28,9 +28,6 @@
 #include <linux/iio/trigger_consumer.h>
 #include <linux/iio/triggered_buffer.h>
 
-/* This will be the driver name the kernel reports */
-#define DRIVER_NAME "vf610-adc"
-
 /* Vybrid/IMX ADC registers */
 #define VF610_REG_ADC_HC0              0x00
 #define VF610_REG_ADC_HC1              0x04
@@ -952,7 +949,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(vf610_adc_pm_ops, vf610_adc_suspend,
 static struct platform_driver vf610_adc_driver = {
        .probe          = vf610_adc_probe,
        .driver         = {
-               .name   = DRIVER_NAME,
+               .name   = "vf610-adc",
                .of_match_table = vf610_adc_match,
                .pm     = pm_sleep_ptr(&vf610_adc_pm_ops),
        },
index 84336736a47bddd51130b54a8b33092235ecced1..d334c67821ad651e15533133ca2014ba5aa2fc32 100644 (file)
@@ -15,8 +15,6 @@
 #include <linux/iio/sysfs.h>
 #include <linux/iio/dac/max517.h>
 
-#define MAX517_DRV_NAME        "max517"
-
 /* Commands */
 #define COMMAND_CHANNEL0       0x00
 #define COMMAND_CHANNEL1       0x01 /* for MAX518 and MAX519 */
@@ -200,7 +198,7 @@ MODULE_DEVICE_TABLE(i2c, max517_id);
 
 static struct i2c_driver max517_driver = {
        .driver = {
-               .name   = MAX517_DRV_NAME,
+               .name   = "max517",
                .pm     = pm_sleep_ptr(&max517_pm_ops),
        },
        .probe          = max517_probe,
index 62972494a2291af62fd62ae893b4cefd6f00c227..23b9e3a09ec816abb900f74b0d93999693123e79 100644 (file)
@@ -24,8 +24,6 @@
 
 #include <linux/iio/dac/mcp4725.h>
 
-#define MCP4725_DRV_NAME "mcp4725"
-
 #define MCP472X_REF_VDD                        0x00
 #define MCP472X_REF_VREF_UNBUFFERED    0x02
 #define MCP472X_REF_VREF_BUFFERED      0x03
@@ -546,7 +544,7 @@ MODULE_DEVICE_TABLE(of, mcp4725_of_match);
 
 static struct i2c_driver mcp4725_driver = {
        .driver = {
-               .name   = MCP4725_DRV_NAME,
+               .name   = "mcp4725",
                .of_match_table = mcp4725_of_match,
                .pm     = pm_sleep_ptr(&mcp4725_pm_ops),
        },
index 48c59d09eea7a8c46197cfe12039e3c7dca6d1dc..73d2033954e785b31712e1fdc515bb4f4d26e047 100644 (file)
@@ -27,8 +27,6 @@
 
 #include <linux/iio/iio.h>
 
-#define DRIVER_NAME    "dht11"
-
 #define DHT11_DATA_VALID_TIME  2000000000  /* 2s in ns */
 
 #define DHT11_EDGES_PREAMBLE 2
@@ -331,7 +329,7 @@ static int dht11_probe(struct platform_device *pdev)
 
 static struct platform_driver dht11_driver = {
        .driver = {
-               .name   = DRIVER_NAME,
+               .name   = "dht11",
                .of_match_table = dht11_dt_ids,
        },
        .probe  = dht11_probe,
index 2bdfb2619137c353c2659f554f4ff84b612e1718..1b8e8d362cd47009035ab5e1bb435b00bb7474fd 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/iio/triggered_buffer.h>
 #include <linux/iio/trigger_consumer.h>
 
-#define KMX61_DRV_NAME "kmx61"
 #define KMX61_IRQ_NAME "kmx61_event"
 
 #define KMX61_REG_WHO_AM_I     0x00
@@ -1494,7 +1493,7 @@ MODULE_DEVICE_TABLE(i2c, kmx61_id);
 
 static struct i2c_driver kmx61_driver = {
        .driver = {
-               .name = KMX61_DRV_NAME,
+               .name = "kmx61",
                .pm = pm_ptr(&kmx61_pm_ops),
        },
        .probe          = kmx61_probe,
index 8d8051cf6927c65521171ddbd13871993ee4e6b4..28a3aabfc7efc552b1e08fd8415fc08aba7b8a2f 100644 (file)
@@ -24,8 +24,6 @@
 #include <linux/iio/buffer.h>
 #include <linux/iio/triggered_buffer.h>
 
-#define LTR501_DRV_NAME "ltr501"
-
 #define LTR501_ALS_CONTR 0x80 /* ALS operation mode, SW reset */
 #define LTR501_PS_CONTR 0x81 /* PS operation mode */
 #define LTR501_PS_MEAS_RATE 0x84 /* measurement rate*/
@@ -1626,7 +1624,7 @@ MODULE_DEVICE_TABLE(of, ltr501_of_match);
 
 static struct i2c_driver ltr501_driver = {
        .driver = {
-               .name   = LTR501_DRV_NAME,
+               .name   = "ltr501",
                .of_match_table = ltr501_of_match,
                .pm     = pm_sleep_ptr(&ltr501_pm_ops),
                .acpi_match_table = ltr_acpi_match,
index 0bc84f12cb341a4c1a30fd2211f46565f8466cc6..c00a60cb31a5e9335adc099f1505c2799f8d37d0 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 
-#define DRV_NAME "ad2s1200"
 
 /* input clock on serial interface */
 #define AD2S1200_HZ    8192000
@@ -192,7 +191,7 @@ MODULE_DEVICE_TABLE(spi, ad2s1200_id);
 
 static struct spi_driver ad2s1200_driver = {
        .driver = {
-               .name = DRV_NAME,
+               .name = "ad2s1200",
                .of_match_table = ad2s1200_of_match,
        },
        .probe = ad2s1200_probe,