From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754220Ab1IHXHV (ORCPT ); Thu, 8 Sep 2011 19:07:21 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:49797 "EHLO opensource2.wolfsonmicro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753190Ab1IHXHJ (ORCPT ); Thu, 8 Sep 2011 19:07:09 -0400 Subject: Re: [PATCH v2] ASoC: omap: convert per-board modules to platform drivers From: Mark Brown To: Arnd Bergmann Cc: linaro-dev@lists.linaro.org, Mans Rullgard , Jassi Brar , alsa-devel@alsa-project.org, Russell King , Tony Lindgren , linux-kernel@vger.kernel.org, Jaroslav Kysela , Takashi Iwai , Jarkko Nikula , linux-omap@vger.kernel.org, Liam Girdwood , linux-arm-kernel@lists.infradead.org Date: Thu, 08 Sep 2011 15:29:11 -0700 In-Reply-To: <3110288.bQbb0H2ME1@wuerfel> References: <1315503297-8365-1-git-send-email-mans.rullgard@linaro.org> <3110288.bQbb0H2ME1@wuerfel> Organization: Wolfson Microelectronics Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.2- Content-Transfer-Encoding: 7bit Message-ID: <1315520956.4126.3.camel@finisterre.wolfsonmicro.main> Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2011-09-08 at 22:28 +0200, Arnd Bergmann wrote: > On Thursday 08 September 2011 20:05:48 Mans Rullgard wrote: > > I had the same thought, but I couldn't find a suitable string anywhere. > > Are you suggesting an if(machine_is_foo()) cascade in omap_init_audio()? > > I'll be the first to agree this patch is not particularly pretty. > My general feeling is that practically every time someone writes > machine_is_*(), they are doing it wrong. There are of course exceptions, > but I would strongly recommend to have the initialization calling up > from the board file into more general functions instead of having all > boards calling the same function which then goes to board specific > code again. I have to agree, that seems tasteless. I'd expect something like triggering registration of devices based off walking down a table of machine IDs or something. One other issue to consider here is that we don't want to discourage people from sharing machine drivers while we can so it can't be completely automatic, it Perhaps some sort of generic machine type based mechanism for instantiating drivers a bit like what's done with DMI might be useful, video will have a similar issue I guess.