summaryrefslogtreecommitdiff
path: root/driver/xf86-video-nv/src/g80_output.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-08-22 12:29:28 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-08-22 12:29:28 +0000
commit3ee16a263dc221489e6f26bc32140c5d71c35609 (patch)
tree09fc6b10952722066b05e4cc99b0c1025da3407e /driver/xf86-video-nv/src/g80_output.c
parentf23300683699bc2ce1fa9f0f17cdde28c221d92e (diff)
Update to xf86-video-nv 2.1.18.
Tested at least by krw@, benoit@ and giovanni@.
Diffstat (limited to 'driver/xf86-video-nv/src/g80_output.c')
-rw-r--r--driver/xf86-video-nv/src/g80_output.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/driver/xf86-video-nv/src/g80_output.c b/driver/xf86-video-nv/src/g80_output.c
index 887208baf..2da99cba0 100644
--- a/driver/xf86-video-nv/src/g80_output.c
+++ b/driver/xf86-video-nv/src/g80_output.c
@@ -291,7 +291,7 @@ G80I2CInit(ScrnInfoPtr pScrn, const char *name, const int port)
if(xf86I2CBusInit(i2c)) {
return i2c;
} else {
- xfree(i2c);
+ free(i2c);
return NULL;
}
}
@@ -481,19 +481,22 @@ G80CreateOutputs(ScrnInfoPtr pScrn)
if(pNv->lvds.present) {
xf86OutputPtr lvds = G80CreateSor(pScrn, pNv->lvds.or, LVDS);
- G80OutputPrivPtr pPriv = lvds->driver_private;
- pPriv->scale = G80_SCALE_ASPECT;
+ if (lvds) {
+ G80OutputPrivPtr pPriv = lvds->driver_private;
- if(pNv->lvds.i2cPort != -1) {
- char i2cName[16];
+ pPriv->scale = G80_SCALE_ASPECT;
+
+ if(pNv->lvds.i2cPort != -1) {
+ char i2cName[16];
- snprintf(i2cName, sizeof(i2cName), "I2C%i (LVDS)", pNv->lvds.i2cPort);
- pPriv->i2c = G80I2CInit(pScrn, i2cName, pNv->lvds.i2cPort);
- if(!pPriv->i2c) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Failed to initialize I2C for port %i (LVDS)!\n",
- pNv->lvds.i2cPort);
+ snprintf(i2cName, sizeof(i2cName), "I2C%i (LVDS)", pNv->lvds.i2cPort);
+ pPriv->i2c = G80I2CInit(pScrn, i2cName, pNv->lvds.i2cPort);
+ if(!pPriv->i2c) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Failed to initialize I2C for port %i (LVDS)!\n",
+ pNv->lvds.i2cPort);
+ }
}
}
}