aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_i2c.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c b/drivers/gpu/drm/nouveau/nouveau_i2c.c
index d0d581440d5e..116ef3193fc7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_i2c.c
+++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c
@@ -375,9 +375,13 @@ nouveau_i2c_identify(struct drm_device *dev, const char *what,
375 struct nouveau_i2c_chan *i2c = nouveau_i2c_find(dev, index); 375 struct nouveau_i2c_chan *i2c = nouveau_i2c_find(dev, index);
376 int i; 376 int i;
377 377
378 NV_DEBUG(dev, "Probing %ss on I2C bus: %d\n", what, index); 378 if (!i2c) {
379 NV_DEBUG(dev, "No bus when probing %s on %d\n", what, index);
380 return -ENODEV;
381 }
379 382
380 for (i = 0; i2c && info[i].addr; i++) { 383 NV_DEBUG(dev, "Probing %ss on I2C bus: %d\n", what, i2c->index);
384 for (i = 0; info[i].addr; i++) {
381 if (nouveau_probe_i2c_addr(i2c, info[i].addr) && 385 if (nouveau_probe_i2c_addr(i2c, info[i].addr) &&
382 (!match || match(i2c, &info[i]))) { 386 (!match || match(i2c, &info[i]))) {
383 NV_INFO(dev, "Detected %s: %s\n", what, info[i].type); 387 NV_INFO(dev, "Detected %s: %s\n", what, info[i].type);
@@ -386,6 +390,5 @@ nouveau_i2c_identify(struct drm_device *dev, const char *what,
386 } 390 }
387 391
388 NV_DEBUG(dev, "No devices found.\n"); 392 NV_DEBUG(dev, "No devices found.\n");
389
390 return -ENODEV; 393 return -ENODEV;
391} 394}