Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752285AbdGDUKd (ORCPT ); Tue, 4 Jul 2017 16:10:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:46093 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752161AbdGDUKb (ORCPT ); Tue, 4 Jul 2017 16:10:31 -0400 Date: Tue, 04 Jul 2017 22:10:28 +0200 Message-ID: From: Takashi Iwai To: Robert Jarzmik Cc: "Dmitry Torokhov" , "Haojian Zhuang" , "Liam Girdwood" , "Mark Brown" , "Lee Jones" , "Lars-Peter Clausen" , "Charles Keepax" , "Jaroslav Kysela" , "Daniel Mack" , , , , , Subject: Re: [PATCH v3 02/12] ALSA: ac97: add an ac97 bus In-Reply-To: <87bmp0t2lv.fsf@belgarion.home> References: <20170630194408.24978-1-robert.jarzmik@free.fr> <20170630194408.24978-3-robert.jarzmik@free.fr> <87bmp0t2lv.fsf@belgarion.home> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1198 Lines: 49 On Tue, 04 Jul 2017 21:37:48 +0200, Robert Jarzmik wrote: > > Takashi Iwai writes: > > > On Fri, 30 Jun 2017 21:43:58 +0200, > > Robert Jarzmik wrote: > >> +static struct bus_type ac97_bus_type = { > >> + .name = "ac97", > > > > Name-conflict with the old ac97 bus? > Yeah, fair point. So what should I choose for this new one ? > - ac97new > - ac97bis > - ac97_2 > - ac97reborn ac97bus ac97_episode_5 ac98 ... I have no opinion on it. > >> +static int __init ac97_bus_init(void) > >> +{ > >> + return bus_register(&ac97_bus_type); > >> +} > >> +subsys_initcall(ac97_bus_init); > >> + > >> +MODULE_LICENSE("GPL"); > >> +MODULE_AUTHOR("Robert Jarzmik "); > > > > No bus_unregister() at exit? > Mmmh, that's because I used subsys_initcall(), which doesn't look good in a > module compilation setup. That will require a module_init(), and I will think > about how to implement it and test it for next iteration. You can use subsys_init() for modules, it's no problem. When it's built for a module, all xxx_init() is handled as equivalent with module_init(). See linux/module.h. It's just the lack of module_exit() in your case. thanks, Takashi