Commit 7eec23a7 authored by Miguel Gómez's avatar Miguel Gómez Committed by Greg Kroah-Hartman

Staging: xgifb: Refactor XGI_GetVBType().

Refactor XGI_GetVBType() to reduce indentation and fix style warnings.
Signed-off-by: default avatarMiguel Gómez <magomez@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3b175621
...@@ -2559,42 +2559,45 @@ void XGI_GetVBType(struct vb_device_info *pVBInfo) ...@@ -2559,42 +2559,45 @@ void XGI_GetVBType(struct vb_device_info *pVBInfo)
{ {
unsigned short flag, tempbx, tempah; unsigned short flag, tempbx, tempah;
if (pVBInfo->IF_DEF_LVDS == 0) { if (pVBInfo->IF_DEF_LVDS != 0)
return;
tempbx = VB_SIS302B; tempbx = VB_SIS302B;
flag = xgifb_reg_get(pVBInfo->Part4Port, 0x00); flag = xgifb_reg_get(pVBInfo->Part4Port, 0x00);
if (flag != 0x02) { if (flag == 0x02)
goto finish;
tempbx = VB_SIS301; tempbx = VB_SIS301;
flag = xgifb_reg_get(pVBInfo->Part4Port, 0x01); flag = xgifb_reg_get(pVBInfo->Part4Port, 0x01);
if (flag >= 0xB0) { if (flag < 0xB0)
goto finish;
tempbx = VB_SIS301B; tempbx = VB_SIS301B;
if (flag >= 0xC0) { if (flag < 0xC0)
goto bigger_than_0xB0;
tempbx = VB_XGI301C; tempbx = VB_XGI301C;
if (flag >= 0xD0) { if (flag < 0xD0)
goto bigger_than_0xB0;
tempbx = VB_SIS301LV; tempbx = VB_SIS301LV;
if (flag >= 0xE0) { if (flag < 0xE0)
goto bigger_than_0xB0;
tempbx = VB_SIS302LV; tempbx = VB_SIS302LV;
tempah = xgifb_reg_get( tempah = xgifb_reg_get(pVBInfo->Part4Port, 0x39);
pVBInfo->Part4Port,
0x39);
if (tempah != 0xFF) if (tempah != 0xFF)
tempbx = tempbx = VB_XGI301C;
VB_XGI301C;
}
}
}
bigger_than_0xB0:
if (tempbx & (VB_SIS301B | VB_SIS302B)) { if (tempbx & (VB_SIS301B | VB_SIS302B)) {
flag = xgifb_reg_get( flag = xgifb_reg_get(pVBInfo->Part4Port, 0x23);
pVBInfo->Part4Port,
0x23);
if (!(flag & 0x02)) if (!(flag & 0x02))
tempbx = tempbx | VB_NoLCD; tempbx = tempbx | VB_NoLCD;
} }
}
} finish:
pVBInfo->VBType = tempbx; pVBInfo->VBType = tempbx;
}
} }
static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment