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
This commit is contained in:
+8
-4
@@ -384,11 +384,15 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
|
||||
dev_set_drvdata(&dev->dev, data);
|
||||
}
|
||||
|
||||
static inline int i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter)
|
||||
static inline struct i2c_adapter *
|
||||
i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter)
|
||||
{
|
||||
return adapter->dev.parent != NULL
|
||||
&& adapter->dev.parent->bus == &i2c_bus_type
|
||||
&& adapter->dev.parent->type == &i2c_adapter_type;
|
||||
struct device *parent = adapter->dev.parent;
|
||||
|
||||
if (parent != NULL && parent->type == &i2c_adapter_type)
|
||||
return to_i2c_adapter(parent);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Adapter locking functions, exported for shared pin cases */
|
||||
|
||||
Reference in New Issue
Block a user