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]
Message-ID: <74CDBE0F657A3D45AFBB94109FB122FF17518604C3@HQMAIL01.nvidia.com>
Date:	Fri, 9 Dec 2011 08:49:01 -0800
From:	Stephen Warren <swarren@...dia.com>
To:	Dong Aisheng <dongas86@...il.com>
CC:	Shawn Guo <shawn.guo@...escale.com>,
	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>,
	Linus Walleij <linus.walleij@...aro.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"kernel@...gutronix.de" <kernel@...gutronix.de>
Subject: RE: [PATCH] [RFC] pinctrl: add a driver for Energy Micro's efm32
 SoCs

Dong Aisheng wrote at Friday, December 09, 2011 8:03 AM:
...
> I agree that parsing data from device tree increases much effort
> because we can not using any help functions like microes in dts file and we have
> to construct the structure we need in driver by parsing that data.
> And it will increase dtsi file's size a lot when after adding all functions.
> 
> I wonder if we can define that data as a pdata in a .c file and only
> get a pointer from dts file. That would make life much easier.

You can't get pointers themselves directly from a .dts file, since the
.dts file author has no idea what the memory layout (or even which OS)
is present on the running system.

An alternative is to key off the compatible flag in the device tree,
and use that to index a table that points at the various structures you
want pointers to.

struct of_device_id's .data field, and the function of_match_device()
are for exactly that purpose; see the way the Tegra pinctrl driver that
I posted uses them for an example of mapping compatible flag to per-
SoC initialization function pointers.

-- 
nvpublic

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