From patchwork Thu Jul 30 07:50:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris BREZILLON X-Patchwork-Id: 6899831 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EA9409F38B for ; Thu, 30 Jul 2015 07:51:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40A0520511 for ; Thu, 30 Jul 2015 07:51:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 75A4F2054A for ; Thu, 30 Jul 2015 07:51:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755006AbbG3HvI (ORCPT ); Thu, 30 Jul 2015 03:51:08 -0400 Received: from down.free-electrons.com ([37.187.137.238]:55744 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754993AbbG3HvG convert rfc822-to-8bit (ORCPT ); Thu, 30 Jul 2015 03:51:06 -0400 Received: by mail.free-electrons.com (Postfix, from userid 106) id 46BDDC7E; Thu, 30 Jul 2015 09:51:01 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from bbrezillon (AToulouse-657-1-1136-226.w92-156.abo.wanadoo.fr [92.156.162.226]) by mail.free-electrons.com (Postfix) with ESMTPSA id EA5A7A3A; Thu, 30 Jul 2015 09:50:56 +0200 (CEST) Date: Thu, 30 Jul 2015 09:50:51 +0200 From: Boris Brezillon To: Michal Suchanek Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , David Woodhouse , Brian Norris , Kukjin Kim , Krzysztof Kozlowski , Mark Brown , Padmavathi Venna , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-spi@vger.kernel.org Subject: Re: [RFC PATCH 2/2] dt: spi: s3c64xx: add compatible to controller-data Message-ID: <20150730095051.06eff8b1@bbrezillon> In-Reply-To: <557c1962448393b2a8736f26bfa2a3a5ba4aeb7a.1438170519.git.hramrach@gmail.com> References: <557c1962448393b2a8736f26bfa2a3a5ba4aeb7a.1438170519.git.hramrach@gmail.com> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Michal, On Wed, 29 Jul 2015 12:19:57 +0200 Michal Suchanek 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 > --- > 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 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 --- 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;