[PATCH 3/9] drm/i915/intel_i2c: refactor using intel_gmbus_get_bus

2012-03-07 Thread Daniel Kurtz
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

[PATCH 3/9] drm/i915/intel_i2c: refactor using intel_gmbus_get_bus

2012-03-07 Thread Chris Wilson
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

[PATCH 3/9] drm/i915/intel_i2c: refactor using intel_gmbus_get_bus

2012-03-07 Thread Chris Wilson
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

[PATCH 3/9] drm/i915/intel_i2c: refactor using intel_gmbus_get_bus

2012-03-07 Thread Daniel Kurtz
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

Re: [PATCH 3/9] drm/i915/intel_i2c: refactor using intel_gmbus_get_bus

2012-03-07 Thread Chris Wilson
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

Re: [PATCH 3/9] drm/i915/intel_i2c: refactor using intel_gmbus_get_bus

2012-03-07 Thread Chris Wilson
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