Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915/gmbus: use to_intel_gmbus() instead of open coding
Date: Mon, 07 Mar 2022 11:26:01 +0200	[thread overview]
Message-ID: <87fsnu2jx2.fsf@intel.com> (raw)
In-Reply-To: <YiIxCtz1GjOXpfNn@intel.com>

On Fri, 04 Mar 2022, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Fri, Mar 04, 2022 at 12:14:26PM +0200, Jani Nikula wrote:
>> We have a helper for getting at the enclosing gmbus struct from the
>> embedded i2c_adapter, use it.
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Series is
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Thanks, pushed.

BR,
Jani.

>
>> ---
>>  drivers/gpu/drm/i915/display/intel_gmbus.c | 18 +++++-------------
>>  1 file changed, 5 insertions(+), 13 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_gmbus.c b/drivers/gpu/drm/i915/display/intel_gmbus.c
>> index 8f26528c3dc7..21281a7bdc17 100644
>> --- a/drivers/gpu/drm/i915/display/intel_gmbus.c
>> +++ b/drivers/gpu/drm/i915/display/intel_gmbus.c
>> @@ -300,9 +300,7 @@ static void set_data(void *data, int state_high)
>>  static int
>>  intel_gpio_pre_xfer(struct i2c_adapter *adapter)
>>  {
>> -	struct intel_gmbus *bus = container_of(adapter,
>> -					       struct intel_gmbus,
>> -					       adapter);
>> +	struct intel_gmbus *bus = to_intel_gmbus(adapter);
>>  	struct drm_i915_private *dev_priv = bus->dev_priv;
>>  
>>  	intel_gmbus_reset(dev_priv);
>> @@ -319,9 +317,7 @@ intel_gpio_pre_xfer(struct i2c_adapter *adapter)
>>  static void
>>  intel_gpio_post_xfer(struct i2c_adapter *adapter)
>>  {
>> -	struct intel_gmbus *bus = container_of(adapter,
>> -					       struct intel_gmbus,
>> -					       adapter);
>> +	struct intel_gmbus *bus = to_intel_gmbus(adapter);
>>  	struct drm_i915_private *dev_priv = bus->dev_priv;
>>  
>>  	set_data(bus, 1);
>> @@ -619,9 +615,7 @@ static int
>>  do_gmbus_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num,
>>  	      u32 gmbus0_source)
>>  {
>> -	struct intel_gmbus *bus = container_of(adapter,
>> -					       struct intel_gmbus,
>> -					       adapter);
>> +	struct intel_gmbus *bus = to_intel_gmbus(adapter);
>>  	struct drm_i915_private *dev_priv = bus->dev_priv;
>>  	int i = 0, inc, try = 0;
>>  	int ret = 0;
>> @@ -751,8 +745,7 @@ do_gmbus_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num,
>>  static int
>>  gmbus_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num)
>>  {
>> -	struct intel_gmbus *bus =
>> -		container_of(adapter, struct intel_gmbus, adapter);
>> +	struct intel_gmbus *bus = to_intel_gmbus(adapter);
>>  	struct drm_i915_private *dev_priv = bus->dev_priv;
>>  	intel_wakeref_t wakeref;
>>  	int ret;
>> @@ -776,8 +769,7 @@ gmbus_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num)
>>  
>>  int intel_gmbus_output_aksv(struct i2c_adapter *adapter)
>>  {
>> -	struct intel_gmbus *bus =
>> -		container_of(adapter, struct intel_gmbus, adapter);
>> +	struct intel_gmbus *bus = to_intel_gmbus(adapter);
>>  	struct drm_i915_private *dev_priv = bus->dev_priv;
>>  	u8 cmd = DRM_HDCP_DDC_AKSV;
>>  	u8 buf[DRM_HDCP_KSV_LEN] = { 0 };
>> -- 
>> 2.30.2

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2022-03-07  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04 10:14 [Intel-gfx] [PATCH 1/2] drm/i915/gmbus: move some local bus variables within loops Jani Nikula
2022-03-04 10:14 ` [Intel-gfx] [PATCH 2/2] drm/i915/gmbus: use to_intel_gmbus() instead of open coding Jani Nikula
2022-03-04 15:32   ` Ville Syrjälä
2022-03-07  9:26     ` Jani Nikula [this message]
2022-03-04 12:39 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/gmbus: move some local bus variables within loops Patchwork
2022-03-05  0:23 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fsnu2jx2.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox