diff options
author | Jon Smirl <jonsmirl@yahoo.com> | 2004-10-20 16:23:42 +0000 |
---|---|---|
committer | Jon Smirl <jonsmirl@yahoo.com> | 2004-10-20 16:23:42 +0000 |
commit | 17ce33835a0b582d87343fab331d80342f268d4d (patch) | |
tree | d6cc82d7ba8e710f3c99a8d2c8580cbeeb78c000 /linux-core | |
parent | 7ebbebf3d3a3af3c363a1396d737d5a61634124b (diff) |
Don't release an i2c channel that has not initialized correctly
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/radeon_i2c.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/linux-core/radeon_i2c.c b/linux-core/radeon_i2c.c index 97770caa..32b68a2a 100644 --- a/linux-core/radeon_i2c.c +++ b/linux-core/radeon_i2c.c @@ -121,19 +121,23 @@ int radeon_create_i2c_busses(drm_device_t * dev) dev_priv->i2c[0].ddc_reg = GPIO_MONID; /* Don't return the error from setup. It is not fatal */ /* if the bus can not be initialized */ - setup_i2c_bus(&dev_priv->i2c[0], "monid"); + if (!setup_i2c_bus(&dev_priv->i2c[0], "monid")) + dev_priv->i2c[0].dev = NULL; dev_priv->i2c[1].dev = dev; dev_priv->i2c[1].ddc_reg = GPIO_DVI_DDC; - setup_i2c_bus(&dev_priv->i2c[1], "dvi"); + if (!setup_i2c_bus(&dev_priv->i2c[1], "dvi")) + dev_priv->i2c[1].dev = NULL; dev_priv->i2c[2].dev = dev; dev_priv->i2c[2].ddc_reg = GPIO_VGA_DDC; - setup_i2c_bus(&dev_priv->i2c[2], "vga"); + if (!setup_i2c_bus(&dev_priv->i2c[2], "vga")) + dev_priv->i2c[2].dev = NULL; dev_priv->i2c[3].dev = dev; dev_priv->i2c[3].ddc_reg = GPIO_CRT2_DDC; - setup_i2c_bus(&dev_priv->i2c[3], "crt2"); + if (!setup_i2c_bus(&dev_priv->i2c[3], "crt2")) + dev_priv->i2c[0].dev = NULL; return 0; } |