Commit 39e75cfedf5b40116136894241ca1182089f3637
Committed by
Mauro Carvalho Chehab
1 parent
9695a49839
Exists in
master
and in
4 other branches
V4L/DVB (6575): cx23885/: cleanups
This patch contains the following cleanups: - make the following needlessly global code static: - cx23885-core.c: struct cx23885_sram_channels[] - cx23885-core.c: struct cx23887_sram_channels[] - cx23885-core.c: cx23885_wakeup() - cx23885-core.c: cx23885_sram_channel_setup() - cx23885-core.c: cx23885_sram_channel_dump() - cx23885-core.c: cx23885_risc_disasm() - cx23885-core.c: cx23885_shutdown() - cx23885-core.c: cx23885_reset() - cx23885-core.c: cx23885_dev_unregister() - cx23885-core.c: cx23885_risc_databuffer() - cx23885-core.c: cx23885_risc_stopper() - #if 0 the following unused functions: - cx23885-core.c: cx23885_risc_buffer() - cx23885-core.c: cx23885_cancel_buffers() - remove the following unused EXPORT_SYMBOL's: - cx23885-cards.c: cx23885_boards - cx23885-i2c.c: cx23885_call_i2c_clients Signed-off-by: Adrian Bunk <bunk@kernel.org> Reviewed-by: Steven Toth <stoth@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Showing 4 changed files with 23 additions and 80 deletions Side-by-side Diff
drivers/media/video/cx23885/cx23885-cards.c
drivers/media/video/cx23885/cx23885-core.c
... | ... | @@ -73,7 +73,7 @@ |
73 | 73 | * 0x00010ea0 0x00010xxx Free |
74 | 74 | */ |
75 | 75 | |
76 | -struct sram_channel cx23885_sram_channels[] = { | |
76 | +static struct sram_channel cx23885_sram_channels[] = { | |
77 | 77 | [SRAM_CH01] = { |
78 | 78 | .name = "test ch1", |
79 | 79 | .cmds_start = 0x10000, |
... | ... | @@ -205,7 +205,7 @@ |
205 | 205 | * 0x00010ea0 0x00010xxx Free |
206 | 206 | */ |
207 | 207 | |
208 | -struct sram_channel cx23887_sram_channels[] = { | |
208 | +static struct sram_channel cx23887_sram_channels[] = { | |
209 | 209 | [SRAM_CH01] = { |
210 | 210 | .name = "test ch1", |
211 | 211 | .cmds_start = 0x0, |
... | ... | @@ -356,8 +356,8 @@ |
356 | 356 | return incr[risc >> 28] ? incr[risc >> 28] : 1; |
357 | 357 | } |
358 | 358 | |
359 | -void cx23885_wakeup(struct cx23885_tsport *port, | |
360 | - struct cx23885_dmaqueue *q, u32 count) | |
359 | +static void cx23885_wakeup(struct cx23885_tsport *port, | |
360 | + struct cx23885_dmaqueue *q, u32 count) | |
361 | 361 | { |
362 | 362 | struct cx23885_dev *dev = port->dev; |
363 | 363 | struct cx23885_buffer *buf; |
364 | 364 | |
... | ... | @@ -391,12 +391,10 @@ |
391 | 391 | printk("%s: %d buffers handled (should be 1)\n", |
392 | 392 | __FUNCTION__, bc); |
393 | 393 | } |
394 | -void cx23885_sram_channel_dump(struct cx23885_dev *dev, | |
395 | - struct sram_channel *ch); | |
396 | 394 | |
397 | -int cx23885_sram_channel_setup(struct cx23885_dev *dev, | |
398 | - struct sram_channel *ch, | |
399 | - unsigned int bpl, u32 risc) | |
395 | +static int cx23885_sram_channel_setup(struct cx23885_dev *dev, | |
396 | + struct sram_channel *ch, | |
397 | + unsigned int bpl, u32 risc) | |
400 | 398 | { |
401 | 399 | unsigned int i, lines; |
402 | 400 | u32 cdt; |
... | ... | @@ -467,8 +465,8 @@ |
467 | 465 | return 0; |
468 | 466 | } |
469 | 467 | |
470 | -void cx23885_sram_channel_dump(struct cx23885_dev *dev, | |
471 | - struct sram_channel *ch) | |
468 | +static void cx23885_sram_channel_dump(struct cx23885_dev *dev, | |
469 | + struct sram_channel *ch) | |
472 | 470 | { |
473 | 471 | static char *name[] = { |
474 | 472 | "init risc lo", |
... | ... | @@ -529,8 +527,8 @@ |
529 | 527 | dev->name, cx_read(ch->cnt2_reg)); |
530 | 528 | } |
531 | 529 | |
532 | -void cx23885_risc_disasm(struct cx23885_tsport *port, | |
533 | - struct btcx_riscmem *risc) | |
530 | +static void cx23885_risc_disasm(struct cx23885_tsport *port, | |
531 | + struct btcx_riscmem *risc) | |
534 | 532 | { |
535 | 533 | struct cx23885_dev *dev = port->dev; |
536 | 534 | unsigned int i, j, n; |
... | ... | @@ -548,7 +546,7 @@ |
548 | 546 | } |
549 | 547 | } |
550 | 548 | |
551 | -void cx23885_shutdown(struct cx23885_dev *dev) | |
549 | +static void cx23885_shutdown(struct cx23885_dev *dev) | |
552 | 550 | { |
553 | 551 | /* disable RISC controller */ |
554 | 552 | cx_write(DEV_CNTRL2, 0); |
... | ... | @@ -578,7 +576,7 @@ |
578 | 576 | |
579 | 577 | } |
580 | 578 | |
581 | -void cx23885_reset(struct cx23885_dev *dev) | |
579 | +static void cx23885_reset(struct cx23885_dev *dev) | |
582 | 580 | { |
583 | 581 | dprintk(1, "%s()\n", __FUNCTION__); |
584 | 582 | |
... | ... | @@ -636,8 +634,8 @@ |
636 | 634 | } |
637 | 635 | |
638 | 636 | static void cx23885_timeout(unsigned long data); |
639 | -int cx23885_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc, | |
640 | - u32 reg, u32 mask, u32 value); | |
637 | +static int cx23885_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc, | |
638 | + u32 reg, u32 mask, u32 value); | |
641 | 639 | |
642 | 640 | static int cx23885_init_tsport(struct cx23885_dev *dev, struct cx23885_tsport *port, int portno) |
643 | 641 | { |
... | ... | @@ -837,7 +835,7 @@ |
837 | 835 | return 0; |
838 | 836 | } |
839 | 837 | |
840 | -void cx23885_dev_unregister(struct cx23885_dev *dev) | |
838 | +static void cx23885_dev_unregister(struct cx23885_dev *dev) | |
841 | 839 | { |
842 | 840 | release_mem_region(pci_resource_start(dev->pci,0), |
843 | 841 | pci_resource_len(dev->pci,0)); |
844 | 842 | |
... | ... | @@ -912,49 +910,12 @@ |
912 | 910 | return rp; |
913 | 911 | } |
914 | 912 | |
915 | -int cx23885_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc, | |
916 | - struct scatterlist *sglist, unsigned int top_offset, | |
917 | - unsigned int bottom_offset, unsigned int bpl, | |
918 | - unsigned int padding, unsigned int lines) | |
919 | -{ | |
920 | - u32 instructions, fields; | |
921 | - u32 *rp; | |
922 | - int rc; | |
923 | 913 | |
924 | - fields = 0; | |
925 | - if (UNSET != top_offset) | |
926 | - fields++; | |
927 | - if (UNSET != bottom_offset) | |
928 | - fields++; | |
929 | - | |
930 | - /* estimate risc mem: worst case is one write per page border + | |
931 | - one write per scan line + syncs + jump (all 2 dwords). Padding | |
932 | - can cause next bpl to start close to a page border. First DMA | |
933 | - region may be smaller than PAGE_SIZE */ | |
934 | - /* write and jump need and extra dword */ | |
935 | - instructions = fields * (1 + ((bpl + padding) * lines) / PAGE_SIZE + lines); | |
936 | - instructions += 2; | |
937 | - if ((rc = btcx_riscmem_alloc(pci,risc,instructions*12)) < 0) | |
938 | - return rc; | |
939 | - | |
940 | - /* write risc instructions */ | |
941 | - rp = risc->cpu; | |
942 | - if (UNSET != top_offset) | |
943 | - rp = cx23885_risc_field(rp, sglist, top_offset, 0, | |
944 | - bpl, padding, lines); | |
945 | - if (UNSET != bottom_offset) | |
946 | - rp = cx23885_risc_field(rp, sglist, bottom_offset, 0x200, | |
947 | - bpl, padding, lines); | |
948 | - | |
949 | - /* save pointer to jmp instruction address */ | |
950 | - risc->jmp = rp; | |
951 | - BUG_ON((risc->jmp - risc->cpu + 2) * sizeof (*risc->cpu) > risc->size); | |
952 | - return 0; | |
953 | -} | |
954 | - | |
955 | -int cx23885_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc, | |
956 | - struct scatterlist *sglist, unsigned int bpl, | |
957 | - unsigned int lines) | |
914 | +static int cx23885_risc_databuffer(struct pci_dev *pci, | |
915 | + struct btcx_riscmem *risc, | |
916 | + struct scatterlist *sglist, | |
917 | + unsigned int bpl, | |
918 | + unsigned int lines) | |
958 | 919 | { |
959 | 920 | u32 instructions; |
960 | 921 | u32 *rp; |
... | ... | @@ -981,8 +942,8 @@ |
981 | 942 | return 0; |
982 | 943 | } |
983 | 944 | |
984 | -int cx23885_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc, | |
985 | - u32 reg, u32 mask, u32 value) | |
945 | +static int cx23885_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc, | |
946 | + u32 reg, u32 mask, u32 value) | |
986 | 947 | { |
987 | 948 | u32 *rp; |
988 | 949 | int rc; |
... | ... | @@ -1243,16 +1204,6 @@ |
1243 | 1204 | spin_unlock_irqrestore(&port->slock, flags); |
1244 | 1205 | } |
1245 | 1206 | |
1246 | -void cx23885_cancel_buffers(struct cx23885_tsport *port) | |
1247 | -{ | |
1248 | - struct cx23885_dev *dev = port->dev; | |
1249 | - struct cx23885_dmaqueue *q = &port->mpegq; | |
1250 | - | |
1251 | - dprintk(1, "%s()\n", __FUNCTION__); | |
1252 | - del_timer_sync(&q->timeout); | |
1253 | - cx23885_stop_dma(port); | |
1254 | - do_cancel_buffers(port, "cancel", 0); | |
1255 | -} | |
1256 | 1207 | |
1257 | 1208 | static void cx23885_timeout(unsigned long data) |
1258 | 1209 | { |
drivers/media/video/cx23885/cx23885-i2c.c
drivers/media/video/cx23885/cx23885.h
... | ... | @@ -254,10 +254,6 @@ |
254 | 254 | #define cx_set(reg,bit) cx_andor((reg),(bit),(bit)) |
255 | 255 | #define cx_clear(reg,bit) cx_andor((reg),(bit),0) |
256 | 256 | |
257 | -extern int cx23885_sram_channel_setup(struct cx23885_dev *dev, | |
258 | - struct sram_channel *ch, | |
259 | - unsigned int bpl, u32 risc); | |
260 | - | |
261 | 257 | /* ----------------------------------------------------------- */ |
262 | 258 | /* cx23885-cards.c */ |
263 | 259 |