Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1805b38 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman
Browse files

staging: xgifb: ReadVBIOSTablData(): copy only a single LVDS entry



Only a single LVDS table entry is needed by the driver.

Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 08ce239c
Loading
Loading
Loading
Loading
+27 −26
Original line number Diff line number Diff line
@@ -1120,9 +1120,10 @@ static void ReadVBIOSTablData(struct pci_dev *pdev,
	struct xgifb_video_info *xgifb_info = pci_get_drvdata(pdev);
	u8 *vbios;
	unsigned long i;
	unsigned char j, k;
	unsigned char j;
	struct XGI21_LVDSCapStruct *lvds;
	size_t vbios_size;
	int entry;

	if (xgifb_info->chip != XG21)
		return;
@@ -1148,9 +1149,14 @@ static void ReadVBIOSTablData(struct pci_dev *pdev,
		goto error;
	if (j == 0xff)
		j = 1;
	k = 0;
	/*
	 * Read the LVDS table index scratch register set by the BIOS.
	 */
	entry = xgifb_reg_get(xgifb_info->dev_info.P3d4, 0x36);
	if (entry >= j)
		entry = 0;
	i += entry * 25;
	lvds = &pVBInfo->XG21_LVDSCapList[0];
	do {
	if (vbios_size <= i + 24)
		goto error;
	lvds->LVDS_Capability	= vbios[i]	| (vbios[i + 1] << 8);
@@ -1169,11 +1175,6 @@ static void ReadVBIOSTablData(struct pci_dev *pdev,
	lvds->PSC_S3		= vbios[i + 22];
	lvds->PSC_S4		= vbios[i + 23];
	lvds->PSC_S5		= vbios[i + 24];
		i += 25;
		j--;
		k++;
		lvds++;
	} while (j > 0 && k < ARRAY_SIZE(XGI21_LCDCapList));
	vfree(vbios);
	pVBInfo->IF_DEF_LVDS = 1;
	return;
+0 −6
Original line number Diff line number Diff line
@@ -3650,12 +3650,6 @@ static void XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl,

static unsigned short XGI_GetLVDSOEMTableIndex(struct vb_device_info *pVBInfo)
{
	unsigned short index;

	index = xgifb_reg_get(pVBInfo->P3d4, 0x36);
	if (index < sizeof(XGI21_LCDCapList)
			/ sizeof(struct XGI21_LVDSCapStruct))
		return index;
	return 0;
}