diff options
Diffstat (limited to 'include/linux/i2c.h')
| -rw-r--r-- | include/linux/i2c.h | 14 | 
1 files changed, 8 insertions, 6 deletions
| diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 4bae0b72ed3c..889b35abaeda 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -384,11 +384,15 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data) | |||
| 384 | dev_set_drvdata(&dev->dev, data); | 384 | dev_set_drvdata(&dev->dev, data); | 
| 385 | } | 385 | } | 
| 386 | 386 | ||
| 387 | static inline int i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) | 387 | static inline struct i2c_adapter * | 
| 388 | i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) | ||
| 388 | { | 389 | { | 
| 389 | return adapter->dev.parent != NULL | 390 | struct device *parent = adapter->dev.parent; | 
| 390 | && adapter->dev.parent->bus == &i2c_bus_type | 391 | |
| 391 | && adapter->dev.parent->type == &i2c_adapter_type; | 392 | if (parent != NULL && parent->type == &i2c_adapter_type) | 
| 393 | return to_i2c_adapter(parent); | ||
| 394 | else | ||
| 395 | return NULL; | ||
| 392 | } | 396 | } | 
| 393 | 397 | ||
| 394 | /* Adapter locking functions, exported for shared pin cases */ | 398 | /* Adapter locking functions, exported for shared pin cases */ | 
| @@ -403,8 +407,6 @@ void i2c_unlock_adapter(struct i2c_adapter *); | |||
| 403 | 407 | ||
| 404 | /* i2c adapter classes (bitmask) */ | 408 | /* i2c adapter classes (bitmask) */ | 
| 405 | #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ | 409 | #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */ | 
| 406 | #define I2C_CLASS_TV_ANALOG (1<<1) /* bttv + friends */ | ||
| 407 | #define I2C_CLASS_TV_DIGITAL (1<<2) /* dvb cards */ | ||
| 408 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ | 410 | #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */ | 
| 409 | #define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ | 411 | #define I2C_CLASS_SPD (1<<7) /* SPD EEPROMs and similar */ | 
| 410 | 412 | ||
