From patchwork Tue Nov 21 17:38:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 119387 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5580910qgn; Tue, 21 Nov 2017 09:52:26 -0800 (PST) X-Google-Smtp-Source: AGs4zMY+itTi1o6L81Twv2DxcDqZSaRnq4NfO7+x6FDXl6sY2oAxYSyFwLYTfKk6Kk72+LhT4F+I X-Received: by 10.80.165.139 with SMTP id a11mr26230044edc.95.1511286745980; Tue, 21 Nov 2017 09:52:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511286745; cv=none; d=google.com; s=arc-20160816; b=kKgafq9EdqkRSt2SL341gzVmaHGXiWor96S8zPRRmO/I5r1E2Wj3Wv6eb5tGlcZvRI diEuCuketgLOw87iworwRL3GFJrKZvgI8x1/4+iKAXrjfFF6Xcm2ea2jHyR727je3sUx hRnLByUChzo+V/PDppNRi5rOctzGjl6fYjg8MuQxK2Zh/GVuy+lO0UmJbBFC80ZMBBU5 Jmml2CBnE93CoGEYNFNZoTloms6LHoC5nMcUgpXqgVn/khyf7Cew8ncdFbTaxD9YW3t+ HB6goEF084ld/mb3yHVUQhyNDXaPJ6lXv5wgtU1QNquFA+NJ+P1vZ7jmLkmhvWDANCnp dSgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=xHNPWvYUhCPnm25/PWJ+3zeQZFv+L5wLxBfn4f5CgYA=; b=HgztXfk9AdyPwv/RArd8bpstJpzkXdSQffvrZxCiE4xLDecDalnJKffEs34MAB/tXD rWn5lREgo8Hn1N1nUxQ0XDZajJPZpnJazWJPxvwPuLLwsSSLnRfE9MA+qCvsLK4/T+I4 0uCSOZkOd+jrlfutbS1lFtrsohNZ/NyQEa8K7vDOg3EFnU5gSP9KFNyNZqG37lQuLoC2 qlJ+2LF2TAoj8FJRULsz8/0Ei7qc1zyeL5hamz2uZ/erOrXiDQjDrLrR07m5iLZS3jsR csOJo+YiMxEODDyEJejrBnf47mA0FBi+qeD/0dxu/TLHQ+4pwqjQ3EDYm7hUab56Ht23 SWuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=D8GQ8uyU; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id o91si718408eda.419.2017.11.21.09.52.25; Tue, 21 Nov 2017 09:52:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=D8GQ8uyU; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 68669C21F00; Tue, 21 Nov 2017 17:51:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7F680C2200C; Tue, 21 Nov 2017 17:39:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7602BC21FEB; Tue, 21 Nov 2017 17:39:07 +0000 (UTC) Received: from conuserg-07.nifty.com (conuserg-07.nifty.com [210.131.2.74]) by lists.denx.de (Postfix) with ESMTPS id 13C0DC21F29 for ; Tue, 21 Nov 2017 17:39:03 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-07.nifty.com with ESMTP id vALHcbtq001225; Wed, 22 Nov 2017 02:38:39 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com vALHcbtq001225 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1511285919; bh=2dIG2K0q2qCvcGPfoBZB1Qq5lQbd5GXjDndB8bOdyuI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D8GQ8uyUOSXV08gDTA/AqObCsDPOg2ldybpGKgMRXErkPDixiqwMJ8H4GJGOxjdSw oQaT4wG1PyCbArVoCMkZtJmFou/81LsmNmSbYqm3FGJxR81rAYApLyOfHUvdEuHFDD lG6ONnSe9gNLC40UsEd01GkNLyxRisgqWVXAVHZ/AAhtlCrc1eee9F6rU9zZJ3Jara aEX3nHd9lAYkaaOG32DIHnlSC6OGmJHWOylgx4f8/6KYmUGZwNFfnF8QnSat7DAG2k /Ybaw2s7/TZKLh7dgC+1ZQKiBCayHDUsaqHfLMzwYtpe5U9tH4mI8BKXNOHdEiTQ/d Z9d4QFpEreIQQ== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 22 Nov 2017 02:38:12 +0900 Message-Id: <1511285912-12452-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511285912-12452-1-git-send-email-yamada.masahiro@socionext.com> References: <1511285912-12452-1-git-send-email-yamada.masahiro@socionext.com> Cc: Scott Wood Subject: [U-Boot] [PATCH 02/22] mtd: nand: add onfi_* stubs in case ONFI_DETECTION is disabled X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add stubs to the header in case CONFIG_SYS_NAND_ONFI_DETECTION is disabled. This is much easier than adding around #ifdef to the caller side. Also, I removed the #ifdef around onfi_params. In Linux, onfi_params and jedec_params are unified as union. It will be the right thing to do. Signed-off-by: Masahiro Yamada --- include/linux/mtd/nand.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index d55807b..cba6563 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -741,9 +741,7 @@ struct nand_chip { int onfi_version; int jedec_version; -#ifdef CONFIG_SYS_NAND_ONFI_DETECTION struct nand_onfi_params onfi_params; -#endif struct nand_jedec_params jedec_params; int read_retries; @@ -1001,6 +999,21 @@ static inline int onfi_get_sync_timing_mode(struct nand_chip *chip) return ONFI_TIMING_MODE_UNKNOWN; return le16_to_cpu(chip->onfi_params.src_sync_timing_mode); } +#else +static inline int onfi_feature(struct nand_chip *chip) +{ + return 0; +} + +static inline int onfi_get_async_timing_mode(struct nand_chip *chip) +{ + return ONFI_TIMING_MODE_UNKNOWN; +} + +static inline int onfi_get_sync_timing_mode(struct nand_chip *chip) +{ + return ONFI_TIMING_MODE_UNKNOWN; +} #endif /*