staging: xgifb: eliminate pVBInfo->VCLKData/VBVCLKData
authorAaro Koskinen <aaro.koskinen@iki.fi>
Sun, 4 Nov 2012 19:14:58 +0000 (21:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2012 20:54:20 +0000 (12:54 -0800)
Access XGI_VCLKData and XGI_VBVCLKData directly and make them const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/xgifb/XGI_main_26.c
drivers/staging/xgifb/vb_def.h
drivers/staging/xgifb/vb_setmode.c
drivers/staging/xgifb/vb_struct.h
drivers/staging/xgifb/vb_table.h

index 725fba153475976b0287fd9e0b279c22ee30b34a..4b213a318f34cc825c581850f8eaded55803ebcb 100644 (file)
@@ -75,7 +75,7 @@ static int XGIfb_mode_rate_to_dclock(struct vb_device_info *XGI_Pr,
 
        ClockIndex = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
 
-       Clock = XGI_Pr->VCLKData[ClockIndex].CLOCK * 1000;
+       Clock = XGI_VCLKData[ClockIndex].CLOCK * 1000;
 
        return Clock;
 }
index 274f8cc68a0dbb28362f99438a8874357d0f57d5..46f9aa58bbaf580a57038ba434081c1d99e88efd 100644 (file)
@@ -263,5 +263,6 @@ extern const struct XGI_ExtStruct XGI330_EModeIDTable[];
 extern const struct XGI_Ext2Struct XGI330_RefIndex[];
 extern const struct XGI_CRT1TableStruct XGI_CRT1Table[];
 extern const struct XGI_ECLKDataStruct XGI340_ECLKData[];
+extern const struct SiS_VCLKData XGI_VCLKData[];
 
 #endif
index 832b254281ab7505d7cdbc163d779ecd9d7e48d1..137725cbfd220313c8a6a8a18d2ed21d469d54ed 100644 (file)
@@ -24,8 +24,6 @@ static const unsigned short XGINew_VGA_DAC[] = {
 void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo)
 {
        pVBInfo->MCLKData = XGI340New_MCLKData;
-       pVBInfo->VCLKData = XGI_VCLKData;
-       pVBInfo->VBVCLKData = XGI_VBVCLKData;
        pVBInfo->ScreenOffset = XGI330_ScreenOffset;
        pVBInfo->StResInfo = XGI330_StResInfo;
        pVBInfo->ModeResInfo = XGI330_ModeResInfo;
@@ -181,12 +179,12 @@ static unsigned char XGI_SetDefaultVCLK(struct vb_device_info *pVBInfo)
 {
 
        xgifb_reg_and_or(pVBInfo->P3c4, 0x31, ~0x30, 0x20);
-       xgifb_reg_set(pVBInfo->P3c4, 0x2B, pVBInfo->VCLKData[0].SR2B);
-       xgifb_reg_set(pVBInfo->P3c4, 0x2C, pVBInfo->VCLKData[0].SR2C);
+       xgifb_reg_set(pVBInfo->P3c4, 0x2B, XGI_VCLKData[0].SR2B);
+       xgifb_reg_set(pVBInfo->P3c4, 0x2C, XGI_VCLKData[0].SR2C);
 
        xgifb_reg_and_or(pVBInfo->P3c4, 0x31, ~0x30, 0x10);
-       xgifb_reg_set(pVBInfo->P3c4, 0x2B, pVBInfo->VCLKData[1].SR2B);
-       xgifb_reg_set(pVBInfo->P3c4, 0x2C, pVBInfo->VCLKData[1].SR2C);
+       xgifb_reg_set(pVBInfo->P3c4, 0x2B, XGI_VCLKData[1].SR2B);
+       xgifb_reg_set(pVBInfo->P3c4, 0x2C, XGI_VCLKData[1].SR2C);
 
        xgifb_reg_and(pVBInfo->P3c4, 0x31, ~0x30);
        return 0;
@@ -961,10 +959,8 @@ static void XGI_SetCRT1VCLK(unsigned short ModeNo,
                index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
                data = xgifb_reg_get(pVBInfo->P3c4, 0x31) & 0xCF;
                xgifb_reg_set(pVBInfo->P3c4, 0x31, data);
-               xgifb_reg_set(pVBInfo->P3c4, 0x2B,
-                               pVBInfo->VCLKData[index].SR2B);
-               xgifb_reg_set(pVBInfo->P3c4, 0x2C,
-                               pVBInfo->VCLKData[index].SR2C);
+               xgifb_reg_set(pVBInfo->P3c4, 0x2B, XGI_VCLKData[index].SR2B);
+               xgifb_reg_set(pVBInfo->P3c4, 0x2C, XGI_VCLKData[index].SR2C);
                xgifb_reg_set(pVBInfo->P3c4, 0x2D, 0x01);
        } else if ((pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV
                        | VB_SIS302LV | VB_XGI301C)) && (pVBInfo->VBInfo
@@ -974,19 +970,17 @@ static void XGI_SetCRT1VCLK(unsigned short ModeNo,
                                pVBInfo);
                data = xgifb_reg_get(pVBInfo->P3c4, 0x31) & 0xCF;
                xgifb_reg_set(pVBInfo->P3c4, 0x31, data);
-               data = pVBInfo->VBVCLKData[vclkindex].Part4_A;
+               data = XGI_VBVCLKData[vclkindex].Part4_A;
                xgifb_reg_set(pVBInfo->P3c4, 0x2B, data);
-               data = pVBInfo->VBVCLKData[vclkindex].Part4_B;
+               data = XGI_VBVCLKData[vclkindex].Part4_B;
                xgifb_reg_set(pVBInfo->P3c4, 0x2C, data);
                xgifb_reg_set(pVBInfo->P3c4, 0x2D, 0x01);
        } else {
                index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
                data = xgifb_reg_get(pVBInfo->P3c4, 0x31) & 0xCF;
                xgifb_reg_set(pVBInfo->P3c4, 0x31, data);
-               xgifb_reg_set(pVBInfo->P3c4, 0x2B,
-                               pVBInfo->VCLKData[index].SR2B);
-               xgifb_reg_set(pVBInfo->P3c4, 0x2C,
-                               pVBInfo->VCLKData[index].SR2C);
+               xgifb_reg_set(pVBInfo->P3c4, 0x2B, XGI_VCLKData[index].SR2B);
+               xgifb_reg_set(pVBInfo->P3c4, 0x2C, XGI_VCLKData[index].SR2C);
                xgifb_reg_set(pVBInfo->P3c4, 0x2D, 0x01);
        }
 
@@ -1053,7 +1047,7 @@ static void XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension,
 
        index = XGI330_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
        index &= IndexMask;
-       VCLK = pVBInfo->VCLKData[index].CLOCK;
+       VCLK = XGI_VCLKData[index].CLOCK;
 
        data = xgifb_reg_get(pVBInfo->P3c4, 0x32);
        data &= 0xf3;
index f7c5ec150da1d12d8b35fb071cc1f605b5158602..9d1a0c724ce300e82992a86b48f16f98de3fbb7d 100644 (file)
@@ -179,8 +179,6 @@ struct vb_device_info {
        struct XGI_TimingHStruct TimingH;
        struct XGI_TimingVStruct TimingV;
 
-       struct SiS_VCLKData    *VCLKData;
-       struct SiS_VBVCLKData  *VBVCLKData;
        struct SiS_StResInfo_S   *StResInfo;
        struct SiS_ModeResInfo_S *ModeResInfo;
 
index d295eea63a54648073be55a8a6d3402604643ab0..ea133adb0ebf3acbce498ee81b2e545774a5ef64 100644 (file)
@@ -2157,7 +2157,7 @@ static struct SiS_ModeResInfo_S XGI330_ModeResInfo[] = {
        {1152,  864, 8, 16}
 };
 
-static struct SiS_VCLKData XGI_VCLKData[] = {
+const struct SiS_VCLKData XGI_VCLKData[] = {
        /* SR2B,SR2C,SR2D */
        {0x1B, 0xE1,  25}, /* 00 (25.175MHz) */
        {0x4E, 0xE4,  28}, /* 01 (28.322MHz) */
@@ -2250,7 +2250,7 @@ static struct SiS_VCLKData XGI_VCLKData[] = {
        {0xFF, 0x00,   0}  /* End mark */
 };
 
-static struct SiS_VBVCLKData XGI_VBVCLKData[] = {
+static const struct SiS_VBVCLKData XGI_VBVCLKData[] = {
        {0x1B, 0xE1,  25}, /* 00 (25.175MHz) */
        {0x4E, 0xE4,  28}, /* 01 (28.322MHz) */
        {0x57, 0xE4,  31}, /* 02 (31.500MHz) */