From patchwork Mon Sep 26 11:45:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 77018 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp1129088qgf; Mon, 26 Sep 2016 04:44:22 -0700 (PDT) X-Received: by 10.28.51.21 with SMTP id z21mr13154779wmz.24.1474890262355; Mon, 26 Sep 2016 04:44:22 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id aw3si19084797wjc.212.2016.09.26.04.44.22; Mon, 26 Sep 2016 04:44:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 017E1A7597; Mon, 26 Sep 2016 13:44:19 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1gDuZ8eLNaW6; Mon, 26 Sep 2016 13:44:18 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D9A3EA75F3; Mon, 26 Sep 2016 13:44:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B16B4A758E for ; Mon, 26 Sep 2016 13:44:09 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id af_-lm21vxSI for ; Mon, 26 Sep 2016 13:44:09 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-07.nifty.com (conuserg-07.nifty.com [210.131.2.74]) by theia.denx.de (Postfix) with ESMTPS id E0BEFA7576 for ; Mon, 26 Sep 2016 13:44:08 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id u8QBhEa4019599; Mon, 26 Sep 2016 20:43:18 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com u8QBhEa4019599 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1474890198; bh=CVZRS90CgvXch0NY4RgrZTQK3ML7EfEHulXzeVPoLqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jh+y7CW9+S3ixdkThfNRtB4Z+sTltHIWzjrDCVoj/duPRU6UZSp9fKd0Z6eP3Sdjo yZWfVY8LCoLARRYbrOX7Oxb9mfJsIG+2kJ69NG6HliT6XeTDnITFBAs42bBmBTn73u Qr8l7tXhDvXrpSvMAFbCKGui781vXSmtK/IQ/nzGIjNWs7CABnT2yktCLFVVAijD9I /2n9S9zfSBoryP5H/riBVpp5CoxVfgElxqIW7wMEmDSJxIJuA63qx+Oou+yuQDKhVl 83CpfU7jNlL0gUx/Os4Nt1cSP2ePqaiHCxG+Q+sCPlq4hZi8LXUqEdN9R5NUVzUJvn qmCJisNQgafyA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 26 Sep 2016 20:45:27 +0900 Message-Id: <1474890327-478-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1474890327-478-1-git-send-email-yamada.masahiro@socionext.com> References: <1474890327-478-1-git-send-email-yamada.masahiro@socionext.com> Cc: Marek Vasut , Tom Rini , Stephen Warren , Michal Simek Subject: [U-Boot] [PATCH 3/3] Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" This reverts commit 82f5279b0cd99a9163d34cfe926d0316d9dc0d37. The build failure of k2*evm boards was fixed in a different way by the previous commit. It is nasty to patch generic drivers around with #ifdef CONFIG_CLK just for the KeyStone's matter. Signed-off-by: Masahiro Yamada --- drivers/serial/ns16550.c | 7 ++----- include/clk.h | 25 +++++++++++++------------ 2 files changed, 15 insertions(+), 17 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 765499d..3f6ea4d 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -13,7 +13,6 @@ #include #include #include -#include #include DECLARE_GLOBAL_DATA_PTR; @@ -354,8 +353,8 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev) { struct ns16550_platdata *plat = dev->platdata; fdt_addr_t addr; - __maybe_unused struct clk clk; - __maybe_unused int err; + struct clk clk; + int err; /* try Processor Local Bus device first */ addr = dev_get_addr(dev); @@ -402,7 +401,6 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev) plat->reg_shift = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "reg-shift", 0); -#ifdef CONFIG_CLK err = clk_get_by_index(dev, 0, &clk); if (!err) { err = clk_get_rate(&clk); @@ -412,7 +410,6 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev) debug("ns16550 failed to get clock\n"); return err; } -#endif if (!plat->clock) plat->clock = fdtdec_get_int(gd->fdt_blob, dev->of_offset, diff --git a/include/clk.h b/include/clk.h index fe1f892..5a5c2ff 100644 --- a/include/clk.h +++ b/include/clk.h @@ -98,6 +98,19 @@ int clk_get_by_index(struct udevice *dev, int index, struct clk *clk); * @return 0 if OK, or a negative error code. */ int clk_get_by_name(struct udevice *dev, const char *name, struct clk *clk); +#else +static inline int clk_get_by_index(struct udevice *dev, int index, + struct clk *clk) +{ + return -ENOSYS; +} + +static inline int clk_get_by_name(struct udevice *dev, const char *name, + struct clk *clk) +{ + return -ENOSYS; +} +#endif /** * clk_request - Request a clock by provider-specific ID. @@ -162,17 +175,5 @@ int clk_enable(struct clk *clk); int clk_disable(struct clk *clk); int soc_clk_dump(void); -#else -static inline int clk_get_by_index(struct udevice *dev, int index, - struct clk *clk) -{ - return -ENOSYS; -} -static inline int clk_get_by_name(struct udevice *dev, const char *name, - struct clk *clk) -{ - return -ENOSYS; -} -#endif #endif