public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Wu Fengguang <fengguang.wu@intel.com>
Cc: alsa-devel@alsa-project.org, "Wang,
	Zhenyu Z" <zhenyu.z.wang@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Barnes, Jesse" <jesse.barnes@intel.com>,
	Jeremy Bush <contractfrombelow@gmail.com>,
	Christopher White <c.white@pulseforce.com>,
	"Bossart, Pierre-louis" <pierre-louis.bossart@intel.com>
Subject: Re: [PATCH 2/2 v2] hda - delayed ELD repoll
Date: Tue, 15 Nov 2011 18:10:37 +0100	[thread overview]
Message-ID: <s5hobwdpb02.wl%tiwai@suse.de> (raw)
In-Reply-To: <20111115165708.GA5224@localhost>

At Wed, 16 Nov 2011 00:57:08 +0800,
Wu Fengguang wrote:
> +static void hda_eld_work(struct work_struct *work)
> +{
> +	struct hdmi_eld *eld = container_of(
> +				container_of(work, struct delayed_work, work),
> +				struct hdmi_eld, work);

Ugh, hardly to read.  Slightly better to use to_delayed_work()?

	struct hdmi_eld *eld = container_of(to_delayed_work(work),
					    struct hdmi_eld, work);

> +	struct hdmi_spec_per_pin *per_pin =
> +			container_of(eld, struct hdmi_spec_per_pin, sink_eld);
> +	struct hda_codec *codec = eld->codec;
> +
> +	hdmi_present_sense(codec, per_pin->pin_nid, eld, false);
> +}
> +
>  static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid)
>  {
>  	struct hdmi_spec *spec = codec->spec;
> @@ -1227,7 +1245,7 @@ static int generic_hdmi_build_jack(struc
>  	if (err < 0)
>  		return err;
>  
> -	hdmi_present_sense(codec, per_pin->pin_nid, &per_pin->sink_eld);
> +	hdmi_present_sense(codec, per_pin->pin_nid, &per_pin->sink_eld, false);
...

Looking through the code, I wonder how about keeping work and codec
pointer in struct hdmi_spec_per_pin instead of struct hdmi_eld.  Then
we don't need to expose it in hda_local.h, and changes would be
slightly more compact.

hdmi_present_sense() can be modified to receive hdmi_sepc_per_pin*
directly instead of individual nid and eld pointer.


thanks,

Takashi

  reply	other threads:[~2011-11-15 17:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-15 14:31 [PATCH 1/2] hda - fix ELD memory leak Wu Fengguang
2011-11-15 14:33 ` [PATCH 2/2] hda - delayed ELD repoll Wu Fengguang
2011-11-15 16:56   ` Wu Fengguang
2011-11-15 16:57     ` [PATCH 2/2 v2] " Wu Fengguang
2011-11-15 17:10       ` Takashi Iwai [this message]
2011-11-16  2:35         ` Wu Fengguang
2011-11-16  7:02       ` Paul Menzel
2011-11-15 18:25   ` [PATCH 2/2] " Stephen Warren
2011-11-16  2:48     ` [alsa-devel] " Wu Fengguang
2011-11-16 15:51       ` Stephen Warren
2011-11-16 15:57         ` Takashi Iwai
2011-11-16 16:12           ` Stephen Warren
2011-11-16 16:16             ` [alsa-devel] " Takashi Iwai
2011-11-16 22:46         ` Wu Fengguang
2011-11-16 23:12           ` Wu Fengguang
2011-11-15 14:35 ` [PATCH 1/2] hda - fix ELD memory leak Takashi Iwai
2011-11-15 14:41   ` Wu Fengguang
2011-11-15 14:45     ` Takashi Iwai
2011-11-15 16:56       ` Wu Fengguang
2011-11-15 18:19 ` Stephen Warren

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=s5hobwdpb02.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=c.white@pulseforce.com \
    --cc=contractfrombelow@gmail.com \
    --cc=fengguang.wu@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jesse.barnes@intel.com \
    --cc=pierre-louis.bossart@intel.com \
    --cc=zhenyu.z.wang@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