Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: Remove single use of macro definition for driver name

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>

authored by

Waqar Hameed and committed by
Jonathan Cameron
178e4bc1 fe03825b

+13 -35
+1 -2
drivers/iio/accel/kxcjk-1013.c
··· 26 26 #include <linux/iio/triggered_buffer.h> 27 27 #include <linux/iio/accel/kxcjk_1013.h> 28 28 29 - #define KXCJK1013_DRV_NAME "kxcjk1013" 30 29 #define KXCJK1013_IRQ_NAME "kxcjk1013_event" 31 30 32 31 #define KXTF9_REG_HP_XOUT_L 0x00 ··· 1673 1674 1674 1675 static struct i2c_driver kxcjk1013_driver = { 1675 1676 .driver = { 1676 - .name = KXCJK1013_DRV_NAME, 1677 + .name = "kxcjk1013", 1677 1678 .acpi_match_table = kx_acpi_match, 1678 1679 .of_match_table = kxcjk1013_of_match, 1679 1680 .pm = pm_ptr(&kxcjk1013_pm_ops),
+1 -2
drivers/iio/accel/mma9551.c
··· 17 17 #include <linux/pm_runtime.h> 18 18 #include "mma9551_core.h" 19 19 20 - #define MMA9551_DRV_NAME "mma9551" 21 20 #define MMA9551_IRQ_NAME "mma9551_event" 22 21 #define MMA9551_GPIO_COUNT 4 23 22 ··· 591 592 592 593 static struct i2c_driver mma9551_driver = { 593 594 .driver = { 594 - .name = MMA9551_DRV_NAME, 595 + .name = "mma9551", 595 596 .acpi_match_table = mma9551_acpi_match, 596 597 .pm = pm_ptr(&mma9551_pm_ops), 597 598 },
+1 -2
drivers/iio/accel/mma9553.c
··· 15 15 #include <linux/pm_runtime.h> 16 16 #include "mma9551_core.h" 17 17 18 - #define MMA9553_DRV_NAME "mma9553" 19 18 #define MMA9553_IRQ_NAME "mma9553_event" 20 19 21 20 /* Pedometer configuration registers (R/W) */ ··· 1229 1230 1230 1231 static struct i2c_driver mma9553_driver = { 1231 1232 .driver = { 1232 - .name = MMA9553_DRV_NAME, 1233 + .name = "mma9553", 1233 1234 .acpi_match_table = mma9553_acpi_match, 1234 1235 .pm = pm_ptr(&mma9553_pm_ops), 1235 1236 },
+1 -3
drivers/iio/accel/sca3300.c
··· 20 20 #include <linux/iio/trigger_consumer.h> 21 21 #include <linux/iio/triggered_buffer.h> 22 22 23 - #define SCA3300_ALIAS "sca3300" 24 - 25 23 #define SCA3300_CRC8_POLYNOMIAL 0x1d 26 24 27 25 /* Device mode register */ ··· 672 674 673 675 static struct spi_driver sca3300_driver = { 674 676 .driver = { 675 - .name = SCA3300_ALIAS, 677 + .name = "sca3300", 676 678 .of_match_table = sca3300_dt_ids, 677 679 }, 678 680 .probe = sca3300_probe,
+1 -3
drivers/iio/adc/hi8435.c
··· 19 19 #include <linux/spi/spi.h> 20 20 #include <linux/gpio/consumer.h> 21 21 22 - #define DRV_NAME "hi8435" 23 - 24 22 /* Register offsets for HI-8435 */ 25 23 #define HI8435_CTRL_REG 0x02 26 24 #define HI8435_PSEN_REG 0x04 ··· 534 536 535 537 static struct spi_driver hi8435_driver = { 536 538 .driver = { 537 - .name = DRV_NAME, 539 + .name = "hi8435", 538 540 .of_match_table = hi8435_dt_ids, 539 541 }, 540 542 .probe = hi8435_probe,
+1 -3
drivers/iio/adc/max9611.c
··· 25 25 #include <linux/mod_devicetable.h> 26 26 #include <linux/property.h> 27 27 28 - #define DRIVER_NAME "max9611" 29 - 30 28 /* max9611 register addresses */ 31 29 #define MAX9611_REG_CSA_DATA 0x00 32 30 #define MAX9611_REG_RS_DATA 0x02 ··· 551 553 552 554 static struct i2c_driver max9611_driver = { 553 555 .driver = { 554 - .name = DRIVER_NAME, 556 + .name = "max9611", 555 557 .of_match_table = max9611_of_table, 556 558 }, 557 559 .probe = max9611_probe,
+1 -4
drivers/iio/adc/vf610_adc.c
··· 28 28 #include <linux/iio/trigger_consumer.h> 29 29 #include <linux/iio/triggered_buffer.h> 30 30 31 - /* This will be the driver name the kernel reports */ 32 - #define DRIVER_NAME "vf610-adc" 33 - 34 31 /* Vybrid/IMX ADC registers */ 35 32 #define VF610_REG_ADC_HC0 0x00 36 33 #define VF610_REG_ADC_HC1 0x04 ··· 949 952 static struct platform_driver vf610_adc_driver = { 950 953 .probe = vf610_adc_probe, 951 954 .driver = { 952 - .name = DRIVER_NAME, 955 + .name = "vf610-adc", 953 956 .of_match_table = vf610_adc_match, 954 957 .pm = pm_sleep_ptr(&vf610_adc_pm_ops), 955 958 },
+1 -3
drivers/iio/dac/max517.c
··· 15 15 #include <linux/iio/sysfs.h> 16 16 #include <linux/iio/dac/max517.h> 17 17 18 - #define MAX517_DRV_NAME "max517" 19 - 20 18 /* Commands */ 21 19 #define COMMAND_CHANNEL0 0x00 22 20 #define COMMAND_CHANNEL1 0x01 /* for MAX518 and MAX519 */ ··· 198 200 199 201 static struct i2c_driver max517_driver = { 200 202 .driver = { 201 - .name = MAX517_DRV_NAME, 203 + .name = "max517", 202 204 .pm = pm_sleep_ptr(&max517_pm_ops), 203 205 }, 204 206 .probe = max517_probe,
+1 -3
drivers/iio/dac/mcp4725.c
··· 24 24 25 25 #include <linux/iio/dac/mcp4725.h> 26 26 27 - #define MCP4725_DRV_NAME "mcp4725" 28 - 29 27 #define MCP472X_REF_VDD 0x00 30 28 #define MCP472X_REF_VREF_UNBUFFERED 0x02 31 29 #define MCP472X_REF_VREF_BUFFERED 0x03 ··· 544 546 545 547 static struct i2c_driver mcp4725_driver = { 546 548 .driver = { 547 - .name = MCP4725_DRV_NAME, 549 + .name = "mcp4725", 548 550 .of_match_table = mcp4725_of_match, 549 551 .pm = pm_sleep_ptr(&mcp4725_pm_ops), 550 552 },
+1 -3
drivers/iio/humidity/dht11.c
··· 27 27 28 28 #include <linux/iio/iio.h> 29 29 30 - #define DRIVER_NAME "dht11" 31 - 32 30 #define DHT11_DATA_VALID_TIME 2000000000 /* 2s in ns */ 33 31 34 32 #define DHT11_EDGES_PREAMBLE 2 ··· 329 331 330 332 static struct platform_driver dht11_driver = { 331 333 .driver = { 332 - .name = DRIVER_NAME, 334 + .name = "dht11", 333 335 .of_match_table = dht11_dt_ids, 334 336 }, 335 337 .probe = dht11_probe,
+1 -2
drivers/iio/imu/kmx61.c
··· 22 22 #include <linux/iio/triggered_buffer.h> 23 23 #include <linux/iio/trigger_consumer.h> 24 24 25 - #define KMX61_DRV_NAME "kmx61" 26 25 #define KMX61_IRQ_NAME "kmx61_event" 27 26 28 27 #define KMX61_REG_WHO_AM_I 0x00 ··· 1493 1494 1494 1495 static struct i2c_driver kmx61_driver = { 1495 1496 .driver = { 1496 - .name = KMX61_DRV_NAME, 1497 + .name = "kmx61", 1497 1498 .pm = pm_ptr(&kmx61_pm_ops), 1498 1499 }, 1499 1500 .probe = kmx61_probe,
+1 -3
drivers/iio/light/ltr501.c
··· 24 24 #include <linux/iio/buffer.h> 25 25 #include <linux/iio/triggered_buffer.h> 26 26 27 - #define LTR501_DRV_NAME "ltr501" 28 - 29 27 #define LTR501_ALS_CONTR 0x80 /* ALS operation mode, SW reset */ 30 28 #define LTR501_PS_CONTR 0x81 /* PS operation mode */ 31 29 #define LTR501_PS_MEAS_RATE 0x84 /* measurement rate*/ ··· 1624 1626 1625 1627 static struct i2c_driver ltr501_driver = { 1626 1628 .driver = { 1627 - .name = LTR501_DRV_NAME, 1629 + .name = "ltr501", 1628 1630 .of_match_table = ltr501_of_match, 1629 1631 .pm = pm_sleep_ptr(&ltr501_pm_ops), 1630 1632 .acpi_match_table = ltr_acpi_match,
+1 -2
drivers/iio/resolver/ad2s1200.c
··· 21 21 #include <linux/iio/iio.h> 22 22 #include <linux/iio/sysfs.h> 23 23 24 - #define DRV_NAME "ad2s1200" 25 24 26 25 /* input clock on serial interface */ 27 26 #define AD2S1200_HZ 8192000 ··· 191 192 192 193 static struct spi_driver ad2s1200_driver = { 193 194 .driver = { 194 - .name = DRV_NAME, 195 + .name = "ad2s1200", 195 196 .of_match_table = ad2s1200_of_match, 196 197 }, 197 198 .probe = ad2s1200_probe,