From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH 2/2 v2] hda - delayed ELD repoll Date: Tue, 15 Nov 2011 18:10:37 +0100 Message-ID: References: <20111115143155.GA28175@localhost> <20111115143315.GA28561@localhost> <20111115165623.GA4487@localhost> <20111115165708.GA5224@localhost> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTP id 03D029E7B4 for ; Tue, 15 Nov 2011 09:10:40 -0800 (PST) In-Reply-To: <20111115165708.GA5224@localhost> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Wu Fengguang Cc: alsa-devel@alsa-project.org, "Wang, Zhenyu Z" , "intel-gfx@lists.freedesktop.org" , "Barnes, Jesse" , Jeremy Bush , Christopher White , "Bossart, Pierre-louis" List-Id: intel-gfx@lists.freedesktop.org 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