From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZzrUD-00040g-Jg for barebox@lists.infradead.org; Fri, 20 Nov 2015 19:36:53 +0000 Received: by wmec201 with SMTP id c201so86267116wme.0 for ; Fri, 20 Nov 2015 11:36:24 -0800 (PST) From: Sebastian Hesselbarth Date: Fri, 20 Nov 2015 20:36:02 +0100 Message-Id: <1448048172-10080-10-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <1448048172-10080-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1448048172-10080-1-git-send-email-sebastian.hesselbarth@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v2 09/19] mtd: nand_mrvl_nfc: Protect mrvl_nand_probe_dt To: Sebastian Hesselbarth , barebox@lists.infradead.org Cc: Thomas Petazzoni , Ezequiel Garcia Parsing DT nodes if CONFIG_OFTREE isn't enabled is pointless, also we should prefer potential platform_data passed earlier. Protect mrvl_nand_probe_dt by bailing out early if either CONFIG_OFTREE is not enabled or dev's platform_data is non-NULL. Signed-off-by: Sebastian Hesselbarth Tested-by: Robert Jarzmik --- drivers/mtd/nand/nand_mrvl_nfc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mtd/nand/nand_mrvl_nfc.c b/drivers/mtd/nand/nand_mrvl_nfc.c index ac530fc62499..95abd4ddf243 100644 --- a/drivers/mtd/nand/nand_mrvl_nfc.c +++ b/drivers/mtd/nand/nand_mrvl_nfc.c @@ -983,6 +983,9 @@ static int mrvl_nand_probe_dt(struct mrvl_nand_host *host) { struct device_node *np = host->dev->device_node; + if (!IS_ENABLED(CONFIG_OFTREE) || host->dev->platform_data) + return 0; + if (of_get_property(np, "marvell,nand-keep-config", NULL)) host->keep_config = 1; of_property_read_u32(np, "num-cs", &host->cs); -- 2.1.4 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox