Instead of letting other modules directly access the ->gmbus array,
introduce a new API, intel_gmbus_get_bus(), to lookup an i2c_adapter for
a given gmbus pin pair identifier. This API enables later refactoring
of the gmbus pin pair list.
Note: It is critical that intel_setup_gmbus() gets called
On Wed, 7 Mar 2012 19:50:44 +0800, Daniel Kurtz
wrote:
> Instead of letting other modules directly access the ->gmbus array,
> introduce a new API, intel_gmbus_get_bus(), to lookup an i2c_adapter for
> a given gmbus pin pair identifier. This API enables later refactoring
> of the gmbus pin pair
On Wed, 7 Mar 2012 19:50:44 +0800, Daniel Kurtz
wrote:
> +struct i2c_adapter *intel_gmbus_get_bus(struct drm_i915_private *dev_priv,
> + int pin)
> +{
BUG_ON(pin >= GMBUS_NUM_PORTS);
> + return (pin < GMBUS_NUM_PORTS) ? &dev_priv->gmbus[pin].adapter : NUL
Instead of letting other modules directly access the ->gmbus array,
introduce a new API, intel_gmbus_get_bus(), to lookup an i2c_adapter for
a given gmbus pin pair identifier. This API enables later refactoring
of the gmbus pin pair list.
Note: It is critical that intel_setup_gmbus() gets called
On Wed, 7 Mar 2012 19:50:44 +0800, Daniel Kurtz wrote:
> Instead of letting other modules directly access the ->gmbus array,
> introduce a new API, intel_gmbus_get_bus(), to lookup an i2c_adapter for
> a given gmbus pin pair identifier. This API enables later refactoring
> of the gmbus pin pair
On Wed, 7 Mar 2012 19:50:44 +0800, Daniel Kurtz wrote:
> +struct i2c_adapter *intel_gmbus_get_bus(struct drm_i915_private *dev_priv,
> + int pin)
> +{
BUG_ON(pin >= GMBUS_NUM_PORTS);
> + return (pin < GMBUS_NUM_PORTS) ? &dev_priv->gmbus[pin].adapter : NULL