staging: xgifb: call XGI_GetVBType from InitTo330Pointer
authorAaro Koskinen <aaro.koskinen@iki.fi>
Wed, 29 May 2013 20:59:02 +0000 (23:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2013 11:55:47 +0000 (20:55 +0900)
Move XGI_GetVBType call inside InitTo330Pointer to avoid code duplication.

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

index 9e8148f12dd24a485da1341988e1cd499730fbe6..5f1c41ed778b54f2f00c2e968809c645c2d0d8aa 100644 (file)
@@ -1212,10 +1212,6 @@ unsigned char XGIInitNew(struct pci_dev *pdev)
 
        outb(0x67, pVBInfo->P3c2);
 
-       if (HwDeviceExtension->jChipType < XG20)
-               /* Run XGI_GetVBType before InitTo330Pointer */
-               XGI_GetVBType(pVBInfo);
-
        InitTo330Pointer(HwDeviceExtension->jChipType, pVBInfo);
 
        /* Openkey */
index d46e021e7f2673abae4d52c73415ed38fb9bdb0c..5cf0bd65f85a2e66e8fcac96f72d545f06b7106c 100644 (file)
@@ -35,6 +35,9 @@ void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo)
        pVBInfo->SR18 = XGI340_SR18;
        pVBInfo->CR40 = XGI340_cr41;
 
+       if (ChipType < XG20)
+               XGI_GetVBType(pVBInfo);
+
        /* 310 customization related */
        if ((pVBInfo->VBType & VB_SIS301LV) || (pVBInfo->VBType & VB_SIS302LV))
                pVBInfo->LCDCapList = XGI_LCDDLCapList;
@@ -5734,9 +5737,6 @@ unsigned char XGISetModeNew(struct xgifb_video_info *xgifb_info,
                }
        }
 
-       if (HwDeviceExtension->jChipType < XG20)
-               XGI_GetVBType(pVBInfo);
-
        InitTo330Pointer(HwDeviceExtension->jChipType, pVBInfo);
        if (ModeNo & 0x80)
                ModeNo = ModeNo & 0x7F;