lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 8 Sep 2011 23:37:20 +0100
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	Arnd Bergmann <arnd@...db.de>, alsa-devel@...a-project.org,
	Liam Girdwood <lrg@...com>, Tony Lindgren <tony@...mide.com>,
	Jassi Brar <jassisinghbrar@...il.com>,
	linux-kernel@...r.kernel.org, Jaroslav Kysela <perex@...ex.cz>,
	Takashi Iwai <tiwai@...e.de>,
	Jarkko Nikula <jhnikula@...il.com>,
	linaro-dev@...ts.linaro.org, linux-omap@...r.kernel.org,
	Mans Rullgard <mans.rullgard@...aro.org>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v2] ASoC: omap: convert per-board modules to platform
	drivers

On Thu, Sep 08, 2011 at 03:29:11PM -0700, Mark Brown wrote:
> 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 

This problem has been solved (before DT) for _ages_ through the use
of platform devices in the platform support files, registered by the
.init_machine callback.

Where it went wrong is when ASOC and PCMCIA became rather complicated
that you could no longer just pass a platform data structure, but
instead needed some complex platform specific code - which started the
demand to have mini platform specific chunks of code in drivers/pcmcia/
and sound/.

With DT of course, all devices get instantiated from the device tree,
so there should not be any more platform specific chunks of code in
these locations (ha, it couldn't be solved with platform data so I
suspect it will continue to persist, forever unsolved.)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ