aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-02-26 06:23:23 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-02-26 06:23:23 +0000
commitbe9ee6d1fe9f3c11e0b68308321ee4bd23eca04f (patch)
treefc3915ac84b65b7bcfb6183fac48129776fa29b7 /target/linux
parentf3b7d1baff0cddcbc03a66214a7d673aaace23ff (diff)
downloadupstream-be9ee6d1fe9f3c11e0b68308321ee4bd23eca04f.tar.gz
upstream-be9ee6d1fe9f3c11e0b68308321ee4bd23eca04f.tar.bz2
upstream-be9ee6d1fe9f3c11e0b68308321ee4bd23eca04f.zip
ixp4xx: fix the i2c pld driver for 2.6.37 - i2c uses a rt_mutex instead of a mutex now
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25725 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ixp4xx/patches-2.6.37/020-gateworks_i2c_pld.patch26
1 files changed, 13 insertions, 13 deletions
diff --git a/target/linux/ixp4xx/patches-2.6.37/020-gateworks_i2c_pld.patch b/target/linux/ixp4xx/patches-2.6.37/020-gateworks_i2c_pld.patch
index 6c93c44661..c4904b721e 100644
--- a/target/linux/ixp4xx/patches-2.6.37/020-gateworks_i2c_pld.patch
+++ b/target/linux/ixp4xx/patches-2.6.37/020-gateworks_i2c_pld.patch
@@ -51,7 +51,7 @@
+/*
+ * The Gateworks I2C PLD chip does not properly send the acknowledge bit
+ * thus we cannot use standard i2c_smbus functions. We have recreated
-+ * our own here, but we still use the mutex_lock to lock the i2c_bus
++ * our own here, but we still use the rt_mutex_lock to lock the i2c_bus
+ * as the device still exists on the I2C bus.
+*/
+
@@ -179,21 +179,21 @@
+ int ret;
+ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip);
+ struct i2c_adapter *adap = gpio->client->adapter;
-+
++
+ if (in_atomic() || irqs_disabled()) {
-+ ret = mutex_trylock(&adap->bus_lock);
++ ret = rt_mutex_trylock(&adap->bus_lock);
+ if (!ret)
+ /* I2C activity is ongoing. */
+ return -EAGAIN;
+ } else {
-+ mutex_lock_nested(&adap->bus_lock, adap->level);
++ rt_mutex_lock(&adap->bus_lock);
+ }
+
+ gpio->out |= (1 << offset);
+
+ ret = i2c_pld_write_byte(gpio->client->addr, gpio->out);
+
-+ mutex_unlock(&adap->bus_lock);
++ rt_mutex_unlock(&adap->bus_lock);
+
+ return ret;
+}
@@ -204,19 +204,19 @@
+ s32 value;
+ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip);
+ struct i2c_adapter *adap = gpio->client->adapter;
-+
++
+ if (in_atomic() || irqs_disabled()) {
-+ ret = mutex_trylock(&adap->bus_lock);
++ ret = rt_mutex_trylock(&adap->bus_lock);
+ if (!ret)
+ /* I2C activity is ongoing. */
+ return -EAGAIN;
+ } else {
-+ mutex_lock_nested(&adap->bus_lock, adap->level);
++ rt_mutex_lock(&adap->bus_lock);
+ }
+
+ value = i2c_pld_read_byte(gpio->client->addr);
+
-+ mutex_unlock(&adap->bus_lock);
++ rt_mutex_unlock(&adap->bus_lock);
+
+ return (value < 0) ? 0 : (value & (1 << offset));
+}
@@ -229,14 +229,14 @@
+ struct i2c_adapter *adap = gpio->client->adapter;
+
+ unsigned bit = 1 << offset;
-+
++
+ if (in_atomic() || irqs_disabled()) {
-+ ret = mutex_trylock(&adap->bus_lock);
++ ret = rt_mutex_trylock(&adap->bus_lock);
+ if (!ret)
+ /* I2C activity is ongoing. */
+ return -EAGAIN;
+ } else {
-+ mutex_lock_nested(&adap->bus_lock, adap->level);
++ rt_mutex_lock(&adap->bus_lock);
+ }
+
+
@@ -247,7 +247,7 @@
+
+ ret = i2c_pld_write_byte(gpio->client->addr, gpio->out);
+
-+ mutex_unlock(&adap->bus_lock);
++ rt_mutex_unlock(&adap->bus_lock);
+
+ return ret;
+}