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-next>] [day] [month] [year] [list]
Message-ID: <20150730095051.06eff8b1@bbrezillon>
Date:	Thu, 30 Jul 2015 09:50:51 +0200
From:	Boris Brezillon <boris.brezillon@...e-electrons.com>
To:	Michal Suchanek <hramrach@...il.com>
Cc:	Rob Herring <robh+dt@...nel.org>, Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	David Woodhouse <dwmw2@...radead.org>,
	Brian Norris <computersforpeace@...il.com>,
	Kukjin Kim <kgene@...nel.org>,
	Krzysztof Kozlowski <k.kozlowski@...sung.com>,
	Mark Brown <broonie@...nel.org>,
	Padmavathi Venna <padma.kvr@...il.com>,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-mtd@...ts.infradead.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-samsung-soc@...r.kernel.org, linux-spi@...r.kernel.org
Subject: Re: [RFC PATCH 2/2] dt: spi: s3c64xx: add compatible to
 controller-data

Hi Michal,

On Wed, 29 Jul 2015 12:19:57 +0200
Michal Suchanek <hramrach@...il.com> wrote:

> The controller-data subnode has no compatible. This can lead to other
> drivers getting confused by it. Add a compatible to make devicetreee
> unambiguous.
> 
> Signed-off-by: Michal Suchanek <hramrach@...il.com>
> ---
>  Documentation/devicetree/bindings/spi/spi-samsung.txt | 3 +++
>  drivers/spi/spi-s3c64xx.c                             | 4 ++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/spi/spi-samsung.txt b/Documentation/devicetree/bindings/spi/spi-samsung.txt
> index 6dbdeb3..b1e98d1 100644
> --- a/Documentation/devicetree/bindings/spi/spi-samsung.txt
> +++ b/Documentation/devicetree/bindings/spi/spi-samsung.txt
> @@ -92,16 +92,19 @@ Example:
>  			spi-max-frequency = <10000>;
>  
>  			controller-data {
> +				compatible = "samsung,s3c-controller-data";

AFAIK compatible should (as much as possible :-)) only be used to encode
HW type, and here you're using it to expose what you want to do with
your data in Linux.

>  				samsung,spi-feedback-delay = <0>;
>  			};
>  
>  			partition@0 {
> +				compatible = "linux,ofpart-partition";

Ditto.

Since you have to patch your DTs anyway, how about putting your
partitions in a subnode and patch the ofpart code to parse this subnode
if it is present (see the following patch).

Best Regards,

Boris

--- >8 ---

>From e342860932bda3a6354a0a6e17540db5c85a14e0 Mon Sep 17 00:00:00 2001
From: Boris Brezillon <boris.brezillon@...e-electrons.com>
Date: Thu, 30 Jul 2015 09:44:07 +0200
Subject: [PATCH] mtd: ofpart: search for a partitions node

The DT partition parser currently assumes the parition definitions are
directly stored in the MTD device node, but sometime this device node
contains other child nodes used to store device specific information.

Search for a partitions subnode containing the partition definitions,
if it is not there, parse the definitions in the device node.

Signed-off-by: Boris Brezillon <boris.brezillon@...e-electrons.com>
---
 drivers/mtd/ofpart.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index 8a06cfb..ba52b88 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -38,7 +38,10 @@ static int parse_ofpart_partitions(struct mtd_info *master,
 	if (!data)
 		return 0;
 
-	node = data->of_node;
+	node = of_get_child_by_name(data->of_node, "partitions");
+	if (!node)
+		node = data->of_node;
+
 	if (!node)
 		return 0;
 
-- 
1.9.1
--
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