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

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: Mauro Carvalho Chehab <mchehab@s-opensource.com>

+66 -64
+53 -53
drivers/media/usb/em28xx/em28xx-cards.c
··· 81 81 */ 82 82 83 83 /* Reset for the most [analog] boards */ 84 - static struct em28xx_reg_seq default_analog[] = { 84 + static const struct em28xx_reg_seq default_analog[] = { 85 85 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10}, 86 86 { -1, -1, -1, -1}, 87 87 }; 88 88 89 89 /* Reset for the most [digital] boards */ 90 - static struct em28xx_reg_seq default_digital[] = { 90 + static const struct em28xx_reg_seq default_digital[] = { 91 91 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10}, 92 92 { -1, -1, -1, -1}, 93 93 }; 94 94 95 95 /* Board Hauppauge WinTV HVR 900 analog */ 96 - static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = { 96 + static const struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = { 97 97 {EM2820_R08_GPIO_CTRL, 0x2d, ~EM_GPIO_4, 10}, 98 98 { 0x05, 0xff, 0x10, 10}, 99 99 { -1, -1, -1, -1}, 100 100 }; 101 101 102 102 /* Board Hauppauge WinTV HVR 900 digital */ 103 - static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = { 103 + static const struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = { 104 104 {EM2820_R08_GPIO_CTRL, 0x2e, ~EM_GPIO_4, 10}, 105 105 {EM2880_R04_GPO, 0x04, 0x0f, 10}, 106 106 {EM2880_R04_GPO, 0x0c, 0x0f, 10}, ··· 108 108 }; 109 109 110 110 /* Board Hauppauge WinTV HVR 900 (R2) digital */ 111 - static struct em28xx_reg_seq hauppauge_wintv_hvr_900R2_digital[] = { 111 + static const struct em28xx_reg_seq hauppauge_wintv_hvr_900R2_digital[] = { 112 112 {EM2820_R08_GPIO_CTRL, 0x2e, ~EM_GPIO_4, 10}, 113 113 {EM2880_R04_GPO, 0x0c, 0x0f, 10}, 114 114 { -1, -1, -1, -1}, 115 115 }; 116 116 117 117 /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */ 118 - static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = { 118 + static const struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = { 119 119 {EM2820_R08_GPIO_CTRL, 0x69, ~EM_GPIO_4, 10}, 120 120 { -1, -1, -1, -1}, 121 121 }; ··· 126 126 Analog - No input analog */ 127 127 128 128 /* Board - EM2882 Kworld 315U digital */ 129 - static struct em28xx_reg_seq em2882_kworld_315u_digital[] = { 129 + static const struct em28xx_reg_seq em2882_kworld_315u_digital[] = { 130 130 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10}, 131 131 {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10}, 132 132 {EM2880_R04_GPO, 0x04, 0xff, 10}, ··· 135 135 { -1, -1, -1, -1}, 136 136 }; 137 137 138 - static struct em28xx_reg_seq em2882_kworld_315u_tuner_gpio[] = { 138 + static const struct em28xx_reg_seq em2882_kworld_315u_tuner_gpio[] = { 139 139 {EM2880_R04_GPO, 0x08, 0xff, 10}, 140 140 {EM2880_R04_GPO, 0x0c, 0xff, 10}, 141 141 {EM2880_R04_GPO, 0x08, 0xff, 10}, ··· 143 143 { -1, -1, -1, -1}, 144 144 }; 145 145 146 - static struct em28xx_reg_seq kworld_330u_analog[] = { 146 + static const struct em28xx_reg_seq kworld_330u_analog[] = { 147 147 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10}, 148 148 {EM2880_R04_GPO, 0x00, 0xff, 10}, 149 149 { -1, -1, -1, -1}, 150 150 }; 151 151 152 - static struct em28xx_reg_seq kworld_330u_digital[] = { 152 + static const struct em28xx_reg_seq kworld_330u_digital[] = { 153 153 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10}, 154 154 {EM2880_R04_GPO, 0x08, 0xff, 10}, 155 155 { -1, -1, -1, -1}, ··· 161 161 GPIO4 - xc3028 reset 162 162 GOP3 - s5h1409 reset 163 163 */ 164 - static struct em28xx_reg_seq evga_indtube_analog[] = { 164 + static const struct em28xx_reg_seq evga_indtube_analog[] = { 165 165 {EM2820_R08_GPIO_CTRL, 0x79, 0xff, 60}, 166 166 { -1, -1, -1, -1}, 167 167 }; 168 168 169 - static struct em28xx_reg_seq evga_indtube_digital[] = { 169 + static const struct em28xx_reg_seq evga_indtube_digital[] = { 170 170 {EM2820_R08_GPIO_CTRL, 0x7a, 0xff, 1}, 171 171 {EM2880_R04_GPO, 0x04, 0xff, 10}, 172 172 {EM2880_R04_GPO, 0x0c, 0xff, 1}, ··· 184 184 * EM_GPIO_6 - currently unknown 185 185 * EM_GPIO_7 - currently unknown 186 186 */ 187 - static struct em28xx_reg_seq kworld_a340_digital[] = { 187 + static const struct em28xx_reg_seq kworld_a340_digital[] = { 188 188 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10}, 189 189 { -1, -1, -1, -1}, 190 190 }; 191 191 192 - static struct em28xx_reg_seq kworld_ub435q_v3_digital[] = { 192 + static const struct em28xx_reg_seq kworld_ub435q_v3_digital[] = { 193 193 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 100}, 194 194 {EM2874_R80_GPIO_P0_CTRL, 0xfe, 0xff, 100}, 195 195 {EM2874_R80_GPIO_P0_CTRL, 0xbe, 0xff, 100}, ··· 198 198 }; 199 199 200 200 /* Pinnacle Hybrid Pro eb1a:2881 */ 201 - static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = { 201 + static const struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = { 202 202 {EM2820_R08_GPIO_CTRL, 0xfd, ~EM_GPIO_4, 10}, 203 203 { -1, -1, -1, -1}, 204 204 }; 205 205 206 - static struct em28xx_reg_seq pinnacle_hybrid_pro_digital[] = { 206 + static const struct em28xx_reg_seq pinnacle_hybrid_pro_digital[] = { 207 207 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10}, 208 208 {EM2880_R04_GPO, 0x04, 0xff, 100},/* zl10353 reset */ 209 209 {EM2880_R04_GPO, 0x0c, 0xff, 1}, 210 210 { -1, -1, -1, -1}, 211 211 }; 212 212 213 - static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_analog[] = { 213 + static const struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_analog[] = { 214 214 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10}, 215 215 {EM2880_R04_GPO, 0x00, 0xff, 10}, 216 216 { -1, -1, -1, -1}, 217 217 }; 218 218 219 - static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_digital[] = { 219 + static const struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_digital[] = { 220 220 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10}, 221 221 {EM2880_R04_GPO, 0x08, 0xff, 10}, 222 222 { -1, -1, -1, -1}, ··· 226 226 0-5: not used 227 227 6: demod reset, active low 228 228 7: LED on, active high */ 229 - static struct em28xx_reg_seq em2874_pctv_80e_digital[] = { 229 + static const struct em28xx_reg_seq em2874_pctv_80e_digital[] = { 230 230 {EM28XX_R06_I2C_CLK, 0x45, 0xff, 10}, /*400 KHz*/ 231 231 {EM2874_R80_GPIO_P0_CTRL, 0x00, 0xff, 100},/*Demod reset*/ 232 232 {EM2874_R80_GPIO_P0_CTRL, 0x40, 0xff, 10}, ··· 236 236 /* eb1a:2868 Reddo DVB-C USB TV Box 237 237 GPIO4 - CU1216L NIM 238 238 Other GPIOs seems to be don't care. */ 239 - static struct em28xx_reg_seq reddo_dvb_c_usb_box[] = { 239 + static const struct em28xx_reg_seq reddo_dvb_c_usb_box[] = { 240 240 {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10}, 241 241 {EM2820_R08_GPIO_CTRL, 0xde, 0xff, 10}, 242 242 {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10}, ··· 248 248 }; 249 249 250 250 /* Callback for the most boards */ 251 - static struct em28xx_reg_seq default_tuner_gpio[] = { 251 + static const struct em28xx_reg_seq default_tuner_gpio[] = { 252 252 {EM2820_R08_GPIO_CTRL, EM_GPIO_4, EM_GPIO_4, 10}, 253 253 {EM2820_R08_GPIO_CTRL, 0, EM_GPIO_4, 10}, 254 254 {EM2820_R08_GPIO_CTRL, EM_GPIO_4, EM_GPIO_4, 10}, ··· 256 256 }; 257 257 258 258 /* Mute/unmute */ 259 - static struct em28xx_reg_seq compro_unmute_tv_gpio[] = { 259 + static const struct em28xx_reg_seq compro_unmute_tv_gpio[] = { 260 260 {EM2820_R08_GPIO_CTRL, 5, 7, 10}, 261 261 { -1, -1, -1, -1}, 262 262 }; 263 263 264 - static struct em28xx_reg_seq compro_unmute_svid_gpio[] = { 264 + static const struct em28xx_reg_seq compro_unmute_svid_gpio[] = { 265 265 {EM2820_R08_GPIO_CTRL, 4, 7, 10}, 266 266 { -1, -1, -1, -1}, 267 267 }; 268 268 269 - static struct em28xx_reg_seq compro_mute_gpio[] = { 269 + static const struct em28xx_reg_seq compro_mute_gpio[] = { 270 270 {EM2820_R08_GPIO_CTRL, 6, 7, 10}, 271 271 { -1, -1, -1, -1}, 272 272 }; 273 273 274 274 /* Terratec AV350 */ 275 - static struct em28xx_reg_seq terratec_av350_mute_gpio[] = { 275 + static const struct em28xx_reg_seq terratec_av350_mute_gpio[] = { 276 276 {EM2820_R08_GPIO_CTRL, 0xff, 0x7f, 10}, 277 277 { -1, -1, -1, -1}, 278 278 }; 279 279 280 - static struct em28xx_reg_seq terratec_av350_unmute_gpio[] = { 280 + static const struct em28xx_reg_seq terratec_av350_unmute_gpio[] = { 281 281 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10}, 282 282 { -1, -1, -1, -1}, 283 283 }; 284 284 285 - static struct em28xx_reg_seq silvercrest_reg_seq[] = { 285 + static const struct em28xx_reg_seq silvercrest_reg_seq[] = { 286 286 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10}, 287 287 {EM2820_R08_GPIO_CTRL, 0x01, 0xf7, 10}, 288 288 { -1, -1, -1, -1}, 289 289 }; 290 290 291 - static struct em28xx_reg_seq vc211a_enable[] = { 291 + static const struct em28xx_reg_seq vc211a_enable[] = { 292 292 {EM2820_R08_GPIO_CTRL, 0xff, 0x07, 10}, 293 293 {EM2820_R08_GPIO_CTRL, 0xff, 0x0f, 10}, 294 294 {EM2820_R08_GPIO_CTRL, 0xff, 0x0b, 10}, 295 295 { -1, -1, -1, -1}, 296 296 }; 297 297 298 - static struct em28xx_reg_seq dikom_dk300_digital[] = { 298 + static const struct em28xx_reg_seq dikom_dk300_digital[] = { 299 299 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10}, 300 300 {EM2880_R04_GPO, 0x08, 0xff, 10}, 301 301 { -1, -1, -1, -1}, 302 302 }; 303 303 304 304 /* Reset for the most [digital] boards */ 305 - static struct em28xx_reg_seq leadership_digital[] = { 305 + static const struct em28xx_reg_seq leadership_digital[] = { 306 306 {EM2874_R80_GPIO_P0_CTRL, 0x70, 0xff, 10}, 307 307 { -1, -1, -1, -1}, 308 308 }; 309 309 310 - static struct em28xx_reg_seq leadership_reset[] = { 310 + static const struct em28xx_reg_seq leadership_reset[] = { 311 311 {EM2874_R80_GPIO_P0_CTRL, 0xf0, 0xff, 10}, 312 312 {EM2874_R80_GPIO_P0_CTRL, 0xb0, 0xff, 10}, 313 313 {EM2874_R80_GPIO_P0_CTRL, 0xf0, 0xff, 10}, ··· 318 318 * GPIO_6 - demod reset 319 319 * GPIO_7 - LED 320 320 */ 321 - static struct em28xx_reg_seq pctv_290e[] = { 321 + static const struct em28xx_reg_seq pctv_290e[] = { 322 322 {EM2874_R80_GPIO_P0_CTRL, 0x00, 0xff, 80}, 323 323 {EM2874_R80_GPIO_P0_CTRL, 0x40, 0xff, 80}, /* GPIO_6 = 1 */ 324 324 {EM2874_R80_GPIO_P0_CTRL, 0xc0, 0xff, 80}, /* GPIO_7 = 1 */ ··· 326 326 }; 327 327 328 328 #if 0 329 - static struct em28xx_reg_seq terratec_h5_gpio[] = { 329 + static const struct em28xx_reg_seq terratec_h5_gpio[] = { 330 330 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10}, 331 331 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 100}, 332 332 {EM2874_R80_GPIO_P0_CTRL, 0xf2, 0xff, 50}, ··· 334 334 { -1, -1, -1, -1}, 335 335 }; 336 336 337 - static struct em28xx_reg_seq terratec_h5_digital[] = { 337 + static const struct em28xx_reg_seq terratec_h5_digital[] = { 338 338 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 10}, 339 339 {EM2874_R80_GPIO_P0_CTRL, 0xe6, 0xff, 100}, 340 340 {EM2874_R80_GPIO_P0_CTRL, 0xa6, 0xff, 10}, ··· 352 352 * GPIO_6 - RESET_DEM 353 353 * GPIO_7 - LED (green LED) 354 354 */ 355 - static struct em28xx_reg_seq pctv_460e[] = { 355 + static const struct em28xx_reg_seq pctv_460e[] = { 356 356 {EM2874_R80_GPIO_P0_CTRL, 0x01, 0xff, 50}, 357 357 { 0x0d, 0xff, 0xff, 50}, 358 358 {EM2874_R80_GPIO_P0_CTRL, 0x41, 0xff, 50}, /* GPIO_6=1 */ ··· 361 361 { -1, -1, -1, -1}, 362 362 }; 363 363 364 - static struct em28xx_reg_seq c3tech_digital_duo_digital[] = { 364 + static const struct em28xx_reg_seq c3tech_digital_duo_digital[] = { 365 365 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 10}, 366 366 {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 10}, /* xc5000 reset */ 367 367 {EM2874_R80_GPIO_P0_CTRL, 0xf9, 0xff, 35}, ··· 384 384 * GPIO 6 = #RESET_DEM 385 385 * GPIO 7 = P07_LED (green LED) 386 386 */ 387 - static struct em28xx_reg_seq pctv_461e[] = { 387 + static const struct em28xx_reg_seq pctv_461e[] = { 388 388 {EM2874_R80_GPIO_P0_CTRL, 0x7f, 0xff, 0}, 389 389 {0x0d, 0xff, 0xff, 0}, 390 390 {EM2874_R80_GPIO_P0_CTRL, 0x3f, 0xff, 100}, /* reset demod */ ··· 396 396 }; 397 397 398 398 #if 0 399 - static struct em28xx_reg_seq hauppauge_930c_gpio[] = { 399 + static const struct em28xx_reg_seq hauppauge_930c_gpio[] = { 400 400 {EM2874_R80_GPIO_P0_CTRL, 0x6f, 0xff, 10}, 401 401 {EM2874_R80_GPIO_P0_CTRL, 0x4f, 0xff, 10}, /* xc5000 reset */ 402 402 {EM2874_R80_GPIO_P0_CTRL, 0x6f, 0xff, 10}, ··· 404 404 { -1, -1, -1, -1}, 405 405 }; 406 406 407 - static struct em28xx_reg_seq hauppauge_930c_digital[] = { 407 + static const struct em28xx_reg_seq hauppauge_930c_digital[] = { 408 408 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 10}, 409 409 {EM2874_R80_GPIO_P0_CTRL, 0xe6, 0xff, 100}, 410 410 {EM2874_R80_GPIO_P0_CTRL, 0xa6, 0xff, 10}, ··· 417 417 * GPIO_6 - demod reset, 0=active 418 418 * GPIO_7 - LED, 0=active 419 419 */ 420 - static struct em28xx_reg_seq maxmedia_ub425_tc[] = { 420 + static const struct em28xx_reg_seq maxmedia_ub425_tc[] = { 421 421 {EM2874_R80_GPIO_P0_CTRL, 0x83, 0xff, 100}, 422 422 {EM2874_R80_GPIO_P0_CTRL, 0xc3, 0xff, 100}, /* GPIO_6 = 1 */ 423 423 {EM2874_R80_GPIO_P0_CTRL, 0x43, 0xff, 000}, /* GPIO_7 = 0 */ ··· 430 430 * GPIO_6: demod reset, 0=active 431 431 * GPIO_7: LED, 1=active 432 432 */ 433 - static struct em28xx_reg_seq pctv_510e[] = { 433 + static const struct em28xx_reg_seq pctv_510e[] = { 434 434 {EM2874_R80_GPIO_P0_CTRL, 0x10, 0xff, 100}, 435 435 {EM2874_R80_GPIO_P0_CTRL, 0x14, 0xff, 100}, /* GPIO_2 = 1 */ 436 436 {EM2874_R80_GPIO_P0_CTRL, 0x54, 0xff, 050}, /* GPIO_6 = 1 */ ··· 443 443 * GPIO_6: demod reset, 0=active 444 444 * GPIO_7: LED, 1=active 445 445 */ 446 - static struct em28xx_reg_seq pctv_520e[] = { 446 + static const struct em28xx_reg_seq pctv_520e[] = { 447 447 {EM2874_R80_GPIO_P0_CTRL, 0x10, 0xff, 100}, 448 448 {EM2874_R80_GPIO_P0_CTRL, 0x14, 0xff, 100}, /* GPIO_2 = 1 */ 449 449 {EM2874_R80_GPIO_P0_CTRL, 0x54, 0xff, 050}, /* GPIO_6 = 1 */ ··· 460 460 * reg 0x81/0x85: 461 461 * GPIO_7: snapshot button, 0=pressed, 1=unpressed 462 462 */ 463 - static struct em28xx_reg_seq speedlink_vad_laplace_reg_seq[] = { 463 + static const struct em28xx_reg_seq speedlink_vad_laplace_reg_seq[] = { 464 464 {EM2820_R08_GPIO_CTRL, 0xf7, 0xff, 10}, 465 465 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xb2, 10}, 466 466 { -1, -1, -1, -1}, 467 467 }; 468 468 469 - static struct em28xx_reg_seq pctv_292e[] = { 469 + static const struct em28xx_reg_seq pctv_292e[] = { 470 470 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 0}, 471 471 {0x0d, 0xff, 0xff, 950}, 472 472 {EM2874_R80_GPIO_P0_CTRL, 0xbd, 0xff, 100}, ··· 478 478 {-1, -1, -1, -1}, 479 479 }; 480 480 481 - static struct em28xx_reg_seq terratec_t2_stick_hd[] = { 481 + static const struct em28xx_reg_seq terratec_t2_stick_hd[] = { 482 482 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 0}, 483 483 {0x0d, 0xff, 0xff, 600}, 484 484 {EM2874_R80_GPIO_P0_CTRL, 0xfc, 0xff, 10}, ··· 492 492 {-1, -1, -1, -1}, 493 493 }; 494 494 495 - static struct em28xx_reg_seq plex_px_bcud[] = { 495 + static const struct em28xx_reg_seq plex_px_bcud[] = { 496 496 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 0}, 497 497 {0x0d, 0xff, 0xff, 0}, 498 498 {EM2874_R50_IR_CONFIG, 0x01, 0xff, 0}, ··· 519 519 * GPIO_5: Reset #2, 0=active 520 520 * GPIO_6: Reset #1, 0=active 521 521 */ 522 - static struct em28xx_reg_seq hauppauge_dualhd_dvb[] = { 522 + static const struct em28xx_reg_seq hauppauge_dualhd_dvb[] = { 523 523 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 0}, 524 524 {0x0d, 0xff, 0xff, 200}, 525 525 {0x50, 0x04, 0xff, 300}, ··· 536 536 /* 537 537 * Button definitions 538 538 */ 539 - static struct em28xx_button std_snapshot_button[] = { 539 + static const struct em28xx_button std_snapshot_button[] = { 540 540 { 541 541 .role = EM28XX_BUTTON_SNAPSHOT, 542 542 .reg_r = EM28XX_R0C_USBSUSP, ··· 547 547 {-1, 0, 0, 0, 0}, 548 548 }; 549 549 550 - static struct em28xx_button speedlink_vad_laplace_buttons[] = { 550 + static const struct em28xx_button speedlink_vad_laplace_buttons[] = { 551 551 { 552 552 .role = EM28XX_BUTTON_SNAPSHOT, 553 553 .reg_r = EM2874_R85_GPIO_P1_STATE, ··· 631 631 /* 632 632 * Board definitions 633 633 */ 634 - struct em28xx_board em28xx_boards[] = { 634 + const struct em28xx_board em28xx_boards[] = { 635 635 [EM2750_BOARD_UNKNOWN] = { 636 636 .name = "EM2710/EM2750/EM2751 webcam grabber", 637 637 .xclk = EM28XX_XCLK_FREQUENCY_20MHZ, ··· 2642 2642 /* 2643 2643 * EEPROM hash table for devices with generic USB IDs 2644 2644 */ 2645 - static struct em28xx_hash_table em28xx_eeprom_hash[] = { 2645 + static const struct em28xx_hash_table em28xx_eeprom_hash[] = { 2646 2646 /* P/N: SA 60002070465 Tuner: TVF7533-MF */ 2647 2647 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF}, 2648 2648 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF}, ··· 2655 2655 }; 2656 2656 2657 2657 /* I2C devicelist hash table for devices with generic USB IDs */ 2658 - static struct em28xx_hash_table em28xx_i2c_hash[] = { 2658 + static const struct em28xx_hash_table em28xx_i2c_hash[] = { 2659 2659 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC}, 2660 2660 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC}, 2661 2661 {0x1ba50080, EM2860_BOARD_SAA711X_REFERENCE_DESIGN, TUNER_ABSENT}, ··· 2687 2687 2688 2688 static inline void em28xx_set_xclk_i2c_speed(struct em28xx *dev) 2689 2689 { 2690 - struct em28xx_board *board = &em28xx_boards[dev->model]; 2690 + const struct em28xx_board *board = &em28xx_boards[dev->model]; 2691 2691 u8 xclk = board->xclk, i2c_speed = board->i2c_speed; 2692 2692 2693 2693 /* Those are the default values for the majority of boards
+1 -1
drivers/media/usb/em28xx/em28xx-core.c
··· 712 712 return rc; 713 713 } 714 714 715 - int em28xx_gpio_set(struct em28xx *dev, struct em28xx_reg_seq *gpio) 715 + int em28xx_gpio_set(struct em28xx *dev, const struct em28xx_reg_seq *gpio) 716 716 { 717 717 int rc = 0; 718 718
+4 -2
drivers/media/usb/em28xx/em28xx-input.c
··· 515 515 j = 0; 516 516 while (dev->board.buttons[j].role >= 0 && 517 517 dev->board.buttons[j].role < EM28XX_NUM_BUTTON_ROLES) { 518 - struct em28xx_button *button = &dev->board.buttons[j]; 518 + const struct em28xx_button *button = &dev->board.buttons[j]; 519 + 519 520 /* Check if button uses the current address */ 520 521 if (button->reg_r != dev->button_polling_addresses[i]) { 521 522 j++; ··· 619 618 dev->button_polling_interval = EM28XX_BUTTONS_DEBOUNCED_QUERY_INTERVAL; 620 619 while (dev->board.buttons[i].role >= 0 && 621 620 dev->board.buttons[i].role < EM28XX_NUM_BUTTON_ROLES) { 622 - struct em28xx_button *button = &dev->board.buttons[i]; 621 + const struct em28xx_button *button = &dev->board.buttons[i]; 622 + 623 623 /* Check if polling address is already on the list */ 624 624 addr_new = true; 625 625 for (j = 0; j < dev->num_button_polling_addresses; j++) {
+8 -8
drivers/media/usb/em28xx/em28xx.h
··· 386 386 unsigned int vmux; 387 387 enum em28xx_amux amux; 388 388 enum em28xx_aout aout; 389 - struct em28xx_reg_seq *gpio; 389 + const struct em28xx_reg_seq *gpio; 390 390 }; 391 391 392 392 #define INPUT(nr) (&em28xx_boards[dev->model].input[nr]) ··· 450 450 unsigned int tda9887_conf; 451 451 452 452 /* GPIO sequences */ 453 - struct em28xx_reg_seq *dvb_gpio; 454 - struct em28xx_reg_seq *suspend_gpio; 455 - struct em28xx_reg_seq *tuner_gpio; 456 - struct em28xx_reg_seq *mute_gpio; 453 + const struct em28xx_reg_seq *dvb_gpio; 454 + const struct em28xx_reg_seq *suspend_gpio; 455 + const struct em28xx_reg_seq *tuner_gpio; 456 + const struct em28xx_reg_seq *mute_gpio; 457 457 458 458 unsigned int is_em2800:1; 459 459 unsigned int has_msp34xx:1; ··· 480 480 struct em28xx_led *leds; 481 481 482 482 /* Buttons */ 483 - struct em28xx_button *buttons; 483 + const struct em28xx_button *buttons; 484 484 }; 485 485 486 486 struct em28xx_eeprom { ··· 792 792 void em28xx_uninit_usb_xfer(struct em28xx *dev, enum em28xx_mode mode); 793 793 void em28xx_stop_urbs(struct em28xx *dev); 794 794 int em28xx_set_mode(struct em28xx *dev, enum em28xx_mode set_mode); 795 - int em28xx_gpio_set(struct em28xx *dev, struct em28xx_reg_seq *gpio); 795 + int em28xx_gpio_set(struct em28xx *dev, const struct em28xx_reg_seq *gpio); 796 796 int em28xx_register_extension(struct em28xx_ops *dev); 797 797 void em28xx_unregister_extension(struct em28xx_ops *dev); 798 798 void em28xx_init_extension(struct em28xx *dev); ··· 801 801 int em28xx_resume_extension(struct em28xx *dev); 802 802 803 803 /* Provided by em28xx-cards.c */ 804 - extern struct em28xx_board em28xx_boards[]; 804 + extern const struct em28xx_board em28xx_boards[]; 805 805 extern struct usb_device_id em28xx_id_table[]; 806 806 int em28xx_tuner_callback(void *ptr, int component, int command, int arg); 807 807 void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl);