Commit 62154991 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Linus Torvalds

gpiolib: make names array and its values const

gpiolib doesn't need to modify the names and I assume most initializers
use string constants that shouldn't be modified anyhow.

[akpm@linux-foundation.org: fix drivers/gpio/cs5535-gpio.c]
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Kevin Wells <kevin.wells@nxp.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a80a0bbe
...@@ -197,7 +197,7 @@ static int chip_direction_output(struct gpio_chip *c, unsigned offset, int val) ...@@ -197,7 +197,7 @@ static int chip_direction_output(struct gpio_chip *c, unsigned offset, int val)
return 0; return 0;
} }
static char *cs5535_gpio_names[] = { static const char * const cs5535_gpio_names[] = {
"GPIO0", "GPIO1", "GPIO2", "GPIO3", "GPIO0", "GPIO1", "GPIO2", "GPIO3",
"GPIO4", "GPIO5", "GPIO6", "GPIO7", "GPIO4", "GPIO5", "GPIO6", "GPIO7",
"GPIO8", "GPIO9", "GPIO10", "GPIO11", "GPIO8", "GPIO9", "GPIO10", "GPIO11",
......
...@@ -722,7 +722,7 @@ int gpio_export(unsigned gpio, bool direction_may_change) ...@@ -722,7 +722,7 @@ int gpio_export(unsigned gpio, bool direction_may_change)
unsigned long flags; unsigned long flags;
struct gpio_desc *desc; struct gpio_desc *desc;
int status = -EINVAL; int status = -EINVAL;
char *ioname = NULL; const char *ioname = NULL;
/* can't export until sysfs is available ... */ /* can't export until sysfs is available ... */
if (!gpio_class.p) { if (!gpio_class.p) {
......
...@@ -73,7 +73,7 @@ struct pca953x_chip { ...@@ -73,7 +73,7 @@ struct pca953x_chip {
struct i2c_client *client; struct i2c_client *client;
struct pca953x_platform_data *dyn_pdata; struct pca953x_platform_data *dyn_pdata;
struct gpio_chip gpio_chip; struct gpio_chip gpio_chip;
char **names; const char *const *names;
}; };
static int pca953x_write_reg(struct pca953x_chip *chip, int reg, uint16_t val) static int pca953x_write_reg(struct pca953x_chip *chip, int reg, uint16_t val)
......
...@@ -98,7 +98,7 @@ struct gpio_chip { ...@@ -98,7 +98,7 @@ struct gpio_chip {
struct gpio_chip *chip); struct gpio_chip *chip);
int base; int base;
u16 ngpio; u16 ngpio;
char **names; const char *const *names;
unsigned can_sleep:1; unsigned can_sleep:1;
unsigned exported:1; unsigned exported:1;
}; };
......
...@@ -24,7 +24,7 @@ struct pca953x_platform_data { ...@@ -24,7 +24,7 @@ struct pca953x_platform_data {
int (*teardown)(struct i2c_client *client, int (*teardown)(struct i2c_client *client,
unsigned gpio, unsigned ngpio, unsigned gpio, unsigned ngpio,
void *context); void *context);
char **names; const char *const *names;
}; };
#endif /* _LINUX_PCA953X_H */ #endif /* _LINUX_PCA953X_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment