diff options
-rw-r--r-- | linux-2.6/radeon_i2c.c | 24 | ||||
-rw-r--r-- | linux-core/radeon_i2c.c | 16 |
2 files changed, 18 insertions, 22 deletions
diff --git a/linux-2.6/radeon_i2c.c b/linux-2.6/radeon_i2c.c index e2591723..df51581c 100644 --- a/linux-2.6/radeon_i2c.c +++ b/linux-2.6/radeon_i2c.c @@ -76,7 +76,7 @@ static int gpio_getsda(void* data) struct radeon_i2c_chan *chan = data; drm_radeon_private_t *dev_priv = chan->dev->dev_private; u32 val; - + val = RADEON_READ(chan->ddc_reg); return (val & VGA_DDC_DATA_INPUT) ? 1 : 0; @@ -97,7 +97,7 @@ static int setup_i2c_bus(struct radeon_i2c_chan *chan, const char *name) chan->algo.getscl = gpio_getscl; chan->algo.udelay = 40; chan->algo.timeout = 20; - chan->algo.data = chan; + chan->algo.data = chan; i2c_set_adapdata(&chan->adapter, chan); @@ -114,30 +114,28 @@ static int setup_i2c_bus(struct radeon_i2c_chan *chan, const char *name) return rc; } -int radeon_create_i2c_busses(drm_device_t *dev) +int radeon_create_i2c_busses(drm_device_t * dev) { drm_radeon_private_t *dev_priv = dev->dev_private; - int ret; dev_priv->i2c[0].dev = dev; dev_priv->i2c[0].ddc_reg = GPIO_MONID; - if ((ret = setup_i2c_bus(&dev_priv->i2c[0], "monid"))) - return ret; + /* 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"); dev_priv->i2c[1].dev = dev; dev_priv->i2c[1].ddc_reg = GPIO_DVI_DDC; - if ((ret = setup_i2c_bus(&dev_priv->i2c[1], "dvi"))) - return ret; + setup_i2c_bus(&dev_priv->i2c[1], "dvi"); dev_priv->i2c[2].dev = dev; dev_priv->i2c[2].ddc_reg = GPIO_VGA_DDC; - if ((ret = setup_i2c_bus(&dev_priv->i2c[2], "vga"))) - return ret; + setup_i2c_bus(&dev_priv->i2c[2], "vga"); dev_priv->i2c[3].dev = dev; dev_priv->i2c[3].ddc_reg = GPIO_CRT2_DDC; - if ((ret = setup_i2c_bus(&dev_priv->i2c[3], "crt2"))) - return ret; + setup_i2c_bus(&dev_priv->i2c[3], "crt2"); + return 0; } @@ -145,7 +143,7 @@ void radeon_delete_i2c_busses(drm_device_t *dev) { drm_radeon_private_t *dev_priv = dev->dev_private; int i, ret; - + for (i = 0; i < 4; i++) { if (dev_priv->i2c[i].dev) { ret = i2c_bit_del_bus(&dev_priv->i2c[i].adapter); diff --git a/linux-core/radeon_i2c.c b/linux-core/radeon_i2c.c index bd35f17f..97770caa 100644 --- a/linux-core/radeon_i2c.c +++ b/linux-core/radeon_i2c.c @@ -116,27 +116,25 @@ static int setup_i2c_bus(struct radeon_i2c_chan *chan, const char *name) int radeon_create_i2c_busses(drm_device_t * dev) { drm_radeon_private_t *dev_priv = dev->dev_private; - int ret; dev_priv->i2c[0].dev = dev; dev_priv->i2c[0].ddc_reg = GPIO_MONID; - if ((ret = setup_i2c_bus(&dev_priv->i2c[0], "monid"))) - return ret; + /* 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"); dev_priv->i2c[1].dev = dev; dev_priv->i2c[1].ddc_reg = GPIO_DVI_DDC; - if ((ret = setup_i2c_bus(&dev_priv->i2c[1], "dvi"))) - return ret; + setup_i2c_bus(&dev_priv->i2c[1], "dvi"); dev_priv->i2c[2].dev = dev; dev_priv->i2c[2].ddc_reg = GPIO_VGA_DDC; - if ((ret = setup_i2c_bus(&dev_priv->i2c[2], "vga"))) - return ret; + setup_i2c_bus(&dev_priv->i2c[2], "vga"); dev_priv->i2c[3].dev = dev; dev_priv->i2c[3].ddc_reg = GPIO_CRT2_DDC; - if ((ret = setup_i2c_bus(&dev_priv->i2c[3], "crt2"))) - return ret; + setup_i2c_bus(&dev_priv->i2c[3], "crt2"); + return 0; } |