Commit 0108ae7f authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: em28xx: constify most static structs

There are several em28xx static structs that can now be constified.

That caused a significant reduction at data segment:

Before:
   text	   data	    bss	    dec	    hex	filename
  85017	  59588	    576	 145181	  2371d	drivers/media/usb/em28xx/em28xx.o

After:
   text	   data	    bss	    dec	    hex	filename
 112345	  32292	    576	 145213	  2373d	drivers/media/usb/em28xx/em28xx.o
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent aa62980b
This diff is collapsed.
......@@ -712,7 +712,7 @@ int em28xx_capture_start(struct em28xx *dev, int start)
return rc;
}
int em28xx_gpio_set(struct em28xx *dev, struct em28xx_reg_seq *gpio)
int em28xx_gpio_set(struct em28xx *dev, const struct em28xx_reg_seq *gpio)
{
int rc = 0;
......
......@@ -515,7 +515,8 @@ static void em28xx_query_buttons(struct work_struct *work)
j = 0;
while (dev->board.buttons[j].role >= 0 &&
dev->board.buttons[j].role < EM28XX_NUM_BUTTON_ROLES) {
struct em28xx_button *button = &dev->board.buttons[j];
const struct em28xx_button *button = &dev->board.buttons[j];
/* Check if button uses the current address */
if (button->reg_r != dev->button_polling_addresses[i]) {
j++;
......@@ -618,7 +619,8 @@ static void em28xx_init_buttons(struct em28xx *dev)
dev->button_polling_interval = EM28XX_BUTTONS_DEBOUNCED_QUERY_INTERVAL;
while (dev->board.buttons[i].role >= 0 &&
dev->board.buttons[i].role < EM28XX_NUM_BUTTON_ROLES) {
struct em28xx_button *button = &dev->board.buttons[i];
const struct em28xx_button *button = &dev->board.buttons[i];
/* Check if polling address is already on the list */
addr_new = true;
for (j = 0; j < dev->num_button_polling_addresses; j++) {
......
......@@ -386,7 +386,7 @@ struct em28xx_input {
unsigned int vmux;
enum em28xx_amux amux;
enum em28xx_aout aout;
struct em28xx_reg_seq *gpio;
const struct em28xx_reg_seq *gpio;
};
#define INPUT(nr) (&em28xx_boards[dev->model].input[nr])
......@@ -450,10 +450,10 @@ struct em28xx_board {
unsigned int tda9887_conf;
/* GPIO sequences */
struct em28xx_reg_seq *dvb_gpio;
struct em28xx_reg_seq *suspend_gpio;
struct em28xx_reg_seq *tuner_gpio;
struct em28xx_reg_seq *mute_gpio;
const struct em28xx_reg_seq *dvb_gpio;
const struct em28xx_reg_seq *suspend_gpio;
const struct em28xx_reg_seq *tuner_gpio;
const struct em28xx_reg_seq *mute_gpio;
unsigned int is_em2800:1;
unsigned int has_msp34xx:1;
......@@ -480,7 +480,7 @@ struct em28xx_board {
struct em28xx_led *leds;
/* Buttons */
struct em28xx_button *buttons;
const struct em28xx_button *buttons;
};
struct em28xx_eeprom {
......@@ -792,7 +792,7 @@ int em28xx_init_usb_xfer(struct em28xx *dev, enum em28xx_mode mode,
void em28xx_uninit_usb_xfer(struct em28xx *dev, enum em28xx_mode mode);
void em28xx_stop_urbs(struct em28xx *dev);
int em28xx_set_mode(struct em28xx *dev, enum em28xx_mode set_mode);
int em28xx_gpio_set(struct em28xx *dev, struct em28xx_reg_seq *gpio);
int em28xx_gpio_set(struct em28xx *dev, const struct em28xx_reg_seq *gpio);
int em28xx_register_extension(struct em28xx_ops *dev);
void em28xx_unregister_extension(struct em28xx_ops *dev);
void em28xx_init_extension(struct em28xx *dev);
......@@ -801,7 +801,7 @@ int em28xx_suspend_extension(struct em28xx *dev);
int em28xx_resume_extension(struct em28xx *dev);
/* Provided by em28xx-cards.c */
extern struct em28xx_board em28xx_boards[];
extern const struct em28xx_board em28xx_boards[];
extern struct usb_device_id em28xx_id_table[];
int em28xx_tuner_callback(void *ptr, int component, int command, int arg);
void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl);
......
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