DNI: DNI: Naughty hack to allow I2C reads in userspace
Normally if an address is bound to a kernel driver then reading or
writing at that address is blocked with an -EBUSY.
Of course a lot of the time the driver is idle - and I want to read
the registers. So 'unblock' the code path.
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 2cab27a..68cd5ec 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -190,7 +190,7 @@ static int i2cdev_check(struct device *dev, void *addrp)
if (!client || client->addr != *(unsigned int *)addrp)
return 0;
- return dev->driver ? -EBUSY : 0;
+ return dev->driver ? 0 : 0;
}
/* walk up mux tree */