aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-dev.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-24 15:46:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-24 15:46:24 -0400
commitbdaf12b41235b0c59949914de022341e77907461 (patch)
tree2473bf0e3a28fdc2285cf830c9a259d9b85a4061 /drivers/i2c/i2c-dev.c
parent7c024e9534f9edd8d052380a1b40d376c8feb11b (diff)
parentbf5d95c82692ead9ba7876af73dac2edcc8a6191 (diff)
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: i2c-viapro: Don't log nacks i2c/pca954x: Remove __devinit and __devexit from probe and remove functions MAINTAINERS: Add maintainer for PCA9541 I2C bus master selector driver i2c/mux: Driver for PCA9541 I2C Master Selector i2c: Optimize function i2c_detect() i2c: Discard warning message on device instantiation from user-space i2c-amd8111: Add proper error handling i2c: Change to new flag variable i2c: Remove unneeded inclusions of <linux/i2c-id.h> i2c: Let i2c_parent_is_i2c_adapter return the parent adapter i2c: Simplify i2c_parent_is_i2c_adapter i2c-pca-platform: Change device name of request_irq i2c: Fix Kconfig dependencies
Diffstat (limited to 'drivers/i2c/i2c-dev.c')
-rw-r--r--drivers/i2c/i2c-dev.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 5f3a52d517c3..cec0f3ba97f8 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -192,13 +192,12 @@ static int i2cdev_check(struct device *dev, void *addrp)
192/* walk up mux tree */ 192/* walk up mux tree */
193static int i2cdev_check_mux_parents(struct i2c_adapter *adapter, int addr) 193static int i2cdev_check_mux_parents(struct i2c_adapter *adapter, int addr)
194{ 194{
195 struct i2c_adapter *parent = i2c_parent_is_i2c_adapter(adapter);
195 int result; 196 int result;
196 197
197 result = device_for_each_child(&adapter->dev, &addr, i2cdev_check); 198 result = device_for_each_child(&adapter->dev, &addr, i2cdev_check);
198 199 if (!result && parent)
199 if (!result && i2c_parent_is_i2c_adapter(adapter)) 200 result = i2cdev_check_mux_parents(parent, addr);
200 result = i2cdev_check_mux_parents(
201 to_i2c_adapter(adapter->dev.parent), addr);
202 201
203 return result; 202 return result;
204} 203}
@@ -222,11 +221,11 @@ static int i2cdev_check_mux_children(struct device *dev, void *addrp)
222 driver bound to it, as NOT busy. */ 221 driver bound to it, as NOT busy. */
223static int i2cdev_check_addr(struct i2c_adapter *adapter, unsigned int addr) 222static int i2cdev_check_addr(struct i2c_adapter *adapter, unsigned int addr)
224{ 223{
224 struct i2c_adapter *parent = i2c_parent_is_i2c_adapter(adapter);
225 int result = 0; 225 int result = 0;
226 226
227 if (i2c_parent_is_i2c_adapter(adapter)) 227 if (parent)
228 result = i2cdev_check_mux_parents( 228 result = i2cdev_check_mux_parents(parent, addr);
229 to_i2c_adapter(adapter->dev.parent), addr);
230 229
231 if (!result) 230 if (!result)
232 result = device_for_each_child(&adapter->dev, &addr, 231 result = device_for_each_child(&adapter->dev, &addr,