From: Takashi Iwai Subject: Re: [RFC 1/3] ALSA: hda - remove assigning dev type inside core Date: Sat, 04 Apr 2015 14:18:20 +0200 Message-ID: References: <1427968651-7821-1-git-send-email-vinod.koul@intel.com> <1427968651-7821-2-git-send-email-vinod.koul@intel.com> 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 alsa0.perex.cz (Postfix) with ESMTP id 07F6E2604EB for ; Sat, 4 Apr 2015 14:18:22 +0200 (CEST) In-Reply-To: <1427968651-7821-2-git-send-email-vinod.koul@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Vinod Koul Cc: alsa-devel@alsa-project.org, broonie@kernel.org, lgirdwood@gmail.com, pathes.audio@intel.com, Ramesh Babu List-Id: alsa-devel@alsa-project.org At Thu, 2 Apr 2015 15:27:29 +0530, Vinod Koul wrote: > > From: Ramesh Babu > > We don't need to init the hda dev type inside > core device init code. It is expected to be > initialized by the caller. As there is no way in C to guarantee the initialization of some virtual fields in the inherited class, it's safer to do the complete init in the base class initializer and let the child class override manually. Takashi > > Signed-off-by: Ramesh Babu > Signed-off-by: Vinod Koul > --- > sound/hda/hdac_device.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c > index 6e8ee1d6974a..aefc80ffecee 100644 > --- a/sound/hda/hdac_device.c > +++ b/sound/hda/hdac_device.c > @@ -51,7 +51,6 @@ int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus, > > codec->bus = bus; > codec->addr = addr; > - codec->type = HDA_DEV_CORE; > pm_runtime_set_active(&codec->dev); > pm_runtime_get_noresume(&codec->dev); > atomic_set(&codec->in_pm, 0); > -- > 1.7.9.5 >