From 9415d1790f102efa33bf43cb7bccdcd452af21a3 Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Thu, 6 Oct 2011 15:25:56 -0300 Subject: [PATCH] Abort early when i2c tells us that it is not there This allows to avoid talking to a non-existent bus repeatedly until we finally timeout. Signed-off-by: Eugeni Dodonov --- drivers/gpu/drm/drm_edid.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 7425e5c..475eff3 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -265,6 +265,11 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf, } }; ret = i2c_transfer(adapter, msgs, 2); + if (ret == -ENXIO) { + printk(KERN_WARNING "drm: i2c told us that device %s is not there\n", + adapter->name); + break; + } } while (ret != 2 && --retries); return ret == 2 ? 0 : -1; -- 1.7.6.3