diff options
author | Adrian Bunk <bunk@stusta.de> | 2006-04-15 05:17:27 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-21 18:04:08 -0400 |
commit | df47e5330b0f5decb0a5736e9a81fff49d46d151 (patch) | |
tree | fcf5fe254235517ecb77fe652f5ed2e04fa02554 | |
parent | 2682d27c5884550857cd96231db5b22b3acced53 (diff) |
[PATCH] USB: sisusbvga: possible cleanups
This patch contains the following possible cleanups:
- make needlessly global functions static
- function and struct declarations belong into header files
- make SiS_VCLKData const
- #if 0 the following unused global functions:
- sisusb.c: sisusb_writew()
- sisusb.c: sisusb_readw()
- sisusb_init.c: SiSUSB_GetModeID()
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/misc/sisusbvga/sisusb.c | 50 | ||||
-rw-r--r-- | drivers/usb/misc/sisusbvga/sisusb_con.c | 24 | ||||
-rw-r--r-- | drivers/usb/misc/sisusbvga/sisusb_init.c | 4 | ||||
-rw-r--r-- | drivers/usb/misc/sisusbvga/sisusb_init.h | 20 | ||||
-rw-r--r-- | drivers/usb/misc/sisusbvga/sisusb_struct.h | 2 |
5 files changed, 28 insertions, 72 deletions
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 19aedbc85ea4..738bd7c7451f 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c | |||
@@ -53,6 +53,7 @@ | |||
53 | #include <linux/vmalloc.h> | 53 | #include <linux/vmalloc.h> |
54 | 54 | ||
55 | #include "sisusb.h" | 55 | #include "sisusb.h" |
56 | #include "sisusb_init.h" | ||
56 | 57 | ||
57 | #ifdef INCL_SISUSB_CON | 58 | #ifdef INCL_SISUSB_CON |
58 | #include <linux/font.h> | 59 | #include <linux/font.h> |
@@ -63,36 +64,6 @@ | |||
63 | /* Forward declarations / clean-up routines */ | 64 | /* Forward declarations / clean-up routines */ |
64 | 65 | ||
65 | #ifdef INCL_SISUSB_CON | 66 | #ifdef INCL_SISUSB_CON |
66 | int sisusb_setreg(struct sisusb_usb_data *sisusb, int port, u8 data); | ||
67 | int sisusb_getreg(struct sisusb_usb_data *sisusb, int port, u8 *data); | ||
68 | int sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 data); | ||
69 | int sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 *data); | ||
70 | int sisusb_setidxregandor(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand, u8 myor); | ||
71 | int sisusb_setidxregor(struct sisusb_usb_data *sisusb, int port, u8 index, u8 myor); | ||
72 | int sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand); | ||
73 | |||
74 | int sisusb_writeb(struct sisusb_usb_data *sisusb, u32 adr, u8 data); | ||
75 | int sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 *data); | ||
76 | int sisusb_writew(struct sisusb_usb_data *sisusb, u32 adr, u16 data); | ||
77 | int sisusb_readw(struct sisusb_usb_data *sisusb, u32 adr, u16 *data); | ||
78 | int sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, | ||
79 | u32 dest, int length, size_t *bytes_written); | ||
80 | |||
81 | int sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init); | ||
82 | |||
83 | extern int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); | ||
84 | extern int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo); | ||
85 | |||
86 | extern void sisusb_init_concode(void); | ||
87 | extern int sisusb_console_init(struct sisusb_usb_data *sisusb, int first, int last); | ||
88 | extern void sisusb_console_exit(struct sisusb_usb_data *sisusb); | ||
89 | |||
90 | extern void sisusb_set_cursor(struct sisusb_usb_data *sisusb, unsigned int location); | ||
91 | |||
92 | extern int sisusbcon_do_font_op(struct sisusb_usb_data *sisusb, int set, int slot, | ||
93 | u8 *arg, int cmapsz, int ch512, int dorecalc, | ||
94 | struct vc_data *c, int fh, int uplock); | ||
95 | |||
96 | static int sisusb_first_vc = 0; | 67 | static int sisusb_first_vc = 0; |
97 | static int sisusb_last_vc = 0; | 68 | static int sisusb_last_vc = 0; |
98 | module_param_named(first, sisusb_first_vc, int, 0); | 69 | module_param_named(first, sisusb_first_vc, int, 0); |
@@ -1360,9 +1331,6 @@ sisusb_getreg(struct sisusb_usb_data *sisusb, int port, u8 *data) | |||
1360 | } | 1331 | } |
1361 | #endif | 1332 | #endif |
1362 | 1333 | ||
1363 | #ifndef INCL_SISUSB_CON | ||
1364 | static | ||
1365 | #endif | ||
1366 | int | 1334 | int |
1367 | sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 data) | 1335 | sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 data) |
1368 | { | 1336 | { |
@@ -1372,9 +1340,6 @@ sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 data) | |||
1372 | return ret; | 1340 | return ret; |
1373 | } | 1341 | } |
1374 | 1342 | ||
1375 | #ifndef INCL_SISUSB_CON | ||
1376 | static | ||
1377 | #endif | ||
1378 | int | 1343 | int |
1379 | sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 *data) | 1344 | sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 *data) |
1380 | { | 1345 | { |
@@ -1384,9 +1349,6 @@ sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 *data) | |||
1384 | return ret; | 1349 | return ret; |
1385 | } | 1350 | } |
1386 | 1351 | ||
1387 | #ifndef INCL_SISUSB_CON | ||
1388 | static | ||
1389 | #endif | ||
1390 | int | 1352 | int |
1391 | sisusb_setidxregandor(struct sisusb_usb_data *sisusb, int port, u8 idx, | 1353 | sisusb_setidxregandor(struct sisusb_usb_data *sisusb, int port, u8 idx, |
1392 | u8 myand, u8 myor) | 1354 | u8 myand, u8 myor) |
@@ -1416,18 +1378,12 @@ sisusb_setidxregmask(struct sisusb_usb_data *sisusb, int port, u8 idx, | |||
1416 | return ret; | 1378 | return ret; |
1417 | } | 1379 | } |
1418 | 1380 | ||
1419 | #ifndef INCL_SISUSB_CON | ||
1420 | static | ||
1421 | #endif | ||
1422 | int | 1381 | int |
1423 | sisusb_setidxregor(struct sisusb_usb_data *sisusb, int port, u8 index, u8 myor) | 1382 | sisusb_setidxregor(struct sisusb_usb_data *sisusb, int port, u8 index, u8 myor) |
1424 | { | 1383 | { |
1425 | return(sisusb_setidxregandor(sisusb, port, index, 0xff, myor)); | 1384 | return(sisusb_setidxregandor(sisusb, port, index, 0xff, myor)); |
1426 | } | 1385 | } |
1427 | 1386 | ||
1428 | #ifndef INCL_SISUSB_CON | ||
1429 | static | ||
1430 | #endif | ||
1431 | int | 1387 | int |
1432 | sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand) | 1388 | sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand) |
1433 | { | 1389 | { |
@@ -1449,6 +1405,8 @@ sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 *data) | |||
1449 | return(sisusb_read_memio_byte(sisusb, SISUSB_TYPE_MEM, adr, data)); | 1405 | return(sisusb_read_memio_byte(sisusb, SISUSB_TYPE_MEM, adr, data)); |
1450 | } | 1406 | } |
1451 | 1407 | ||
1408 | #if 0 | ||
1409 | |||
1452 | int | 1410 | int |
1453 | sisusb_writew(struct sisusb_usb_data *sisusb, u32 adr, u16 data) | 1411 | sisusb_writew(struct sisusb_usb_data *sisusb, u32 adr, u16 data) |
1454 | { | 1412 | { |
@@ -1461,6 +1419,8 @@ sisusb_readw(struct sisusb_usb_data *sisusb, u32 adr, u16 *data) | |||
1461 | return(sisusb_read_memio_word(sisusb, SISUSB_TYPE_MEM, adr, data)); | 1419 | return(sisusb_read_memio_word(sisusb, SISUSB_TYPE_MEM, adr, data)); |
1462 | } | 1420 | } |
1463 | 1421 | ||
1422 | #endif /* 0 */ | ||
1423 | |||
1464 | int | 1424 | int |
1465 | sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, | 1425 | sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, |
1466 | u32 dest, int length, size_t *bytes_written) | 1426 | u32 dest, int length, size_t *bytes_written) |
diff --git a/drivers/usb/misc/sisusbvga/sisusb_con.c b/drivers/usb/misc/sisusbvga/sisusb_con.c index 092281c172a1..fb48feca8353 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_con.c +++ b/drivers/usb/misc/sisusbvga/sisusb_con.c | |||
@@ -70,27 +70,9 @@ | |||
70 | #include <linux/vmalloc.h> | 70 | #include <linux/vmalloc.h> |
71 | 71 | ||
72 | #include "sisusb.h" | 72 | #include "sisusb.h" |
73 | #include "sisusb_init.h" | ||
73 | 74 | ||
74 | #ifdef INCL_SISUSB_CON | 75 | #ifdef INCL_SISUSB_CON |
75 | extern int sisusb_setreg(struct sisusb_usb_data *, int, u8); | ||
76 | extern int sisusb_getreg(struct sisusb_usb_data *, int, u8 *); | ||
77 | extern int sisusb_setidxreg(struct sisusb_usb_data *, int, u8, u8); | ||
78 | extern int sisusb_getidxreg(struct sisusb_usb_data *, int, u8, u8 *); | ||
79 | extern int sisusb_setidxregor(struct sisusb_usb_data *, int, u8, u8); | ||
80 | extern int sisusb_setidxregand(struct sisusb_usb_data *, int, u8, u8); | ||
81 | extern int sisusb_setidxregandor(struct sisusb_usb_data *, int, u8, u8, u8); | ||
82 | |||
83 | extern int sisusb_writeb(struct sisusb_usb_data *sisusb, u32 adr, u8 data); | ||
84 | extern int sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 *data); | ||
85 | extern int sisusb_writew(struct sisusb_usb_data *sisusb, u32 adr, u16 data); | ||
86 | extern int sisusb_readw(struct sisusb_usb_data *sisusb, u32 adr, u16 *data); | ||
87 | extern int sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, | ||
88 | u32 dest, int length, size_t *bytes_written); | ||
89 | |||
90 | extern void sisusb_delete(struct kref *kref); | ||
91 | extern int sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init); | ||
92 | |||
93 | extern int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); | ||
94 | 76 | ||
95 | #define sisusbcon_writew(val, addr) (*(addr) = (val)) | 77 | #define sisusbcon_writew(val, addr) (*(addr) = (val)) |
96 | #define sisusbcon_readw(addr) (*(addr)) | 78 | #define sisusbcon_readw(addr) (*(addr)) |
@@ -103,8 +85,6 @@ static struct sisusb_usb_data *mysisusbs[MAX_NR_CONSOLES]; | |||
103 | /* Forward declaration */ | 85 | /* Forward declaration */ |
104 | static const struct consw sisusb_con; | 86 | static const struct consw sisusb_con; |
105 | 87 | ||
106 | extern struct mutex disconnect_mutex; | ||
107 | |||
108 | static inline void | 88 | static inline void |
109 | sisusbcon_memsetw(u16 *s, u16 c, unsigned int count) | 89 | sisusbcon_memsetw(u16 *s, u16 c, unsigned int count) |
110 | { | 90 | { |
@@ -1487,7 +1467,7 @@ static int sisusbdummycon_dummy(void) | |||
1487 | 1467 | ||
1488 | #define SISUSBCONDUMMY (void *)sisusbdummycon_dummy | 1468 | #define SISUSBCONDUMMY (void *)sisusbdummycon_dummy |
1489 | 1469 | ||
1490 | const struct consw sisusb_dummy_con = { | 1470 | static const struct consw sisusb_dummy_con = { |
1491 | .owner = THIS_MODULE, | 1471 | .owner = THIS_MODULE, |
1492 | .con_startup = sisusbdummycon_startup, | 1472 | .con_startup = sisusbdummycon_startup, |
1493 | .con_init = sisusbdummycon_init, | 1473 | .con_init = sisusbdummycon_init, |
diff --git a/drivers/usb/misc/sisusbvga/sisusb_init.c b/drivers/usb/misc/sisusbvga/sisusb_init.c index 044fa4482f9f..968f0d38cff7 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_init.c +++ b/drivers/usb/misc/sisusbvga/sisusb_init.c | |||
@@ -74,6 +74,7 @@ SiSUSB_InitPtr(struct SiS_Private *SiS_Pr) | |||
74 | /* HELPER: Get ModeID */ | 74 | /* HELPER: Get ModeID */ |
75 | /*********************************************/ | 75 | /*********************************************/ |
76 | 76 | ||
77 | #if 0 | ||
77 | unsigned short | 78 | unsigned short |
78 | SiSUSB_GetModeID(int HDisplay, int VDisplay, int Depth) | 79 | SiSUSB_GetModeID(int HDisplay, int VDisplay, int Depth) |
79 | { | 80 | { |
@@ -157,6 +158,7 @@ SiSUSB_GetModeID(int HDisplay, int VDisplay, int Depth) | |||
157 | 158 | ||
158 | return ModeIndex; | 159 | return ModeIndex; |
159 | } | 160 | } |
161 | #endif /* 0 */ | ||
160 | 162 | ||
161 | /*********************************************/ | 163 | /*********************************************/ |
162 | /* HELPER: SetReg, GetReg */ | 164 | /* HELPER: SetReg, GetReg */ |
@@ -233,7 +235,7 @@ SiS_DisplayOn(struct SiS_Private *SiS_Pr) | |||
233 | /* HELPER: Init Port Addresses */ | 235 | /* HELPER: Init Port Addresses */ |
234 | /*********************************************/ | 236 | /*********************************************/ |
235 | 237 | ||
236 | void | 238 | static void |
237 | SiSUSBRegInit(struct SiS_Private *SiS_Pr, unsigned long BaseAddr) | 239 | SiSUSBRegInit(struct SiS_Private *SiS_Pr, unsigned long BaseAddr) |
238 | { | 240 | { |
239 | SiS_Pr->SiS_P3c4 = BaseAddr + 0x14; | 241 | SiS_Pr->SiS_P3c4 = BaseAddr + 0x14; |
diff --git a/drivers/usb/misc/sisusbvga/sisusb_init.h b/drivers/usb/misc/sisusbvga/sisusb_init.h index 5b11577835c8..f05f83268af4 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_init.h +++ b/drivers/usb/misc/sisusbvga/sisusb_init.h | |||
@@ -690,7 +690,7 @@ static const struct SiS_CRT1Table SiSUSB_CRT1Table[] = | |||
690 | 0x41}} /* 0x54 */ | 690 | 0x41}} /* 0x54 */ |
691 | }; | 691 | }; |
692 | 692 | ||
693 | static struct SiS_VCLKData SiSUSB_VCLKData[] = | 693 | static const struct SiS_VCLKData SiSUSB_VCLKData[] = |
694 | { | 694 | { |
695 | { 0x1b,0xe1, 25}, /* 0x00 */ | 695 | { 0x1b,0xe1, 25}, /* 0x00 */ |
696 | { 0x4e,0xe4, 28}, /* 0x01 */ | 696 | { 0x4e,0xe4, 28}, /* 0x01 */ |
@@ -808,8 +808,8 @@ static struct SiS_VCLKData SiSUSB_VCLKData[] = | |||
808 | { 0x2b,0xc2, 35} /* 0x71 768@576@60 */ | 808 | { 0x2b,0xc2, 35} /* 0x71 768@576@60 */ |
809 | }; | 809 | }; |
810 | 810 | ||
811 | void SiSUSBRegInit(struct SiS_Private *SiS_Pr, unsigned long BaseAddr); | 811 | extern struct mutex disconnect_mutex; |
812 | unsigned short SiSUSB_GetModeID(int HDisplay, int VDisplay, int Depth); | 812 | |
813 | int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); | 813 | int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); |
814 | int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo); | 814 | int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo); |
815 | 815 | ||
@@ -826,5 +826,19 @@ extern int sisusb_setidxregor(struct sisusb_usb_data *sisusb, int port, | |||
826 | extern int sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port, | 826 | extern int sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port, |
827 | u8 idx, u8 myand); | 827 | u8 idx, u8 myand); |
828 | 828 | ||
829 | void sisusb_delete(struct kref *kref); | ||
830 | int sisusb_writeb(struct sisusb_usb_data *sisusb, u32 adr, u8 data); | ||
831 | int sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 *data); | ||
832 | int sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, | ||
833 | u32 dest, int length, size_t *bytes_written); | ||
834 | int sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init); | ||
835 | int sisusbcon_do_font_op(struct sisusb_usb_data *sisusb, int set, int slot, | ||
836 | u8 *arg, int cmapsz, int ch512, int dorecalc, | ||
837 | struct vc_data *c, int fh, int uplock); | ||
838 | void sisusb_set_cursor(struct sisusb_usb_data *sisusb, unsigned int location); | ||
839 | int sisusb_console_init(struct sisusb_usb_data *sisusb, int first, int last); | ||
840 | void sisusb_console_exit(struct sisusb_usb_data *sisusb); | ||
841 | void sisusb_init_concode(void); | ||
842 | |||
829 | #endif | 843 | #endif |
830 | 844 | ||
diff --git a/drivers/usb/misc/sisusbvga/sisusb_struct.h b/drivers/usb/misc/sisusbvga/sisusb_struct.h index 94edd4726c42..f325ecb29a61 100644 --- a/drivers/usb/misc/sisusbvga/sisusb_struct.h +++ b/drivers/usb/misc/sisusbvga/sisusb_struct.h | |||
@@ -161,7 +161,7 @@ struct SiS_Private | |||
161 | const struct SiS_Ext *SiS_EModeIDTable; | 161 | const struct SiS_Ext *SiS_EModeIDTable; |
162 | const struct SiS_Ext2 *SiS_RefIndex; | 162 | const struct SiS_Ext2 *SiS_RefIndex; |
163 | const struct SiS_CRT1Table *SiS_CRT1Table; | 163 | const struct SiS_CRT1Table *SiS_CRT1Table; |
164 | struct SiS_VCLKData *SiS_VCLKData; | 164 | const struct SiS_VCLKData *SiS_VCLKData; |
165 | const struct SiS_ModeResInfo *SiS_ModeResInfo; | 165 | const struct SiS_ModeResInfo *SiS_ModeResInfo; |
166 | }; | 166 | }; |
167 | 167 | ||