]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/i2c/i2c-core.c
i2c: Set a default timeout value for all adapters
[linux-2.6-omap-h63xx.git] / drivers / i2c / i2c-core.c
index 456caa80bfd3ba369ee279d0356fcdaa6dcadbdb..e361033815d3ffe8cb2e537d2b39862051ea308c 100644 (file)
@@ -459,6 +459,11 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
                pr_debug("I2C adapter driver [%s] forgot to specify "
                         "physical device\n", adap->name);
        }
+
+       /* Set default timeout to 1 second if not already set */
+       if (adap->timeout == 0)
+               adap->timeout = HZ;
+
        dev_set_name(&adap->dev, "i2c-%d", adap->nr);
        adap->dev.release = &i2c_adapter_dev_release;
        adap->dev.class = &i2c_adapter_class;