mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-30 09:40:14 +01:00
Don't release an i2c channel that has not initialized correctly
This commit is contained in:
parent
7ebbebf3d3
commit
17ce33835a
2 changed files with 16 additions and 8 deletions
|
|
@ -122,19 +122,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue