aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2006-04-15 05:17:27 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-06-21 18:04:08 -0400
commitdf47e5330b0f5decb0a5736e9a81fff49d46d151 (patch)
treefcf5fe254235517ecb77fe652f5ed2e04fa02554
parent2682d27c5884550857cd96231db5b22b3acced53 (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.c50
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb_con.c24
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb_init.c4
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb_init.h20
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb_struct.h2
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
66int sisusb_setreg(struct sisusb_usb_data *sisusb, int port, u8 data);
67int sisusb_getreg(struct sisusb_usb_data *sisusb, int port, u8 *data);
68int sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 data);
69int sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 *data);
70int sisusb_setidxregandor(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand, u8 myor);
71int sisusb_setidxregor(struct sisusb_usb_data *sisusb, int port, u8 index, u8 myor);
72int sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand);
73
74int sisusb_writeb(struct sisusb_usb_data *sisusb, u32 adr, u8 data);
75int sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 *data);
76int sisusb_writew(struct sisusb_usb_data *sisusb, u32 adr, u16 data);
77int sisusb_readw(struct sisusb_usb_data *sisusb, u32 adr, u16 *data);
78int sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src,
79 u32 dest, int length, size_t *bytes_written);
80
81int sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init);
82
83extern int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo);
84extern int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo);
85
86extern void sisusb_init_concode(void);
87extern int sisusb_console_init(struct sisusb_usb_data *sisusb, int first, int last);
88extern void sisusb_console_exit(struct sisusb_usb_data *sisusb);
89
90extern void sisusb_set_cursor(struct sisusb_usb_data *sisusb, unsigned int location);
91
92extern 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
96static int sisusb_first_vc = 0; 67static int sisusb_first_vc = 0;
97static int sisusb_last_vc = 0; 68static int sisusb_last_vc = 0;
98module_param_named(first, sisusb_first_vc, int, 0); 69module_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
1364static
1365#endif
1366int 1334int
1367sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 data) 1335sisusb_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
1376static
1377#endif
1378int 1343int
1379sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 *data) 1344sisusb_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
1388static
1389#endif
1390int 1352int
1391sisusb_setidxregandor(struct sisusb_usb_data *sisusb, int port, u8 idx, 1353sisusb_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
1420static
1421#endif
1422int 1381int
1423sisusb_setidxregor(struct sisusb_usb_data *sisusb, int port, u8 index, u8 myor) 1382sisusb_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
1429static
1430#endif
1431int 1387int
1432sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand) 1388sisusb_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
1452int 1410int
1453sisusb_writew(struct sisusb_usb_data *sisusb, u32 adr, u16 data) 1411sisusb_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
1464int 1424int
1465sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, 1425sisusb_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
75extern int sisusb_setreg(struct sisusb_usb_data *, int, u8);
76extern int sisusb_getreg(struct sisusb_usb_data *, int, u8 *);
77extern int sisusb_setidxreg(struct sisusb_usb_data *, int, u8, u8);
78extern int sisusb_getidxreg(struct sisusb_usb_data *, int, u8, u8 *);
79extern int sisusb_setidxregor(struct sisusb_usb_data *, int, u8, u8);
80extern int sisusb_setidxregand(struct sisusb_usb_data *, int, u8, u8);
81extern int sisusb_setidxregandor(struct sisusb_usb_data *, int, u8, u8, u8);
82
83extern int sisusb_writeb(struct sisusb_usb_data *sisusb, u32 adr, u8 data);
84extern int sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 *data);
85extern int sisusb_writew(struct sisusb_usb_data *sisusb, u32 adr, u16 data);
86extern int sisusb_readw(struct sisusb_usb_data *sisusb, u32 adr, u16 *data);
87extern int sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src,
88 u32 dest, int length, size_t *bytes_written);
89
90extern void sisusb_delete(struct kref *kref);
91extern int sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init);
92
93extern 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 */
104static const struct consw sisusb_con; 86static const struct consw sisusb_con;
105 87
106extern struct mutex disconnect_mutex;
107
108static inline void 88static inline void
109sisusbcon_memsetw(u16 *s, u16 c, unsigned int count) 89sisusbcon_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
1490const struct consw sisusb_dummy_con = { 1470static 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
77unsigned short 78unsigned short
78SiSUSB_GetModeID(int HDisplay, int VDisplay, int Depth) 79SiSUSB_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
236void 238static void
237SiSUSBRegInit(struct SiS_Private *SiS_Pr, unsigned long BaseAddr) 239SiSUSBRegInit(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
693static struct SiS_VCLKData SiSUSB_VCLKData[] = 693static 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
811void SiSUSBRegInit(struct SiS_Private *SiS_Pr, unsigned long BaseAddr); 811extern struct mutex disconnect_mutex;
812unsigned short SiSUSB_GetModeID(int HDisplay, int VDisplay, int Depth); 812
813int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 813int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo);
814int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo); 814int 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,
826extern int sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port, 826extern int sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port,
827 u8 idx, u8 myand); 827 u8 idx, u8 myand);
828 828
829void sisusb_delete(struct kref *kref);
830int sisusb_writeb(struct sisusb_usb_data *sisusb, u32 adr, u8 data);
831int sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 *data);
832int sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src,
833 u32 dest, int length, size_t *bytes_written);
834int sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init);
835int 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);
838void sisusb_set_cursor(struct sisusb_usb_data *sisusb, unsigned int location);
839int sisusb_console_init(struct sisusb_usb_data *sisusb, int first, int last);
840void sisusb_console_exit(struct sisusb_usb_data *sisusb);
841void 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