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

mfd: stmpe: Constify static struct resource

Constify a couple of static struct resource. The only usage of the
structs is to assign their address to the resources field in the
mfd_cell struct. This allows the compiler to put them in read-only
memory. Done with the help of Coccinelle.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Rikard Falkeborn and committed by
Lee Jones
8d7b3a6d 5a1acf2b

+5 -5
+5 -5
drivers/mfd/stmpe.c
··· 312 312 * GPIO (all variants) 313 313 */ 314 314 315 - static struct resource stmpe_gpio_resources[] = { 315 + static const struct resource stmpe_gpio_resources[] = { 316 316 /* Start and end filled dynamically */ 317 317 { 318 318 .flags = IORESOURCE_IRQ, ··· 336 336 * Keypad (1601, 2401, 2403) 337 337 */ 338 338 339 - static struct resource stmpe_keypad_resources[] = { 339 + static const struct resource stmpe_keypad_resources[] = { 340 340 { 341 341 .name = "KEYPAD", 342 342 .flags = IORESOURCE_IRQ, ··· 357 357 /* 358 358 * PWM (1601, 2401, 2403) 359 359 */ 360 - static struct resource stmpe_pwm_resources[] = { 360 + static const struct resource stmpe_pwm_resources[] = { 361 361 { 362 362 .name = "PWM0", 363 363 .flags = IORESOURCE_IRQ, ··· 445 445 * Touchscreen (STMPE811 or STMPE610) 446 446 */ 447 447 448 - static struct resource stmpe_ts_resources[] = { 448 + static const struct resource stmpe_ts_resources[] = { 449 449 { 450 450 .name = "TOUCH_DET", 451 451 .flags = IORESOURCE_IRQ, ··· 467 467 * ADC (STMPE811) 468 468 */ 469 469 470 - static struct resource stmpe_adc_resources[] = { 470 + static const struct resource stmpe_adc_resources[] = { 471 471 { 472 472 .name = "STMPE_TEMP_SENS", 473 473 .flags = IORESOURCE_IRQ,