From patchwork Fri Sep 20 15:28:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 1165271 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="ccLKicmI"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Zd3X49J7z9s00 for ; Sat, 21 Sep 2019 01:31:20 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id F1A3CC21DF9; Fri, 20 Sep 2019 15:29:54 +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 60F7BC21E42; Fri, 20 Sep 2019 15:29:23 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4F666C21E34; Fri, 20 Sep 2019 15:29:03 +0000 (UTC) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lists.denx.de (Postfix) with ESMTPS id 45E70C21DCA for ; Fri, 20 Sep 2019 15:29:00 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x8KFStF9012693; Fri, 20 Sep 2019 10:28:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1568993335; bh=ARSdK1kkQXihj2yPAqmXnHpEELruEf2tBPwNOo/rZis=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ccLKicmIv5/u/HMGcw11Ayb57d7dW+KBPYHrR8Tk/RVEcitVMO5y77bwil4XaqZsE Znx5LhZWYEvL1dKrKnYTyaffpJVFwf1MrBJLwmjrw2/rCD/yUG4xCgBr1S59Vr69o2 QhWt+Rs9uQzqxvMt1ZtUkikvTzwVH4lTI6oT/YGU= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x8KFStla100590 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 20 Sep 2019 10:28:55 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 20 Sep 2019 10:28:50 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 20 Sep 2019 10:28:50 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x8KFSsn5035345; Fri, 20 Sep 2019 10:28:54 -0500 From: Jean-Jacques Hiblot To: , , Date: Fri, 20 Sep 2019 17:28:22 +0200 Message-ID: <20190920152824.18958-15-jjhiblot@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190920152824.18958-1-jjhiblot@ti.com> References: <20190920152824.18958-1-jjhiblot@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v5 14/15] include: board: provide empty stubs when the BOARD option is not selected 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Useful to avoid #ifdef throughout the code that uses the board driver API. Signed-off-by: Jean-Jacques Hiblot Reviewed-by: Simon Glass --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None include/board.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/include/board.h b/include/board.h index fd6a486702..678b652b0a 100644 --- a/include/board.h +++ b/include/board.h @@ -31,6 +31,7 @@ * to read the serial number. */ +#if CONFIG_IS_ENABLED(BOARD) struct board_ops { /** * detect() - Run the hardware info detection procedure for this @@ -174,3 +175,39 @@ int board_get(struct udevice **devp); */ int board_get_fit_loadable(struct udevice *dev, int index, const char *type, const char **strp); + +#else + +static inline int board_detect(struct udevice *dev) +{ + return -ENOSYS; +} + +static inline int board_get_bool(struct udevice *dev, int id, bool *val) +{ + return -ENOSYS; +} + +static inline int board_get_int(struct udevice *dev, int id, int *val) +{ + return -ENOSYS; +} + +static inline int board_get_str(struct udevice *dev, int id, size_t size, + char *val) +{ + return -ENOSYS; +} + +static inline int board_get(struct udevice **devp) +{ + return -ENOSYS; +} + +static inline int board_get_fit_loadable(struct udevice *dev, int index, + const char *type, const char **strp) +{ + return -ENOSYS; +} + +#endif