From patchwork Fri Nov 3 09:57:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ladislav Michl X-Patchwork-Id: 10039757 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2DA5F602D8 for ; Fri, 3 Nov 2017 09:57:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3601129580 for ; Fri, 3 Nov 2017 09:57:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AB1E2958A; Fri, 3 Nov 2017 09:57:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A733329580 for ; Fri, 3 Nov 2017 09:57:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754185AbdKCJ5K (ORCPT ); Fri, 3 Nov 2017 05:57:10 -0400 Received: from eddie.linux-mips.org ([148.251.95.138]:53586 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752211AbdKCJ5J (ORCPT ); Fri, 3 Nov 2017 05:57:09 -0400 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23990437AbdKCJ5ImCMV6 (ORCPT ); Fri, 3 Nov 2017 10:57:08 +0100 Date: Fri, 3 Nov 2017 10:57:06 +0100 From: Ladislav Michl To: linux-omap@vger.kernel.org Cc: Roger Quadros , Tony Lindgren Subject: [PATCH] memory: omap-gpmc: Make 'bank-width' property optional Message-ID: <20171103095706.ws5itsccxe6pwv7d@lenoch> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Value of device_width is previously read from documented 'gpmc,device-width' property. For now leave 'bank-width' as a fallback for older DT blobs. Signed-off-by: Ladislav Michl --- drivers/memory/omap-gpmc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 24b584b74d84..3dc9706e1f15 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -2152,10 +2152,15 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, gpmc_configure(GPMC_CONFIG_WP, 0); gpmc_s.device_nand = true; } else { + /* + * Some older DT blobs are missing device-width property, + * so try to read bank-width and fail if neither works. + */ ret = of_property_read_u32(child, "bank-width", &gpmc_s.device_width); - if (ret < 0) { - dev_err(&pdev->dev, "%pOF has no 'bank-width' property\n", + if (ret < 0 && !gpmc_s.device_width) { + dev_err(&pdev->dev, + "%pOF has no 'gpmc,device-width' property\n", child); goto err; }