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, 10 May 2012 15:57:12 +0000
From:	Arnd Bergmann <arnd@...db.de>
To:	Linus Walleij <linus.walleij@...aro.org>
Cc:	Stephen Warren <swarren@...dotorg.org>,
	Linus Walleij <linus.walleij@...ricsson.com>,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	Stephen Warren <swarren@...dia.com>,
	Shawn Guo <shawn.guo@...escale.com>,
	Thomas Abraham <thomas.abraham@...aro.org>,
	Dong Aisheng <dong.aisheng@...aro.org>,
	Rajendra Nayak <rajendra.nayak@...aro.org>,
	Haojian Zhuang <haojian.zhuang@...vell.com>
Subject: Re: [PATCH 02/12] pinctrl: basic Nomadik pinctrl interface

On Thursday 10 May 2012, Arnd Bergmann wrote:
> > >
> > > Arnd, what is your preferred design pattern of:
> > >
> > > A) sub-drivers that register one struct platform_driver per
> > >  variant, then calls into a shared core driver, or
> > >
> > > B) a shared core driver registering one platform_driver
> > >  with several struct platform_device_id that then call
> > >  sub-drivers depending on which one is found
> > >
> > > Either way is actually OK for me, but I was thinking if one
> > > is preferred over the other.
> 
> Out of those two, I'd always pick B.
> 
> In cases where the variants are different enough that you want to
> put them into separate files, I'd do
> 
> C) Make the common code one module that just exports symbols but
> registers no platform_driver at all, then put each variant into
> its own module that binds to one ID and calls the exported
> functions from the common module.
> 

Sorry, I guess A and C are actually the same and I just misread the
question.

So I'd use A for things that are different enough to put them
into separate files, and B for things where I'd always build
all variants in the same driver module anyway, e.g. when only
a few parameters are different.

	Arnd
--
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