From patchwork Sat Sep 16 05:10:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 112780 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1391854qgf; Fri, 15 Sep 2017 22:14:57 -0700 (PDT) X-Google-Smtp-Source: AOwi7QA2ANS/Qh1V1JAvtJhex9LTJ7dGvkfFktPxSbbql7s4SVVvUJEt5YSc+LGMPFbney8NpUao X-Received: by 10.80.215.206 with SMTP id m14mr9485044edj.81.1505538897071; Fri, 15 Sep 2017 22:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505538897; cv=none; d=google.com; s=arc-20160816; b=w5IMDyrR5S5zM+68Xu06fnfdt9bBONvz+Dj4oobjOV7hj1NY1LPadtLzVtlIAnFA6B Litxlo26FRvHrB9tA8RsoACzGC9BxMro9BCD5vl0+tJJSXBuw6mlnFTtODxt/Ue5ykoQ iO+bRKpcJjVjWRepIM5dANT8abac+jzdN9pEUd82N8J8TMe1/gSG7OuLnzynfTObf0Ua S1mCLU41RhGjIWKrLp+8f4kj2FxwMBQeRHH0WHq5aN09E0jrrvTFdyefoBaF6L4WFeH9 MXAGjJ85rj49SzhHJzjIawFpY9AHEXekaubQaIHl2gXn4EauWUqz+hGYm6CrYG0sIzV9 N2Rg== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=oQr7EVx5xYr/89dXTtNGKbctpCaZ0kh8S9swxvM2EbQ=; b=lZymiMhxICQIQsmS807YdaAhgTqt1GPbzg80phcMw/jRUrlBopWIHxuLCOxp6R9P3W ibHgpj128vOMlB1K2LrSrWm27I0LZjvRPV3VVH029+JALpotKJ6JUzbok3iF99ltD9B1 bnJwnxqY5WfW6zEbWjSRAj8kQsdL7ZvEpVGe3o/zXVRyRWUOXjxOZc++cXhvxXnWDfV+ yjxdfvLfPPuaoh4eyLTYVqlgkNsFp7A1VjhMZStk1lFa88CebPWuu6XUG8twy/yVW7Om M5pGdYmSa1rNKPlkPyNdVZzxLpXwh5QuOuUcI7b4zEpxhSiBdmQiAOQD4CcMCrZ4FXtm J+JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=VTbcDm97; 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 m35si2796107ede.503.2017.09.15.22.14.56; Fri, 15 Sep 2017 22:14:57 -0700 (PDT) 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=VTbcDm97; 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 B0C68C21F7E; Sat, 16 Sep 2017 05:12:10 +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 1FC9FC21FAB; Sat, 16 Sep 2017 05:11:22 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A9682C21C41; Sat, 16 Sep 2017 05:11:18 +0000 (UTC) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lists.denx.de (Postfix) with ESMTPS id B1285C21C41 for ; Sat, 16 Sep 2017 05:11:16 +0000 (UTC) Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-09.nifty.com with ESMTP id v8G5Asol028761; Sat, 16 Sep 2017 14:10:56 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v8G5Asol028761 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1505538656; bh=NAljXx8AcMwU5sS5IUYklvz41UUUv7VYi0m5AmnP74k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VTbcDm97Uw/SoW9eWaCk0US6RQbubGq5JyJj0hxP4FYCJiZG8bkUDN8ZvNZIiCWmI No85BgKvHCZ+gZ9f3ml06JUaSmlRGH0qTBXLOfDrt0vLI8FndBKqRWL9ncOi1muCwv th5fZKgaN4qoEmrNn+iEVwQL53D5YWomWb1m6F/YM6aZNmwDyJ0lLbHUC+0m1QdXMd aa/Ayc+BjjQvYpL1+YsXdDwTSMyTF3qAwC6f7JFFJDDNEYB9z9v2ZyfnoV82kR3cR5 2An9UzOSGzJZgyyeQkHnYhYLOyUzXEhdFnPKqE2lZIdXPR2UhS34NbCJ3GJA/2exIa B6kjbRf64BEsA== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 16 Sep 2017 14:10:39 +0900 Message-Id: <1505538646-19191-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> References: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH v2 1/8] stdio.h: move printf() stuff from to 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" pulls in a lot of headers. Including it from every .c file is a bad idea. We need to remove contents until it contains nothing. Move printf() and friends to . Signed-off-by: Masahiro Yamada --- Changes in v2: - newly added include/common.h | 41 +-------------------------------------- include/stdio.h | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 40 deletions(-) create mode 100644 include/stdio.h diff --git a/include/common.h b/include/common.h index aaed13167123..5e841947c17f 100644 --- a/include/common.h +++ b/include/common.h @@ -29,6 +29,7 @@ typedef volatile unsigned char vu_char; #include #include #include +#include #include #include @@ -699,46 +700,6 @@ unsigned int rand_r(unsigned int *seedp); /* serial stuff */ int serial_printf (const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))); -/* stdin */ -int getc(void); -int tstc(void); - -/* stdout */ -#if !defined(CONFIG_SPL_BUILD) || \ - (defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_SERIAL_SUPPORT)) || \ - (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) && \ - defined(CONFIG_SPL_SERIAL_SUPPORT)) -void putc(const char c); -void puts(const char *s); -int printf(const char *fmt, ...) - __attribute__ ((format (__printf__, 1, 2))); -int vprintf(const char *fmt, va_list args); -#else -#define putc(...) do { } while (0) -#define puts(...) do { } while (0) -#define printf(...) do { } while (0) -#define vprintf(...) do { } while (0) -#endif - -/* stderr */ -#define eputc(c) fputc(stderr, c) -#define eputs(s) fputs(stderr, s) -#define eprintf(fmt,args...) fprintf(stderr,fmt ,##args) - -/* - * FILE based functions (can only be used AFTER relocation!) - */ -#define stdin 0 -#define stdout 1 -#define stderr 2 -#define MAX_FILES 3 - -int fprintf(int file, const char *fmt, ...) - __attribute__ ((format (__printf__, 2, 3))); -void fputs(int file, const char *s); -void fputc(int file, const char c); -int ftstc(int file); -int fgetc(int file); /* lib/gzip.c */ int gzip(void *dst, unsigned long *lenp, diff --git a/include/stdio.h b/include/stdio.h new file mode 100644 index 000000000000..aedf3744525e --- /dev/null +++ b/include/stdio.h @@ -0,0 +1,59 @@ +#ifndef __STDIO_H +#define __STDIO_H + +#include +#include + +/* stdin */ +int getc(void); +int tstc(void); + +/* stdout */ +#if !defined(CONFIG_SPL_BUILD) || \ + (defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_SERIAL_SUPPORT)) || \ + (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) && \ + defined(CONFIG_SPL_SERIAL_SUPPORT)) +void putc(const char c); +void puts(const char *s); +int __printf(1, 2) printf(const char *fmt, ...); +int vprintf(const char *fmt, va_list args); +#else +static inline void putc(const char c) +{ +} + +static inline void puts(const char *s) +{ +} + +static inline int __printf(1, 2) printf(const char *fmt, ...) +{ + return 0; +} + +static inline int vprintf(const char *fmt, va_list args) +{ + return 0; +} +#endif + +/* + * FILE based functions (can only be used AFTER relocation!) + */ +#define stdin 0 +#define stdout 1 +#define stderr 2 +#define MAX_FILES 3 + +/* stderr */ +#define eputc(c) fputc(stderr, c) +#define eputs(s) fputs(stderr, s) +#define eprintf(fmt, args...) fprintf(stderr, fmt, ##args) + +int __printf(2, 3) fprintf(int file, const char *fmt, ...); +void fputs(int file, const char *s); +void fputc(int file, const char c); +int ftstc(int file); +int fgetc(int file); + +#endif /* __STDIO_H */ From patchwork Sat Sep 16 05:10:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 112778 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1391275qgf; Fri, 15 Sep 2017 22:13:56 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7jmLG6tVYctP4gdSIR9JZeSB4VsWEyISsgXzt2xj/Bwv017tZ4EF6fO5nFzfuDtFoCXCyo X-Received: by 10.80.166.209 with SMTP id f17mr14423002edc.278.1505538836044; Fri, 15 Sep 2017 22:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505538836; cv=none; d=google.com; s=arc-20160816; b=CtlW5R7H/dshYrTeYRc6I00zbfvi8eST/3c4MPNI66S4/xl8c1+59pAwe3Va8uyfzz qyHpVl+GGuDwqpDfyLc2fkjfAyNTVoS/2xqvz9WopSuMPuwkegrkvkNWTUdgdRcVNCxO UWAxOXo7/7MkbmVkOxjLuq6Vrn/ZVh7oeFsy0HFXda/qR3c2MNjzKOPghldiiv57oqc2 EZYHIKenHNQwfUAed0Tze+FVprmhSIF+gVlM64pcg9sKwB7iPzuc/OpNB5Cr5UlFf8zE y0zkpgZURTTKMdyaYPYJtdA9LD9eDEahwNm2nZUt2yLBS/mA8a0/0VN1BJL33Is158K0 Xc0w== 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=Hj5bdoQFHpBODjWc7+JnkqAfTy3qRVzddepcAZmjky4=; b=P2ALbxTTbsAPsGDEHZ8euk5EYQAgGbrGXmhCrQasChdiuhdRFaf9FQONJ+hi2+73el uKwu+6D/60A/2JGl0zKHSmg7GQ8O8a0b2RdImitkEsJ03wARWulKv9FHPhqC7FBbksCp FdiDpWm10cFCfMuwDpM5T3MHm+rLf/+FXVKucKT1qWVwIHfBHzZ2hTR5vU9sztKVSG3J jZ+nJmcQEVhKTNAi92BF+ody6S6ZECMsU9VUwxFcmaWeVXosMZ2l0EQX7TWngoYtXjG0 Ua4B7z9qAzPr+2w8V5UbdYIM/bZAeiMNeDPHb5Xy8IqsQwWfPqjSyzh1e+xqqkQ79253 ZzOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=G/O1F0xk; 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 k92si2731199edc.373.2017.09.15.22.13.55; Fri, 15 Sep 2017 22:13:56 -0700 (PDT) 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=G/O1F0xk; 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 95223C21C93; Sat, 16 Sep 2017 05:13:08 +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 3C01DC21F9D; Sat, 16 Sep 2017 05:11:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 45B21C21F2A; Sat, 16 Sep 2017 05:11:29 +0000 (UTC) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lists.denx.de (Postfix) with ESMTPS id 2C672C21FE9 for ; Sat, 16 Sep 2017 05:11:24 +0000 (UTC) Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-09.nifty.com with ESMTP id v8G5Asom028761; Sat, 16 Sep 2017 14:10:56 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v8G5Asom028761 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1505538656; bh=xTUZhBO8DdgW2aSnm4iMEDhbBwobR3k6fdMMnchE3fQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G/O1F0xkYtj70f6Vpc7VjGBU54WrKZ5EXEHOsjWUOyXXyoIn1qae9KGNC7czCTGlb HKDrNaCPVYmFa+kbcsuxN12shmOTfo4HtLkpJItNn4Ds8ts0JC2HrJ5zUekgxyrUGg i+XlEfet1agcdKcer+Du4Ip4sq/j9mHsNzr9pe0dscmJlJztSaRe2OtbhQGPJQ8iHV rZlJYpQ/9wKZxp4AAh2AS8sogSThdPkShH6MFySqEM3M6sU2lT/Q7zUrA0A15fv42m AJgI3SuPzmHUpHBY5JS/krHDc1AqQ8RO53DKk4guU52dDWKHjGeZ1ISmjGO6wuKf4Y b3N1MhLyoInHA== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 16 Sep 2017 14:10:40 +0900 Message-Id: <1505538646-19191-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> References: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> Cc: Marek Vasut , Albert Aribaud , Stefan Agner , Peter Howard Subject: [U-Boot] [PATCH v2 2/8] printk: collect printk stuff into with loglevel support 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" When we import code from Linux, with regular re-sync planned, we want to use printk() and pr_*(). U-Boot does not support them in a clean way. So, people end up with local macros, or compat headers here and there, then we occasionally see build errors of definition conflicts. We have include/linux/compat.h, but putting all sorts of unrelated things into a single header is just a temporal workaround. Hence this patch, to find the best home for all printk variants. If you want to use printk() and friends, please include . This header is self-contained, and pulls in only a few headers. When I was testing this clean-up, I noticed the image size exceeded its platform limit on some boards. This is because all pr_*() that were previously defined as no-op in include/linux/mtd/mtd.h (unless CONFIG_MTD_DEBUG is set), are now enabled. To make such boards happy, this commit also implements CONFIG_LOGLEVEL. The concept is similar to the kernel parameter "loglevel". (Actually, the Kconfig help message was taken from kernel-paremeter.txt of Linux) Messages with a loglevel smaller than console loglevel will be printed. The difference is the loglevel is build-time determined. To save the image size, lower priority pr_*() are compiled out. I set the default of CONFIG_LOGLEVEL to 6, i.e. pr_notice and higher priority messages are compiled in. I adjusted CONFIG_LOGLEVEL to avoid build error for some boards. Signed-off-by: Masahiro Yamada --- Changes in v2: - Add CONFIG_LOGLEVEL to adjust image size for some boards arch/arm/mach-uniphier/dram_init.c | 3 - arch/arm/mach-uniphier/init.h | 5 -- common/Kconfig | 17 ++++++ configs/axm_defconfig | 1 + configs/colibri_vf_defconfig | 1 + configs/corvus_defconfig | 1 + configs/omapl138_lcdk_defconfig | 1 + configs/openrd_base_defconfig | 1 + configs/openrd_client_defconfig | 1 + configs/openrd_ultimate_defconfig | 1 + configs/taurus_defconfig | 1 + configs/vf610twr_defconfig | 1 + configs/vf610twr_nand_defconfig | 1 + drivers/bios_emulator/include/x86emu/x86emui.h | 3 - drivers/usb/dwc3/linux-compat.h | 1 - drivers/usb/musb-new/linux-compat.h | 2 - include/common.h | 6 +- include/linux/compat.h | 11 ---- include/linux/mtd/mtd.h | 10 +--- include/linux/printk.h | 79 ++++++++++++++++++++++++++ 20 files changed, 108 insertions(+), 39 deletions(-) create mode 100644 include/linux/printk.h diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c index 32d359321ae2..22136855fa1a 100644 --- a/arch/arm/mach-uniphier/dram_init.c +++ b/arch/arm/mach-uniphier/dram_init.c @@ -15,9 +15,6 @@ #include "sg-regs.h" #include "soc-info.h" -#define pr_warn(fmt, args...) printf(fmt, ##args) -#define pr_err(fmt, args...) printf(fmt, ##args) - DECLARE_GLOBAL_DATA_PTR; struct uniphier_memif_data { diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h index 29f638d94703..da209354ed50 100644 --- a/arch/arm/mach-uniphier/init.h +++ b/arch/arm/mach-uniphier/init.h @@ -104,9 +104,4 @@ int uniphier_have_internal_stm(void); int uniphier_boot_from_backend(void); int uniphier_pin_init(const char *pinconfig_name); -#undef pr_warn -#define pr_warn(fmt, args...) printf(fmt, ##args) -#undef pr_err -#define pr_err(fmt, args...) printf(fmt, ##args) - #endif /* __MACH_INIT_H */ diff --git a/common/Kconfig b/common/Kconfig index 4d8cae96109a..79fe781ba59f 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -243,6 +243,23 @@ config IDENT_STRING help This options adds the board specific name to u-boot version. +config LOGLEVEL + int "loglevel" + default 6 + range 0 8 + help + All Messages with a loglevel smaller than the console loglevel will + be compiled in. The loglevels are defined as follows: + + 0 (KERN_EMERG) system is unusable + 1 (KERN_ALERT) action must be taken immediately + 2 (KERN_CRIT) critical conditions + 3 (KERN_ERR) error conditions + 4 (KERN_WARNING) warning conditions + 5 (KERN_NOTICE) normal but significant condition + 6 (KERN_INFO) informational + 7 (KERN_DEBUG) debug-level messages + config SILENT_CONSOLE bool "Support a silent console" help diff --git a/configs/axm_defconfig b/configs/axm_defconfig index 81654b230431..cd89c2a235ff 100644 --- a/configs/axm_defconfig +++ b/configs/axm_defconfig @@ -41,3 +41,4 @@ CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_STMICRO=y CONFIG_PHYLIB=y CONFIG_USE_TINY_PRINTF=y +CONFIG_LOGLEVEL=4 diff --git a/configs/colibri_vf_defconfig b/configs/colibri_vf_defconfig index 1ffe86180974..49315d0638ed 100644 --- a/configs/colibri_vf_defconfig +++ b/configs/colibri_vf_defconfig @@ -6,6 +6,7 @@ CONFIG_TARGET_COLIBRI_VF=y CONFIG_DEFAULT_DEVICE_TREE="vf610-colibri" CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,IMX_NAND" CONFIG_BOOTDELAY=1 +CONFIG_LOGLEVEL=3 CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_ARCH_MISC_INIT=y diff --git a/configs/corvus_defconfig b/configs/corvus_defconfig index 705e00145700..059cb5992e92 100644 --- a/configs/corvus_defconfig +++ b/configs/corvus_defconfig @@ -14,6 +14,7 @@ CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9M10G45,MACH_TYPE=2066,SYS_USE_NANDFLASH" CONFIG_BOOTDELAY=3 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256k(env),256k(env_redundant),256k(spare),512k(dtb),6M(kernel)ro,-(rootfs) root=/dev/mtdblock7 rw rootfstype=jffs2" +CONFIG_LOGLEVEL=4 # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_BOARD_EARLY_INIT_F=y CONFIG_SPL=y diff --git a/configs/omapl138_lcdk_defconfig b/configs/omapl138_lcdk_defconfig index c95134bcf990..3e9eb4fa84e2 100644 --- a/configs/omapl138_lcdk_defconfig +++ b/configs/omapl138_lcdk_defconfig @@ -8,6 +8,7 @@ CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_SPL_NAND_SUPPORT=y CONFIG_BOOTDELAY=3 +CONFIG_LOGLEVEL=4 CONFIG_VERSION_VARIABLE=y # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_DISPLAY_BOARDINFO is not set diff --git a/configs/openrd_base_defconfig b/configs/openrd_base_defconfig index b2a0e04d36ce..f31af1c3fe75 100644 --- a/configs/openrd_base_defconfig +++ b/configs/openrd_base_defconfig @@ -5,6 +5,7 @@ CONFIG_TARGET_OPENRD=y CONFIG_IDENT_STRING="\nOpenRD-Base" CONFIG_SYS_EXTRA_OPTIONS="BOARD_IS_OPENRD_BASE" CONFIG_BOOTDELAY=3 +CONFIG_LOGLEVEL=3 # CONFIG_DISPLAY_BOARDINFO is not set # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set diff --git a/configs/openrd_client_defconfig b/configs/openrd_client_defconfig index 8b1d35edd10f..bee818b82cc1 100644 --- a/configs/openrd_client_defconfig +++ b/configs/openrd_client_defconfig @@ -5,6 +5,7 @@ CONFIG_TARGET_OPENRD=y CONFIG_IDENT_STRING="\nOpenRD-Client" CONFIG_SYS_EXTRA_OPTIONS="BOARD_IS_OPENRD_CLIENT" CONFIG_BOOTDELAY=3 +CONFIG_LOGLEVEL=3 # CONFIG_DISPLAY_BOARDINFO is not set # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set diff --git a/configs/openrd_ultimate_defconfig b/configs/openrd_ultimate_defconfig index 4cc0205629f6..e9462e59b2f1 100644 --- a/configs/openrd_ultimate_defconfig +++ b/configs/openrd_ultimate_defconfig @@ -5,6 +5,7 @@ CONFIG_TARGET_OPENRD=y CONFIG_IDENT_STRING="\nOpenRD-Ultimate" CONFIG_SYS_EXTRA_OPTIONS="BOARD_IS_OPENRD_ULTIMATE" CONFIG_BOOTDELAY=3 +CONFIG_LOGLEVEL=3 # CONFIG_DISPLAY_BOARDINFO is not set # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set diff --git a/configs/taurus_defconfig b/configs/taurus_defconfig index 71a382a3e132..5b7fc8ae1466 100644 --- a/configs/taurus_defconfig +++ b/configs/taurus_defconfig @@ -16,6 +16,7 @@ CONFIG_SPL_SPI_SUPPORT=y CONFIG_DEFAULT_DEVICE_TREE="at91sam9g20-taurus" CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G20,MACH_TYPE=2067,BOARD_TAURUS" CONFIG_BOOTDELAY=3 +CONFIG_LOGLEVEL=4 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256k(env),256k(env_redundant),256k(spare),512k(dtb),6M(kernel)ro,-(rootfs) root=/dev/mtdblock7 rw rootfstype=jffs2" # CONFIG_DISPLAY_BOARDINFO is not set diff --git a/configs/vf610twr_defconfig b/configs/vf610twr_defconfig index 948ea73edb91..3c277be6828f 100644 --- a/configs/vf610twr_defconfig +++ b/configs/vf610twr_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_VF610=y CONFIG_DEFAULT_DEVICE_TREE="vf610-twr" CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/vf610twr/imximage.cfg" CONFIG_BOOTDELAY=3 +CONFIG_LOGLEVEL=3 CONFIG_BOARD_EARLY_INIT_F=y CONFIG_HUSH_PARSER=y CONFIG_CMD_BOOTZ=y diff --git a/configs/vf610twr_nand_defconfig b/configs/vf610twr_nand_defconfig index 10cdf0646c98..1cd22b1b8b31 100644 --- a/configs/vf610twr_nand_defconfig +++ b/configs/vf610twr_nand_defconfig @@ -3,6 +3,7 @@ CONFIG_ARCH_VF610=y CONFIG_DEFAULT_DEVICE_TREE="vf610-twr" CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/vf610twr/imximage.cfg" CONFIG_BOOTDELAY=3 +CONFIG_LOGLEVEL=3 CONFIG_BOARD_EARLY_INIT_F=y CONFIG_HUSH_PARSER=y CONFIG_CMD_BOOTZ=y diff --git a/drivers/bios_emulator/include/x86emu/x86emui.h b/drivers/bios_emulator/include/x86emu/x86emui.h index a74957d992aa..3537255539fe 100644 --- a/drivers/bios_emulator/include/x86emu/x86emui.h +++ b/drivers/bios_emulator/include/x86emu/x86emui.h @@ -72,9 +72,6 @@ #include #endif -#define printk printf - - /*--------------------------- Inline Functions ----------------------------*/ #ifdef __cplusplus diff --git a/drivers/usb/dwc3/linux-compat.h b/drivers/usb/dwc3/linux-compat.h index 9e944a31be11..64db4ecc3c6f 100644 --- a/drivers/usb/dwc3/linux-compat.h +++ b/drivers/usb/dwc3/linux-compat.h @@ -12,7 +12,6 @@ #ifndef __DWC3_LINUX_COMPAT__ #define __DWC3_LINUX_COMPAT__ -#define pr_debug(format) debug(format) #define WARN(val, format, arg...) debug(format, ##arg) #define dev_WARN(dev, format, arg...) debug(format, ##arg) #define WARN_ON_ONCE(val) debug("Error %d\n", val) diff --git a/drivers/usb/musb-new/linux-compat.h b/drivers/usb/musb-new/linux-compat.h index 4dae83ed6850..7bb53d2b198e 100644 --- a/drivers/usb/musb-new/linux-compat.h +++ b/drivers/usb/musb-new/linux-compat.h @@ -5,8 +5,6 @@ #include #include -#define pr_debug(fmt, args...) debug(fmt, ##args) - #define WARN(condition, fmt, args...) ({ \ int ret_warn = !!condition; \ if (ret_warn) \ diff --git a/include/common.h b/include/common.h index 5e841947c17f..4eb92298a207 100644 --- a/include/common.h +++ b/include/common.h @@ -25,6 +25,7 @@ typedef volatile unsigned char vu_char; #include #include #include +#include #include #include #include @@ -55,11 +56,6 @@ typedef volatile unsigned char vu_char; #define _SPL_BUILD 0 #endif -/* Define this at the top of a file to add a prefix to debug messages */ -#ifndef pr_fmt -#define pr_fmt(fmt) fmt -#endif - /* * Output a debug text when condition "cond" is met. The "cond" should be * computed by a preprocessor in the best case, allowing for the best diff --git a/include/linux/compat.h b/include/linux/compat.h index 2336b56cf5c1..bc027adcb936 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -25,17 +25,6 @@ extern struct p_current *current; printf(fmt, ##args) #define dev_warn(dev, fmt, args...) \ printf(fmt, ##args) -#define printk printf -#define printk_once printf - -#define KERN_EMERG -#define KERN_ALERT -#define KERN_CRIT -#define KERN_ERR -#define KERN_WARNING -#define KERN_NOTICE -#define KERN_INFO -#define KERN_DEBUG #define GFP_ATOMIC ((gfp_t) 0) #define GFP_KERNEL ((gfp_t) 0) diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 1fd17c303a8d..3e1694b3a5d3 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -452,28 +452,20 @@ static inline void mtd_erase_callback(struct erase_info *instr) #define MTD_DEBUG_LEVEL3 (3) /* Noisy */ #ifdef CONFIG_MTD_DEBUG -#define pr_debug(args...) MTDDEBUG(MTD_DEBUG_LEVEL0, args) #define MTDDEBUG(n, args...) \ do { \ if (n <= CONFIG_MTD_DEBUG_VERBOSE) \ printk(KERN_INFO args); \ } while(0) #else /* CONFIG_MTD_DEBUG */ -#define pr_debug(args...) #define MTDDEBUG(n, args...) \ do { \ if (0) \ printk(KERN_INFO args); \ } while(0) #endif /* CONFIG_MTD_DEBUG */ -#define pr_info(args...) MTDDEBUG(MTD_DEBUG_LEVEL0, args) -#define pr_warn(args...) MTDDEBUG(MTD_DEBUG_LEVEL0, args) -#define pr_err(args...) MTDDEBUG(MTD_DEBUG_LEVEL0, args) -#define pr_crit(args...) MTDDEBUG(MTD_DEBUG_LEVEL0, args) -#define pr_cont(args...) MTDDEBUG(MTD_DEBUG_LEVEL0, args) -#define pr_notice(args...) MTDDEBUG(MTD_DEBUG_LEVEL0, args) #endif - + static inline int mtd_is_bitflip(int err) { return err == -EUCLEAN; } diff --git a/include/linux/printk.h b/include/linux/printk.h new file mode 100644 index 000000000000..088513ad29bb --- /dev/null +++ b/include/linux/printk.h @@ -0,0 +1,79 @@ +#ifndef __KERNEL_PRINTK__ +#define __KERNEL_PRINTK__ + +#include +#include + +#define KERN_EMERG +#define KERN_ALERT +#define KERN_CRIT +#define KERN_ERR +#define KERN_WARNING +#define KERN_NOTICE +#define KERN_INFO +#define KERN_DEBUG +#define KERN_CONT + +#define printk(fmt, ...) \ + printf(fmt, ##__VA_ARGS__) + +/* + * Dummy printk for disabled debugging statements to use whilst maintaining + * gcc's format checking. + */ +#define no_printk(fmt, ...) \ +({ \ + if (0) \ + printk(fmt, ##__VA_ARGS__); \ + 0; \ +}) + +#define __printk(level, fmt, ...) \ +({ \ + level < CONFIG_LOGLEVEL ? printk(fmt, ##__VA_ARGS__) : 0; \ +}) + +#ifndef pr_fmt +#define pr_fmt(fmt) fmt +#endif + +#define pr_emerg(fmt, ...) \ + __printk(0, pr_fmt(fmt), ##__VA_ARGS__) +#define pr_alert(fmt, ...) \ + __printk(1, pr_fmt(fmt), ##__VA_ARGS__) +#define pr_crit(fmt, ...) \ + __printk(2, pr_fmt(fmt), ##__VA_ARGS__) +#define pr_err(fmt, ...) \ + __printk(3, pr_fmt(fmt), ##__VA_ARGS__) +#define pr_warning(fmt, ...) \ + __printk(4, pr_fmt(fmt), ##__VA_ARGS__) +#define pr_warn pr_warning +#define pr_notice(fmt, ...) \ + __printk(5, pr_fmt(fmt), ##__VA_ARGS__) +#define pr_info(fmt, ...) \ + __printk(6, pr_fmt(fmt), ##__VA_ARGS__) + +#define pr_cont(fmt, ...) \ + printk(fmt, ##__VA_ARGS__) + +/* pr_devel() should produce zero code unless DEBUG is defined */ +#ifdef DEBUG +#define pr_devel(fmt, ...) \ + __printk(7, pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_devel(fmt, ...) \ + no_printk(pr_fmt(fmt), ##__VA_ARGS__) +#endif + +#ifdef DEBUG +#define pr_debug(fmt, ...) \ + __printk(7, pr_fmt(fmt), ##__VA_ARGS__) +#else +#define pr_debug(fmt, ...) \ + no_printk(pr_fmt(fmt), ##__VA_ARGS__) +#endif + +#define printk_once(fmt, ...) \ + printk(fmt, ##__VA_ARGS__) + +#endif From patchwork Sat Sep 16 05:10:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 112821 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp2098713qgf; Sat, 16 Sep 2017 14:32:16 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5fhq8pkh8slA27D91kHTded6sfTEicEyFSI5LgtYgfLCO1+aM6hgORAnRthEdrajiBSIp+ X-Received: by 10.80.182.195 with SMTP id f3mr23320393ede.127.1505597536646; Sat, 16 Sep 2017 14:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505597536; cv=none; d=google.com; s=arc-20160816; b=VaYaAMHcCO/8LUJv/1JNYZEqwfM/Njimfvn4dBRe+pJXz3nLQfLXq3M9jnGAwo9FGb W6Oh0S5zTI0o9Vn6Ik3iBYpr4YNAsbE+39YN651epE9D+yKsBK3JH/sD+z58+oqRQVuS BzEQVdIIle7P8CkoEddOEw9rAsEDtsaFjDObuiBKQOgYMnY37cA6xi4Uj1OE6++9Pmh3 A4qee/kOFDaRalh2yizxC2Br8iKauARUmi+Zv3BQX4vi4tyxO44RXRP+R8fwEsTTWqLG hVi869y74Cvl5EhVO/5uTkwRRuuBkdcLIzS+O+2iDwxTQ9DqSNBuQwCxGD5VwVWDj5EC btgA== 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=CS2bracgK9CISPNN+JwLCU2vpK3AMFMoAHrouHp1cTs=; b=zf2FE+rOMTPNW3NUxi/C2Vro7CCbq/PIo/J8HWwUD9uWk1z0T0oOTzxHYMlnruRuFC BOf8rh02UTSR1qMyAhR67LjPVwQE1J5yznr9Lsrfg9okzE2FzTmCHB8I4Dj6CBcf7Ygj JDDBVyUwTKVbdPDvEiqJQBaWcoqqyNwCGO8rYMNv9g0JXCUxTBmtYqBZXvjGa3+gAEeh hBMIrMOyXYdoUadLmfVlxfI8Z9DWWmOBFAF/qFbHhkvn28PL3qAC6AORES2BT7d+AJxM an8IzOfNWK5fOKgF6mY5bmSRSVtMRJyYqxTNQweM3zRBbMoUjLY152s1D/HLFcnnbhyu Ufiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=dtax8+rc; 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 b42si4293513edb.12.2017.09.16.14.32.16; Sat, 16 Sep 2017 14:32:16 -0700 (PDT) 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=dtax8+rc; 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 2E7F7C21E10; Sat, 16 Sep 2017 21:32:16 +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 41A9BC21D63; Sat, 16 Sep 2017 21:31:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AB784C21E10; Sat, 16 Sep 2017 05:12:07 +0000 (UTC) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lists.denx.de (Postfix) with ESMTPS id 35581C21E10 for ; Sat, 16 Sep 2017 05:11:58 +0000 (UTC) Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-09.nifty.com with ESMTP id v8G5Ason028761; Sat, 16 Sep 2017 14:10:57 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v8G5Ason028761 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1505538658; bh=+WopS2lb9PMzH9ApDHVMZHIehivGv0TUAou2fXRvguw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dtax8+rcBdCBCIiuXQemZkrAC5oNTRYeWN8464TOiQSRJy5QHJ8uoFG4GVDUVoKjW usIeHfPAkl73I7nOT47KyKwqhoVS0ceERLgQZpZXFWmgtBFfX/RdX/nleRwsOIfXtz b/9H6LjHoENhu95OwPUuhBeACQ81Kp7UKZOY40YBdzcxNH5SkogT7ih8Gai4xEXEk+ ph6ZAJ0BLQTL3WZTu2zJkjYlfgA+eJR3UI5kuW6PRBD4rMqlukwAS9tsTejCIZfrTW pDdk+MEB6d3xRBtEa8J2Z+4aVxiN2+IWakSL6LYbuLiC7PPGeRhY8/S4ayG9nbBwB0 qQmjAe5UDO9Jw== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 16 Sep 2017 14:10:41 +0900 Message-Id: <1505538646-19191-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> References: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> X-Mailman-Approved-At: Sat, 16 Sep 2017 21:31:43 +0000 Cc: Marek Vasut , Albert Aribaud , Stephen Warren , Joe Hershberger , Robert Baldyga , Scott Wood , Tom Warren , Jagan Teki Subject: [U-Boot] [PATCH v2 3/8] treewide: replace with error() with pr_err() 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" U-Boot widely uses error() as a bit noisier variant of printf(). This macro causes name conflict with the following line in include/linux/compiler-gcc.h: # define __compiletime_error(message) __attribute__((error(message))) This prevents us from using __compiletime_error(), and makes it difficult to fully sync BUILD_BUG macros with Linux. (Notice Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().) Let's convert error() into now treewide-available pr_err(). Done with the help of Coccinelle, excluing tools/ directory. The semantic patch I used is as follows: // @@@@ -error +pr_err (...) // Signed-off-by: Masahiro Yamada Reviewed-by: Simon Glass --- Changes in v2: None arch/arm/mach-omap2/am33xx/board.c | 2 +- arch/arm/mach-omap2/utils.c | 4 +- arch/arm/mach-rockchip/rk3188-board-spl.c | 2 +- arch/arm/mach-rockchip/rk3188-board.c | 2 +- arch/arm/mach-rockchip/rk3368-board-spl.c | 4 +- arch/arm/mach-rockchip/rk3399/sdram_rk3399.c | 2 +- arch/arm/mach-socfpga/reset_manager_arria10.c | 2 +- arch/arm/mach-tegra/ivc.c | 8 +-- arch/arm/mach-tegra/tegra124/xusb-padctl.c | 2 +- arch/arm/mach-tegra/tegra186/nvtboot_mem.c | 4 +- arch/arm/mach-tegra/tegra20/clock.c | 6 +- arch/arm/mach-tegra/tegra210/xusb-padctl.c | 2 +- arch/arm/mach-tegra/tegra30/clock.c | 6 +- arch/arm/mach-tegra/xusb-padctl-common.c | 22 +++---- arch/x86/cpu/tangier/sdram.c | 6 +- board/nvidia/jetson-tk1/jetson-tk1.c | 6 +- board/samsung/common/exynos5-dt.c | 2 +- board/samsung/common/misc.c | 2 +- board/samsung/goni/goni.c | 4 +- board/samsung/odroid/odroid.c | 12 ++-- cmd/fastboot.c | 2 +- cmd/nvedit.c | 6 +- cmd/regulator.c | 2 +- cmd/thordown.c | 6 +- cmd/tpm_test.c | 6 +- cmd/usb_gadget_sdp.c | 4 +- cmd/usb_mass_storage.c | 6 +- common/dfu.c | 6 +- common/fb_mmc.c | 36 +++++------ common/fb_nand.c | 12 ++-- common/spl/spl_dfu.c | 4 +- common/spl/spl_sdp.c | 4 +- common/update.c | 2 +- disk/part_efi.c | 10 +-- drivers/adc/adc-uclass.c | 6 +- drivers/adc/exynos-adc.c | 6 +- drivers/adc/sandbox.c | 6 +- drivers/ata/dwc_ahci.c | 6 +- drivers/clk/clk_boston.c | 4 +- drivers/clk/clk_stm32f7.c | 2 +- drivers/clk/rockchip/clk_rk3368.c | 8 +-- drivers/clk/rockchip/clk_rk3399.c | 6 +- drivers/clk/rockchip/clk_rv1108.c | 2 +- drivers/dfu/dfu.c | 14 ++-- drivers/dfu/dfu_mmc.c | 18 +++--- drivers/dfu/dfu_ram.c | 8 +-- drivers/dfu/dfu_tftp.c | 4 +- drivers/dma/dma-uclass.c | 2 +- drivers/dma/lpc32xx_dma.c | 8 +-- drivers/dma/ti-edma3.c | 2 +- drivers/i2c/i2c-gpio.c | 2 +- drivers/i2c/omap24xx_i2c.c | 2 +- drivers/i2c/stm32f7_i2c.c | 16 ++--- drivers/i2c/tegra_i2c.c | 4 +- drivers/misc/tegra186_bpmp.c | 28 ++++---- drivers/mmc/exynos_dw_mmc.c | 2 +- drivers/mmc/hi6220_dw_mmc.c | 2 +- drivers/mmc/xenon_sdhci.c | 4 +- drivers/mtd/nand/lpc32xx_nand_mlc.c | 6 +- drivers/mtd/nand/pxa3xx_nand.c | 2 +- drivers/net/bcm-sf2-eth-gmac.c | 14 ++-- drivers/net/bcm-sf2-eth.c | 18 +++--- drivers/net/cpsw-common.c | 8 +-- drivers/net/cpsw.c | 8 +-- drivers/net/dwc_eth_qos.c | 92 +++++++++++++-------------- drivers/net/ep93xx_eth.c | 16 ++--- drivers/net/keystone_net.c | 14 ++-- drivers/pci/pci_tegra.c | 50 +++++++-------- drivers/pci/pcie_xilinx.c | 2 +- drivers/phy/marvell/comphy_cp110.c | 40 ++++++------ drivers/phy/ti-pipe3-phy.c | 12 ++-- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 2 +- drivers/pinctrl/pinctrl-sti.c | 14 ++-- drivers/pinctrl/pinctrl_stm32.c | 2 +- drivers/power/pmic/as3722.c | 12 ++-- drivers/power/pmic/as3722_gpio.c | 10 +-- drivers/power/pmic/i2c_pmic_emul.c | 6 +- drivers/power/pmic/lp873x.c | 4 +- drivers/power/pmic/lp87565.c | 4 +- drivers/power/pmic/max77686.c | 4 +- drivers/power/pmic/max8997.c | 4 +- drivers/power/pmic/max8998.c | 4 +- drivers/power/pmic/palmas.c | 4 +- drivers/power/pmic/pfuze100.c | 4 +- drivers/power/pmic/s2mps11.c | 4 +- drivers/power/pmic/s5m8767.c | 4 +- drivers/power/pmic/sandbox.c | 6 +- drivers/power/pmic/tps65090.c | 4 +- drivers/power/regulator/fixed.c | 2 +- drivers/power/regulator/gpio-regulator.c | 2 +- drivers/power/regulator/max77686.c | 20 +++--- drivers/power/regulator/sandbox.c | 18 +++--- drivers/ram/rockchip/dmc-rk3368.c | 14 ++-- drivers/ram/stm32_sdram.c | 8 +-- drivers/reset/sti-reset.c | 10 +-- drivers/spi/atmel_spi.c | 2 +- drivers/spi/lpc32xx_ssp.c | 6 +- drivers/sysreset/sysreset_sti.c | 6 +- drivers/sysreset/sysreset_syscon.c | 4 +- drivers/sysreset/sysreset_watchdog.c | 2 +- drivers/tpm/tpm_tis_infineon.c | 2 +- drivers/usb/common/common.c | 2 +- drivers/usb/eth/mcs7830.c | 12 ++-- drivers/usb/gadget/at91_udc.c | 4 +- drivers/usb/gadget/atmel_usba_udc.c | 6 +- drivers/usb/gadget/dwc2_udc_otg.c | 2 +- drivers/usb/gadget/ether.c | 42 ++++++------ drivers/usb/gadget/f_fastboot.c | 10 +-- drivers/usb/gadget/f_sdp.c | 16 ++--- drivers/usb/gadget/f_thor.c | 26 ++++---- drivers/usb/host/dwc2.c | 2 +- drivers/usb/host/ehci-generic.c | 18 +++--- drivers/usb/host/ohci-generic.c | 18 +++--- drivers/usb/host/xhci-dwc3.c | 6 +- drivers/usb/host/xhci-rockchip.c | 12 ++-- drivers/usb/musb-new/ti-musb.c | 12 ++-- drivers/video/am335x-fb.c | 2 +- env/common.c | 8 +-- env/sf.c | 2 +- fs/jffs2/jffs2_nand_1pass.c | 2 +- fs/yaffs2/yaffs_uboot_glue.c | 2 +- 121 files changed, 521 insertions(+), 521 deletions(-) diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c index 913a44ad64b4..ae86b69b9c71 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++ b/arch/arm/mach-omap2/am33xx/board.c @@ -241,7 +241,7 @@ int arch_misc_init(void) #if defined(CONFIG_DM_ETH) && defined(CONFIG_USB_ETHER) ret = usb_ether_init(); if (ret) { - error("USB ether init failed\n"); + pr_err("USB ether init failed\n"); return ret; } #endif diff --git a/arch/arm/mach-omap2/utils.c b/arch/arm/mach-omap2/utils.c index 0b0bf1837c9c..f2fafae2a160 100644 --- a/arch/arm/mach-omap2/utils.c +++ b/arch/arm/mach-omap2/utils.c @@ -87,13 +87,13 @@ static u32 omap_mmc_get_part_size(const char *part) dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV); if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) { - error("invalid mmc device\n"); + pr_err("invalid mmc device\n"); return 0; } res = part_get_info_by_name(dev_desc, part, &info); if (res < 0) { - error("cannot find partition: '%s'\n", part); + pr_err("cannot find partition: '%s'\n", part); return 0; } diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c index d3866bf029a5..406207ed21ce 100644 --- a/arch/arm/mach-rockchip/rk3188-board-spl.c +++ b/arch/arm/mach-rockchip/rk3188-board-spl.c @@ -151,7 +151,7 @@ void board_init_f(ulong dummy) */ pmu = syscon_get_first_range(ROCKCHIP_SYSCON_PMU); if (IS_ERR(pmu)) - error("pmu syscon returned %ld\n", PTR_ERR(pmu)); + pr_err("pmu syscon returned %ld\n", PTR_ERR(pmu)); SAVE_SP_ADDR = readl(&pmu->sys_reg[2]); ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl); diff --git a/arch/arm/mach-rockchip/rk3188-board.c b/arch/arm/mach-rockchip/rk3188-board.c index 622e046dc0a7..96859a5b4bc7 100644 --- a/arch/arm/mach-rockchip/rk3188-board.c +++ b/arch/arm/mach-rockchip/rk3188-board.c @@ -26,7 +26,7 @@ int board_late_init(void) grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF); if (IS_ERR(grf)) { - error("grf syscon returned %ld\n", PTR_ERR(grf)); + pr_err("grf syscon returned %ld\n", PTR_ERR(grf)); } else { /* enable noc remap to mimic legacy loaders */ rk_clrsetreg(&grf->soc_con0, diff --git a/arch/arm/mach-rockchip/rk3368-board-spl.c b/arch/arm/mach-rockchip/rk3368-board-spl.c index cabf34448643..72d2c97d3636 100644 --- a/arch/arm/mach-rockchip/rk3368-board-spl.c +++ b/arch/arm/mach-rockchip/rk3368-board-spl.c @@ -38,13 +38,13 @@ void board_init_f(ulong dummy) /* Set up our preloader console */ ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl); if (ret) { - error("%s: pinctrl init failed: %d\n", __func__, ret); + pr_err("%s: pinctrl init failed: %d\n", __func__, ret); hang(); } ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART0); if (ret) { - error("%s: failed to set up console UART\n", __func__); + pr_err("%s: failed to set up console UART\n", __func__); hang(); } diff --git a/arch/arm/mach-rockchip/rk3399/sdram_rk3399.c b/arch/arm/mach-rockchip/rk3399/sdram_rk3399.c index 63342ab5c98a..1a441703a085 100644 --- a/arch/arm/mach-rockchip/rk3399/sdram_rk3399.c +++ b/arch/arm/mach-rockchip/rk3399/sdram_rk3399.c @@ -551,7 +551,7 @@ static int pctl_cfg(const struct chan_info *chan, u32 channel, tmp = get_timer(0); do { if (get_timer(tmp) > timeout_ms) { - error("DRAM (%s): phy failed to lock within %ld ms\n", + pr_err("DRAM (%s): phy failed to lock within %ld ms\n", __func__, timeout_ms); return -ETIME; } diff --git a/arch/arm/mach-socfpga/reset_manager_arria10.c b/arch/arm/mach-socfpga/reset_manager_arria10.c index 66f1ec21f132..ae16897494bd 100644 --- a/arch/arm/mach-socfpga/reset_manager_arria10.c +++ b/arch/arm/mach-socfpga/reset_manager_arria10.c @@ -174,7 +174,7 @@ void socfpga_emac_manage_reset(ulong emacbase, u32 state) emacmask = ALT_RSTMGR_PER0MODRST_EMAC2_SET_MSK; break; default: - error("emac base address unexpected! %lx", emacbase); + pr_err("emac base address unexpected! %lx", emacbase); hang(); break; } diff --git a/arch/arm/mach-tegra/ivc.c b/arch/arm/mach-tegra/ivc.c index cf6626fb12c7..dec7d90c5d3b 100644 --- a/arch/arm/mach-tegra/ivc.c +++ b/arch/arm/mach-tegra/ivc.c @@ -493,7 +493,7 @@ static int check_ivc_params(ulong qbase1, ulong qbase2, uint32_t nframes, (TEGRA_IVC_ALIGN - 1)); if ((uint64_t)nframes * (uint64_t)frame_size >= 0x100000000) { - error("tegra_ivc: nframes * frame_size overflows\n"); + pr_err("tegra_ivc: nframes * frame_size overflows\n"); return -EINVAL; } @@ -503,12 +503,12 @@ static int check_ivc_params(ulong qbase1, ulong qbase2, uint32_t nframes, */ if ((qbase1 & (TEGRA_IVC_ALIGN - 1)) || (qbase2 & (TEGRA_IVC_ALIGN - 1))) { - error("tegra_ivc: channel start not aligned\n"); + pr_err("tegra_ivc: channel start not aligned\n"); return -EINVAL; } if (frame_size & (TEGRA_IVC_ALIGN - 1)) { - error("tegra_ivc: frame size not adequately aligned\n"); + pr_err("tegra_ivc: frame size not adequately aligned\n"); return -EINVAL; } @@ -521,7 +521,7 @@ static int check_ivc_params(ulong qbase1, ulong qbase2, uint32_t nframes, } if (ret) { - error("tegra_ivc: queue regions overlap\n"); + pr_err("tegra_ivc: queue regions overlap\n"); return ret; } diff --git a/arch/arm/mach-tegra/tegra124/xusb-padctl.c b/arch/arm/mach-tegra/tegra124/xusb-padctl.c index d326a6ae5701..bfc0ab8f102a 100644 --- a/arch/arm/mach-tegra/tegra124/xusb-padctl.c +++ b/arch/arm/mach-tegra/tegra124/xusb-padctl.c @@ -137,7 +137,7 @@ static int tegra_xusb_padctl_disable(struct tegra_xusb_padctl *padctl) u32 value; if (padctl->enable == 0) { - error("unbalanced enable/disable"); + pr_err("unbalanced enable/disable"); return 0; } diff --git a/arch/arm/mach-tegra/tegra186/nvtboot_mem.c b/arch/arm/mach-tegra/tegra186/nvtboot_mem.c index 966cf9f1c460..5224ef641cd8 100644 --- a/arch/arm/mach-tegra/tegra186/nvtboot_mem.c +++ b/arch/arm/mach-tegra/tegra186/nvtboot_mem.c @@ -45,12 +45,12 @@ int dram_init(void) node = fdt_path_offset(nvtboot_blob, "/memory"); if (node < 0) { - error("Can't find /memory node in nvtboot DTB"); + pr_err("Can't find /memory node in nvtboot DTB"); hang(); } prop = fdt_getprop(nvtboot_blob, node, "reg", &len); if (!prop) { - error("Can't find /memory/reg property in nvtboot DTB"); + pr_err("Can't find /memory/reg property in nvtboot DTB"); hang(); } diff --git a/arch/arm/mach-tegra/tegra20/clock.c b/arch/arm/mach-tegra/tegra20/clock.c index ec04cf5261f7..81fb1d840f28 100644 --- a/arch/arm/mach-tegra/tegra20/clock.c +++ b/arch/arm/mach-tegra/tegra20/clock.c @@ -667,7 +667,7 @@ static int tegra_plle_train(void) } while (--timeout); if (timeout == 0) { - error("timeout waiting for PLLE to become ready"); + pr_err("timeout waiting for PLLE to become ready"); return -ETIMEDOUT; } @@ -697,7 +697,7 @@ int tegra_plle_enable(void) if ((value & PLLE_MISC_PLL_READY) == 0) { err = tegra_plle_train(); if (err < 0) { - error("failed to train PLLE: %d", err); + pr_err("failed to train PLLE: %d", err); return err; } } @@ -726,7 +726,7 @@ int tegra_plle_enable(void) } while (--timeout); if (timeout == 0) { - error("timeout waiting for PLLE to lock"); + pr_err("timeout waiting for PLLE to lock"); return -ETIMEDOUT; } diff --git a/arch/arm/mach-tegra/tegra210/xusb-padctl.c b/arch/arm/mach-tegra/tegra210/xusb-padctl.c index bf85e075de2f..a3e3e378e180 100644 --- a/arch/arm/mach-tegra/tegra210/xusb-padctl.c +++ b/arch/arm/mach-tegra/tegra210/xusb-padctl.c @@ -125,7 +125,7 @@ static int tegra_xusb_padctl_disable(struct tegra_xusb_padctl *padctl) u32 value; if (padctl->enable == 0) { - error("unbalanced enable/disable"); + pr_err("unbalanced enable/disable"); return 0; } diff --git a/arch/arm/mach-tegra/tegra30/clock.c b/arch/arm/mach-tegra/tegra30/clock.c index 4fd8b8a3b1fb..282f34fb8947 100644 --- a/arch/arm/mach-tegra/tegra30/clock.c +++ b/arch/arm/mach-tegra/tegra30/clock.c @@ -696,7 +696,7 @@ static int tegra_plle_train(void) } while (--timeout); if (timeout == 0) { - error("timeout waiting for PLLE to become ready"); + pr_err("timeout waiting for PLLE to become ready"); return -ETIMEDOUT; } @@ -726,7 +726,7 @@ int tegra_plle_enable(void) if ((value & PLLE_MISC_PLL_READY) == 0) { err = tegra_plle_train(); if (err < 0) { - error("failed to train PLLE: %d", err); + pr_err("failed to train PLLE: %d", err); return err; } } @@ -772,7 +772,7 @@ int tegra_plle_enable(void) } while (--timeout); if (timeout == 0) { - error("timeout waiting for PLLE to lock"); + pr_err("timeout waiting for PLLE to lock"); return -ETIMEDOUT; } diff --git a/arch/arm/mach-tegra/xusb-padctl-common.c b/arch/arm/mach-tegra/xusb-padctl-common.c index abc18c03a5eb..c8a468a034c3 100644 --- a/arch/arm/mach-tegra/xusb-padctl-common.c +++ b/arch/arm/mach-tegra/xusb-padctl-common.c @@ -84,7 +84,7 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl, len = ofnode_read_string_count(node, "nvidia,lanes"); if (len < 0) { - error("failed to parse \"nvidia,lanes\" property"); + pr_err("failed to parse \"nvidia,lanes\" property"); return -EINVAL; } @@ -94,7 +94,7 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl, ret = ofnode_read_string_index(node, "nvidia,lanes", i, &group->pins[i]); if (ret) { - error("failed to read string from \"nvidia,lanes\" property"); + pr_err("failed to read string from \"nvidia,lanes\" property"); return -EINVAL; } } @@ -104,7 +104,7 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl, ret = ofnode_read_string_index(node, "nvidia,function", 0, &group->func); if (ret) { - error("failed to parse \"nvidia,func\" property"); + pr_err("failed to parse \"nvidia,func\" property"); return -EINVAL; } @@ -157,14 +157,14 @@ tegra_xusb_padctl_group_apply(struct tegra_xusb_padctl *padctl, lane = tegra_xusb_padctl_find_lane(padctl, group->pins[i]); if (!lane) { - error("no lane for pin %s", group->pins[i]); + pr_err("no lane for pin %s", group->pins[i]); continue; } func = tegra_xusb_padctl_lane_find_function(padctl, lane, group->func); if (func < 0) { - error("function %s invalid for lane %s: %d", + pr_err("function %s invalid for lane %s: %d", group->func, lane->name, func); continue; } @@ -206,7 +206,7 @@ tegra_xusb_padctl_config_apply(struct tegra_xusb_padctl *padctl, err = tegra_xusb_padctl_group_apply(padctl, group); if (err < 0) { - error("failed to apply group %s: %d", + pr_err("failed to apply group %s: %d", group->name, err); continue; } @@ -232,7 +232,7 @@ tegra_xusb_padctl_config_parse_dt(struct tegra_xusb_padctl *padctl, err = tegra_xusb_padctl_group_parse_dt(padctl, group, subnode); if (err < 0) { - error("failed to parse group %s", group->name); + pr_err("failed to parse group %s", group->name); return err; } @@ -250,7 +250,7 @@ static int tegra_xusb_padctl_parse_dt(struct tegra_xusb_padctl *padctl, err = ofnode_read_resource(node, 0, &padctl->regs); if (err < 0) { - error("registers not found"); + pr_err("registers not found"); return err; } @@ -261,7 +261,7 @@ static int tegra_xusb_padctl_parse_dt(struct tegra_xusb_padctl *padctl, err = tegra_xusb_padctl_config_parse_dt(padctl, config, subnode); if (err < 0) { - error("failed to parse entry %s: %d", + pr_err("failed to parse entry %s: %d", config->name, err); continue; } @@ -289,7 +289,7 @@ int tegra_xusb_process_nodes(ofnode nodes[], unsigned int count, err = tegra_xusb_padctl_parse_dt(&padctl, nodes[i]); if (err < 0) { - error("failed to parse DT: %d", err); + pr_err("failed to parse DT: %d", err); continue; } @@ -298,7 +298,7 @@ int tegra_xusb_process_nodes(ofnode nodes[], unsigned int count, err = tegra_xusb_padctl_config_apply(&padctl, &padctl.config); if (err < 0) { - error("failed to apply pinmux: %d", err); + pr_err("failed to apply pinmux: %d", err); continue; } diff --git a/arch/x86/cpu/tangier/sdram.c b/arch/x86/cpu/tangier/sdram.c index 5743077431d3..eae8d785df9e 100644 --- a/arch/x86/cpu/tangier/sdram.c +++ b/arch/x86/cpu/tangier/sdram.c @@ -39,7 +39,7 @@ static int sfi_table_check(struct sfi_table_header *sbh) chksum += *pos++; if (chksum) - error("sfi: Invalid checksum\n"); + pr_err("sfi: Invalid checksum\n"); /* Checksum is OK if zero */ return chksum ? -EILSEQ : 0; @@ -76,7 +76,7 @@ static struct sfi_table_simple *sfi_search_mmap(void) /* Find SYST table */ sb = sfi_get_table_by_sig(SFI_BASE_ADDR, SFI_SIG_SYST); if (!sb) { - error("sfi: failed to locate SYST table\n"); + pr_err("sfi: failed to locate SYST table\n"); return NULL; } @@ -90,7 +90,7 @@ static struct sfi_table_simple *sfi_search_mmap(void) return (struct sfi_table_simple *)sbh; } - error("sfi: failed to locate SFI MMAP table\n"); + pr_err("sfi: failed to locate SFI MMAP table\n"); return NULL; } diff --git a/board/nvidia/jetson-tk1/jetson-tk1.c b/board/nvidia/jetson-tk1/jetson-tk1.c index bd08a2eed425..c20da29a98ad 100644 --- a/board/nvidia/jetson-tk1/jetson-tk1.c +++ b/board/nvidia/jetson-tk1/jetson-tk1.c @@ -49,7 +49,7 @@ static int as3722_sd_enable(struct udevice *pmic, unsigned int sd) err = pmic_clrsetbits(pmic, AS3722_SD_CONTROL, 0, 1 << sd); if (err) { - error("failed to update SD control register: %d", err); + pr_err("failed to update SD control register: %d", err); return err; } @@ -70,13 +70,13 @@ int tegra_pcie_board_init(void) ret = as3722_sd_enable(dev, 4); if (ret < 0) { - error("failed to enable SD4: %d\n", ret); + pr_err("failed to enable SD4: %d\n", ret); return ret; } ret = as3722_sd_set_voltage(dev, 4, 0x24); if (ret < 0) { - error("failed to set SD4 voltage: %d\n", ret); + pr_err("failed to set SD4 voltage: %d\n", ret); return ret; } diff --git a/board/samsung/common/exynos5-dt.c b/board/samsung/common/exynos5-dt.c index ae2a6e6bfa63..0d17f30712cd 100644 --- a/board/samsung/common/exynos5-dt.c +++ b/board/samsung/common/exynos5-dt.c @@ -161,7 +161,7 @@ int board_usb_init(int index, enum usb_init_type init) samsung_get_base_usb3_phy(); if (!phy) { - error("usb3 phy not supported"); + pr_err("usb3 phy not supported"); return -ENODEV; } diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c index 4157349d028b..eba25b7b980a 100644 --- a/board/samsung/common/misc.c +++ b/board/samsung/common/misc.c @@ -457,7 +457,7 @@ void draw_logo(void) addr = panel_info.logo_addr; if (!addr) { - error("There is no logo data."); + pr_err("There is no logo data."); return; } diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index d0247ac2571a..debc4c57ffa0 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -102,7 +102,7 @@ int board_mmc_init(bd_t *bis) ret = s5p_mmc_init(0, 4); if (ret) - error("MMC: Failed to init MMC:0.\n"); + pr_err("MMC: Failed to init MMC:0.\n"); /* * SD card (T_FLASH) detect and init @@ -127,7 +127,7 @@ int board_mmc_init(bd_t *bis) ret_sd = s5p_mmc_init(2, 4); if (ret_sd) - error("MMC: Failed to init SD card (MMC:2).\n"); + pr_err("MMC: Failed to init SD card (MMC:2).\n"); } return ret & ret_sd; diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c index e40a2f6e3a69..0df96c1a3daf 100644 --- a/board/samsung/odroid/odroid.c +++ b/board/samsung/odroid/odroid.c @@ -429,7 +429,7 @@ int exynos_power_init(void) }; if (regulator_list_autoset(mmc_regulators, NULL, true)) - error("Unable to init all mmc regulators"); + pr_err("Unable to init all mmc regulators"); return 0; } @@ -442,7 +442,7 @@ static int s5pc210_phy_control(int on) ret = regulator_get_by_platname("VDD_UOTG_3.0V", &dev); if (ret) { - error("Regulator get error: %d", ret); + pr_err("Regulator get error: %d", ret); return ret; } @@ -487,25 +487,25 @@ int board_usb_init(int index, enum usb_init_type init) ret = regulator_get_by_platname("VCC_P3V3_2.85V", &dev); if (ret) { - error("Regulator get error: %d", ret); + pr_err("Regulator get error: %d", ret); return ret; } ret = regulator_set_enable(dev, true); if (ret) { - error("Regulator %s enable setting error: %d", dev->name, ret); + pr_err("Regulator %s enable setting error: %d", dev->name, ret); return ret; } ret = regulator_set_value(dev, 750000); if (ret) { - error("Regulator %s value setting error: %d", dev->name, ret); + pr_err("Regulator %s value setting error: %d", dev->name, ret); return ret; } ret = regulator_set_value(dev, 3300000); if (ret) { - error("Regulator %s value setting error: %d", dev->name, ret); + pr_err("Regulator %s value setting error: %d", dev->name, ret); return ret; } #endif diff --git a/cmd/fastboot.c b/cmd/fastboot.c index 488822a2eed5..8adcca592d58 100644 --- a/cmd/fastboot.c +++ b/cmd/fastboot.c @@ -27,7 +27,7 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) ret = board_usb_init(controller_index, USB_INIT_DEVICE); if (ret) { - error("USB init failed: %d", ret); + pr_err("USB init failed: %d", ret); return CMD_RET_FAILURE; } diff --git a/cmd/nvedit.c b/cmd/nvedit.c index 4033d90c8e2d..228e904e1d51 100644 --- a/cmd/nvedit.c +++ b/cmd/nvedit.c @@ -927,7 +927,7 @@ NXTARG: ; H_MATCH_KEY | H_MATCH_IDENT, &ptr, size, argc, argv); if (len < 0) { - error("Cannot export environment: errno = %d\n", errno); + pr_err("Cannot export environment: errno = %d\n", errno); return 1; } sprintf(buf, "%zX", (size_t)len); @@ -947,7 +947,7 @@ NXTARG: ; H_MATCH_KEY | H_MATCH_IDENT, &res, ENV_SIZE, argc, argv); if (len < 0) { - error("Cannot export environment: errno = %d\n", errno); + pr_err("Cannot export environment: errno = %d\n", errno); return 1; } @@ -1082,7 +1082,7 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag, if (himport_r(&env_htab, ptr, size, sep, del ? 0 : H_NOCLEAR, crlf_is_lf, 0, NULL) == 0) { - error("Environment import failed: errno = %d\n", errno); + pr_err("Environment import failed: errno = %d\n", errno); return 1; } gd->flags |= GD_FLG_ENV_READY; diff --git a/cmd/regulator.c b/cmd/regulator.c index 2ef5bc9a8289..b605255180d5 100644 --- a/cmd/regulator.c +++ b/cmd/regulator.c @@ -71,7 +71,7 @@ static int curr_dev_and_platdata(struct udevice **devp, *uc_pdata = dev_get_uclass_platdata(*devp); if (!*uc_pdata) { - error("Regulator: %s - missing platform data!", currdev->name); + pr_err("Regulator: %s - missing platform data!", currdev->name); return CMD_RET_FAILURE; } diff --git a/cmd/thordown.c b/cmd/thordown.c index 436b7f56315e..1bb5fc2ec23b 100644 --- a/cmd/thordown.c +++ b/cmd/thordown.c @@ -33,7 +33,7 @@ int do_thor_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int controller_index = simple_strtoul(usb_controller, NULL, 0); ret = board_usb_init(controller_index, USB_INIT_DEVICE); if (ret) { - error("USB init failed: %d", ret); + pr_err("USB init failed: %d", ret); ret = CMD_RET_FAILURE; goto exit; } @@ -42,14 +42,14 @@ int do_thor_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ret = thor_init(); if (ret) { - error("THOR DOWNLOAD failed: %d", ret); + pr_err("THOR DOWNLOAD failed: %d", ret); ret = CMD_RET_FAILURE; goto exit; } ret = thor_handle(); if (ret) { - error("THOR failed: %d", ret); + pr_err("THOR failed: %d", ret); ret = CMD_RET_FAILURE; goto exit; } diff --git a/cmd/tpm_test.c b/cmd/tpm_test.c index 330640594879..37ad2ff33d65 100644 --- a/cmd/tpm_test.c +++ b/cmd/tpm_test.c @@ -303,12 +303,12 @@ static int test_readonly(void) index_0 += 1; if (tpm_nv_write_value(INDEX0, (uint8_t *)&index_0, sizeof(index_0) != TPM_SUCCESS)) { - error("\tcould not write index 0\n"); + pr_err("\tcould not write index 0\n"); } tpm_nv_write_value_lock(INDEX0); if (tpm_nv_write_value(INDEX0, (uint8_t *)&index_0, sizeof(index_0)) == TPM_SUCCESS) - error("\tindex 0 is not locked\n"); + pr_err("\tindex 0 is not locked\n"); printf("\tdone\n"); return 0; @@ -471,7 +471,7 @@ static int test_write_limit(void) case TPM_MAXNVWRITES: assert(i >= TPM_MAX_NV_WRITES_NOOWNER); default: - error("\tunexpected error code %d (0x%x)\n", + pr_err("\tunexpected error code %d (0x%x)\n", result, result); } } diff --git a/cmd/usb_gadget_sdp.c b/cmd/usb_gadget_sdp.c index b1d8b2858e19..ae4d73c1250d 100644 --- a/cmd/usb_gadget_sdp.c +++ b/cmd/usb_gadget_sdp.c @@ -28,13 +28,13 @@ static int do_sdp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ret = sdp_init(controller_index); if (ret) { - error("SDP init failed: %d", ret); + pr_err("SDP init failed: %d", ret); goto exit; } /* This command typically does not return but jumps to an image */ sdp_handle(controller_index); - error("SDP ended"); + pr_err("SDP ended"); exit: g_dnl_unregister(); diff --git a/cmd/usb_mass_storage.c b/cmd/usb_mass_storage.c index 3353f95c7450..cfeecb7068a6 100644 --- a/cmd/usb_mass_storage.c +++ b/cmd/usb_mass_storage.c @@ -162,21 +162,21 @@ static int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag, controller_index = (unsigned int)(simple_strtoul( usb_controller, NULL, 0)); if (board_usb_init(controller_index, USB_INIT_DEVICE)) { - error("Couldn't init USB controller."); + pr_err("Couldn't init USB controller."); rc = CMD_RET_FAILURE; goto cleanup_ums_init; } rc = fsg_init(ums, ums_count); if (rc) { - error("fsg_init failed"); + pr_err("fsg_init failed"); rc = CMD_RET_FAILURE; goto cleanup_board; } rc = g_dnl_register("usb_dnl_ums"); if (rc) { - error("g_dnl_register failed"); + pr_err("g_dnl_register failed"); rc = CMD_RET_FAILURE; goto cleanup_board; } diff --git a/common/dfu.c b/common/dfu.c index 546a1ab9b4c0..07dff317a6c2 100644 --- a/common/dfu.c +++ b/common/dfu.c @@ -26,13 +26,13 @@ int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget) ret = board_usb_init(usbctrl_index, USB_INIT_DEVICE); if (ret) { - error("board usb init failed\n"); + pr_err("board usb init failed\n"); return CMD_RET_FAILURE; } g_dnl_clear_detach(); ret = g_dnl_register(usb_dnl_gadget); if (ret) { - error("g_dnl_register failed"); + pr_err("g_dnl_register failed"); return CMD_RET_FAILURE; } @@ -75,7 +75,7 @@ int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget) ret = dfu_flush(dfu_get_defer_flush(), NULL, 0, 0); dfu_set_defer_flush(NULL); if (ret) { - error("Deferred dfu_flush() failed!"); + pr_err("Deferred dfu_flush() failed!"); goto exit; } } diff --git a/common/fb_mmc.c b/common/fb_mmc.c index 26d60b88d0ca..cf5b77ca287e 100644 --- a/common/fb_mmc.c +++ b/common/fb_mmc.c @@ -84,7 +84,7 @@ static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info, blkcnt = lldiv(blkcnt, info->blksz); if (blkcnt > info->size) { - error("too large for partition: '%s'\n", part_name); + pr_err("too large for partition: '%s'\n", part_name); fastboot_fail("too large for partition"); return; } @@ -93,7 +93,7 @@ static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info, blks = blk_dwrite(dev_desc, info->start, blkcnt, buffer); if (blks != blkcnt) { - error("failed writing to device %d\n", dev_desc->devnum); + pr_err("failed writing to device %d\n", dev_desc->devnum); fastboot_fail("failed writing to device"); return; } @@ -125,7 +125,7 @@ static lbaint_t fb_mmc_get_boot_header(struct blk_desc *dev_desc, sector_size = info->blksz; hdr_sectors = DIV_ROUND_UP(sizeof(struct andr_img_hdr), sector_size); if (hdr_sectors == 0) { - error("invalid number of boot sectors: 0"); + pr_err("invalid number of boot sectors: 0"); fastboot_fail("invalid number of boot sectors: 0"); return 0; } @@ -133,7 +133,7 @@ static lbaint_t fb_mmc_get_boot_header(struct blk_desc *dev_desc, /* Read the boot image header */ res = blk_dread(dev_desc, info->start, hdr_sectors, (void *)hdr); if (res != hdr_sectors) { - error("cannot read header from boot partition"); + pr_err("cannot read header from boot partition"); fastboot_fail("cannot read header from boot partition"); return 0; } @@ -141,7 +141,7 @@ static lbaint_t fb_mmc_get_boot_header(struct blk_desc *dev_desc, /* Check boot header magic string */ res = android_image_check_header(hdr); if (res != 0) { - error("bad boot image magic"); + pr_err("bad boot image magic"); fastboot_fail("boot partition not initialized"); return 0; } @@ -179,7 +179,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc, /* Get boot partition info */ res = part_get_info_by_name(dev_desc, BOOT_PARTITION_NAME, &info); if (res < 0) { - error("cannot find boot partition"); + pr_err("cannot find boot partition"); fastboot_fail("cannot find boot partition"); return -1; } @@ -191,14 +191,14 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc, /* Read boot image header */ hdr_sectors = fb_mmc_get_boot_header(dev_desc, &info, hdr); if (hdr_sectors == 0) { - error("unable to read boot image header"); + pr_err("unable to read boot image header"); fastboot_fail("unable to read boot image header"); return -1; } /* Check if boot image has second stage in it (we don't support it) */ if (hdr->second_size > 0) { - error("moving second stage is not supported yet"); + pr_err("moving second stage is not supported yet"); fastboot_fail("moving second stage is not supported yet"); return -1; } @@ -216,7 +216,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc, res = blk_dread(dev_desc, ramdisk_sector_start, ramdisk_sectors, ramdisk_buffer); if (res != ramdisk_sectors) { - error("cannot read ramdisk from boot partition"); + pr_err("cannot read ramdisk from boot partition"); fastboot_fail("cannot read ramdisk from boot partition"); return -1; } @@ -225,7 +225,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc, hdr->kernel_size = download_bytes; res = blk_dwrite(dev_desc, info.start, hdr_sectors, (void *)hdr); if (res == 0) { - error("cannot writeback boot image header"); + pr_err("cannot writeback boot image header"); fastboot_fail("cannot write back boot image header"); return -1; } @@ -237,7 +237,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc, res = blk_dwrite(dev_desc, kernel_sector_start, kernel_sectors, download_buffer); if (res == 0) { - error("cannot write new kernel"); + pr_err("cannot write new kernel"); fastboot_fail("cannot write new kernel"); return -1; } @@ -249,7 +249,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc, res = blk_dwrite(dev_desc, ramdisk_sector_start, ramdisk_sectors, ramdisk_buffer); if (res == 0) { - error("cannot write back original ramdisk"); + pr_err("cannot write back original ramdisk"); fastboot_fail("cannot write back original ramdisk"); return -1; } @@ -268,7 +268,7 @@ void fb_mmc_flash_write(const char *cmd, void *download_buffer, dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV); if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) { - error("invalid mmc device\n"); + pr_err("invalid mmc device\n"); fastboot_fail("invalid mmc device"); return; } @@ -322,7 +322,7 @@ void fb_mmc_flash_write(const char *cmd, void *download_buffer, #endif if (part_get_info_by_name_or_alias(dev_desc, cmd, &info) < 0) { - error("cannot find partition: '%s'\n", cmd); + pr_err("cannot find partition: '%s'\n", cmd); fastboot_fail("cannot find partition"); return; } @@ -360,21 +360,21 @@ void fb_mmc_erase(const char *cmd) struct mmc *mmc = find_mmc_device(CONFIG_FASTBOOT_FLASH_MMC_DEV); if (mmc == NULL) { - error("invalid mmc device"); + pr_err("invalid mmc device"); fastboot_fail("invalid mmc device"); return; } dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV); if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) { - error("invalid mmc device"); + pr_err("invalid mmc device"); fastboot_fail("invalid mmc device"); return; } ret = part_get_info_by_name_or_alias(dev_desc, cmd, &info); if (ret < 0) { - error("cannot find partition: '%s'", cmd); + pr_err("cannot find partition: '%s'", cmd); fastboot_fail("cannot find partition"); return; } @@ -393,7 +393,7 @@ void fb_mmc_erase(const char *cmd) blks = blk_derase(dev_desc, blks_start, blks_size); if (blks != blks_size) { - error("failed erasing from device %d", dev_desc->devnum); + pr_err("failed erasing from device %d", dev_desc->devnum); fastboot_fail("failed erasing from device"); return; } diff --git a/common/fb_nand.c b/common/fb_nand.c index 3d027d437554..aa28046cbd83 100644 --- a/common/fb_nand.c +++ b/common/fb_nand.c @@ -40,20 +40,20 @@ static int fb_nand_lookup(const char *partname, ret = mtdparts_init(); if (ret) { - error("Cannot initialize MTD partitions\n"); + pr_err("Cannot initialize MTD partitions\n"); fastboot_fail("cannot init mtdparts"); return ret; } ret = find_dev_and_part(partname, &dev, &pnum, part); if (ret) { - error("cannot find partition: '%s'", partname); + pr_err("cannot find partition: '%s'", partname); fastboot_fail("cannot find partition"); return ret; } if (dev->id->type != MTD_DEV_TYPE_NAND) { - error("partition '%s' is not stored on a NAND device", + pr_err("partition '%s' is not stored on a NAND device", partname); fastboot_fail("not a NAND device"); return -EINVAL; @@ -154,7 +154,7 @@ void fb_nand_flash_write(const char *cmd, void *download_buffer, ret = fb_nand_lookup(cmd, &mtd, &part); if (ret) { - error("invalid NAND device"); + pr_err("invalid NAND device"); fastboot_fail("invalid NAND device"); return; } @@ -209,7 +209,7 @@ void fb_nand_erase(const char *cmd) ret = fb_nand_lookup(cmd, &mtd, &part); if (ret) { - error("invalid NAND device"); + pr_err("invalid NAND device"); fastboot_fail("invalid NAND device"); return; } @@ -220,7 +220,7 @@ void fb_nand_erase(const char *cmd) ret = _fb_nand_erase(mtd, part); if (ret) { - error("failed erasing from device %s", mtd->name); + pr_err("failed erasing from device %s", mtd->name); fastboot_fail("failed erasing from device"); return; } diff --git a/common/spl/spl_dfu.c b/common/spl/spl_dfu.c index 2c974735b11a..05bb21035df2 100644 --- a/common/spl/spl_dfu.c +++ b/common/spl/spl_dfu.c @@ -42,13 +42,13 @@ int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr) set_default_env(0); str_env = env_get(dfu_alt_info); if (!str_env) { - error("\"dfu_alt_info\" env variable not defined!\n"); + pr_err("\"dfu_alt_info\" env variable not defined!\n"); return -EINVAL; } ret = env_set("dfu_alt_info", str_env); if (ret) { - error("unable to set env variable \"dfu_alt_info\"!\n"); + pr_err("unable to set env variable \"dfu_alt_info\"!\n"); return -EINVAL; } diff --git a/common/spl/spl_sdp.c b/common/spl/spl_sdp.c index 350bcdb05695..333d518f4d6e 100644 --- a/common/spl/spl_sdp.c +++ b/common/spl/spl_sdp.c @@ -24,13 +24,13 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image, ret = sdp_init(controller_index); if (ret) { - error("SDP init failed: %d", ret); + pr_err("SDP init failed: %d", ret); return -ENODEV; } /* This command typically does not return but jumps to an image */ sdp_handle(controller_index); - error("SDP ended"); + pr_err("SDP ended"); return -EINVAL; } diff --git a/common/update.c b/common/update.c index 974f4655e7ef..33bffaa89eca 100644 --- a/common/update.c +++ b/common/update.c @@ -242,7 +242,7 @@ int update_tftp(ulong addr, char *interface, char *devstring) } else if (interface && devstring) { update_tftp_dfu = true; } else { - error("Interface: %s and devstring: %s not supported!\n", + pr_err("Interface: %s and devstring: %s not supported!\n", interface, devstring); return -EINVAL; } diff --git a/disk/part_efi.c b/disk/part_efi.c index 2973d52f6abb..e05a1386be28 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -360,7 +360,7 @@ static int set_protective_mbr(struct blk_desc *dev_desc) /* Read MBR to backup boot code if it exists */ if (blk_dread(dev_desc, 0, 1, p_mbr) != 1) { - error("** Can't read from device %d **\n", dev_desc->devnum); + pr_err("** Can't read from device %d **\n", dev_desc->devnum); return -1; } @@ -716,7 +716,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc, for (i = 0; i < parts; i++) { if (i == gpt_head->num_partition_entries) { - error("More partitions than allowed!\n"); + pr_err("More partitions than allowed!\n"); return -1; } @@ -729,7 +729,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc, if (strncmp(efi_str, (char *)partitions[i].name, sizeof(partitions->name))) { - error("Partition name: %s does not match %s!\n", + pr_err("Partition name: %s does not match %s!\n", efi_str, (char *)partitions[i].name); return -1; } @@ -746,7 +746,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc, if ((i == parts - 1) && (partitions[i].size == 0)) continue; - error("Partition %s size: %llu does not match %llu!\n", + pr_err("Partition %s size: %llu does not match %llu!\n", efi_str, (unsigned long long)gpt_part_size, (unsigned long long)partitions[i].size); return -1; @@ -767,7 +767,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc, (unsigned long long)partitions[i].start); if (le64_to_cpu(gpt_e[i].starting_lba) != partitions[i].start) { - error("Partition %s start: %llu does not match %llu!\n", + pr_err("Partition %s start: %llu does not match %llu!\n", efi_str, le64_to_cpu(gpt_e[i].starting_lba), (unsigned long long)partitions[i].start); return -1; diff --git a/drivers/adc/adc-uclass.c b/drivers/adc/adc-uclass.c index a5ef722d2137..a4c20f4d3520 100644 --- a/drivers/adc/adc-uclass.c +++ b/drivers/adc/adc-uclass.c @@ -64,7 +64,7 @@ static int adc_supply_enable(struct udevice *dev) } if (ret) - error("%s: can't enable %s-supply!", dev->name, supply_type); + pr_err("%s: can't enable %s-supply!", dev->name, supply_type); return ret; } @@ -389,12 +389,12 @@ static int adc_pre_probe(struct udevice *dev) /* Set ADC VDD platdata: polarity, uV, regulator (phandle). */ ret = adc_vdd_platdata_set(dev); if (ret) - error("%s: Can't update Vdd. Error: %d", dev->name, ret); + pr_err("%s: Can't update Vdd. Error: %d", dev->name, ret); /* Set ADC VSS platdata: polarity, uV, regulator (phandle). */ ret = adc_vss_platdata_set(dev); if (ret) - error("%s: Can't update Vss. Error: %d", dev->name, ret); + pr_err("%s: Can't update Vss. Error: %d", dev->name, ret); return 0; } diff --git a/drivers/adc/exynos-adc.c b/drivers/adc/exynos-adc.c index 324d72f3a959..3bb065d2155c 100644 --- a/drivers/adc/exynos-adc.c +++ b/drivers/adc/exynos-adc.c @@ -22,7 +22,7 @@ int exynos_adc_channel_data(struct udevice *dev, int channel, struct exynos_adc_v2 *regs = priv->regs; if (channel != priv->active_channel) { - error("Requested channel is not active!"); + pr_err("Requested channel is not active!"); return -EINVAL; } @@ -80,7 +80,7 @@ int exynos_adc_probe(struct udevice *dev) /* Check HW version */ if (readl(®s->version) != ADC_V2_VERSION) { - error("This driver supports only ADC v2!"); + pr_err("This driver supports only ADC v2!"); return -ENXIO; } @@ -109,7 +109,7 @@ int exynos_adc_ofdata_to_platdata(struct udevice *dev) priv->regs = (struct exynos_adc_v2 *)devfdt_get_addr(dev); if (priv->regs == (struct exynos_adc_v2 *)FDT_ADDR_T_NONE) { - error("Dev: %s - can't get address!", dev->name); + pr_err("Dev: %s - can't get address!", dev->name); return -ENODATA; } diff --git a/drivers/adc/sandbox.c b/drivers/adc/sandbox.c index 371892237aa4..80e8e3701a34 100644 --- a/drivers/adc/sandbox.c +++ b/drivers/adc/sandbox.c @@ -61,7 +61,7 @@ int sandbox_adc_channel_data(struct udevice *dev, int channel, /* For single-channel conversion mode, check if channel was selected */ if ((priv->conversion_mode == SANDBOX_ADC_MODE_SINGLE_CHANNEL) && !(priv->active_channel_mask & (1 << channel))) { - error("Request for an inactive channel!"); + pr_err("Request for an inactive channel!"); return -EINVAL; } @@ -82,12 +82,12 @@ int sandbox_adc_channels_data(struct udevice *dev, unsigned int channel_mask, /* Return error for single-channel conversion mode */ if (priv->conversion_mode == SANDBOX_ADC_MODE_SINGLE_CHANNEL) { - error("ADC in single-channel mode!"); + pr_err("ADC in single-channel mode!"); return -EPERM; } /* Check channel selection */ if (!(priv->active_channel_mask & channel_mask)) { - error("Request for an inactive channel!"); + pr_err("Request for an inactive channel!"); return -EINVAL; } /* The conversion must be started before reading the data */ diff --git a/drivers/ata/dwc_ahci.c b/drivers/ata/dwc_ahci.c index f6147989b1c8..b16304baedbd 100644 --- a/drivers/ata/dwc_ahci.c +++ b/drivers/ata/dwc_ahci.c @@ -58,19 +58,19 @@ static int dwc_ahci_probe(struct udevice *dev) ret = generic_phy_get_by_name(dev, "sata-phy", &phy); if (ret) { - error("can't get the phy from DT\n"); + pr_err("can't get the phy from DT\n"); return ret; } ret = generic_phy_init(&phy); if (ret) { - error("unable to initialize the sata phy\n"); + pr_err("unable to initialize the sata phy\n"); return ret; } ret = generic_phy_power_on(&phy); if (ret) { - error("unable to power on the sata phy\n"); + pr_err("unable to power on the sata phy\n"); return ret; } diff --git a/drivers/clk/clk_boston.c b/drivers/clk/clk_boston.c index 78f1b759d838..5c05e3d78d5b 100644 --- a/drivers/clk/clk_boston.c +++ b/drivers/clk/clk_boston.c @@ -67,13 +67,13 @@ static int clk_boston_ofdata_to_platdata(struct udevice *dev) err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev, "regmap", &syscon); if (err) { - error("unable to find syscon device\n"); + pr_err("unable to find syscon device\n"); return err; } state->regmap = syscon_get_regmap(syscon); if (!state->regmap) { - error("unable to find regmap\n"); + pr_err("unable to find regmap\n"); return -ENODEV; } diff --git a/drivers/clk/clk_stm32f7.c b/drivers/clk/clk_stm32f7.c index 255a583c9545..ad3cafc49fb7 100644 --- a/drivers/clk/clk_stm32f7.c +++ b/drivers/clk/clk_stm32f7.c @@ -224,7 +224,7 @@ static unsigned long stm32_clk_get_rate(struct clk *clk) return sysclk >>= shift; break; default: - error("clock index %ld out of range\n", clk->id); + pr_err("clock index %ld out of range\n", clk->id); return -EINVAL; break; } diff --git a/drivers/clk/rockchip/clk_rk3368.c b/drivers/clk/rockchip/clk_rk3368.c index 2be1f572d721..d46a73a2eaf2 100644 --- a/drivers/clk/rockchip/clk_rk3368.c +++ b/drivers/clk/rockchip/clk_rk3368.c @@ -301,7 +301,7 @@ static ulong rk3368_ddr_set_clk(struct rk3368_cru *cru, ulong set_rate) dpll_cfg = &dpll_1600; break; default: - error("Unsupported SDRAM frequency!,%ld\n", set_rate); + pr_err("Unsupported SDRAM frequency!,%ld\n", set_rate); } rkclk_set_pll(cru, DPLL, dpll_cfg); @@ -359,7 +359,7 @@ static ulong rk3368_spi_get_clk(struct rk3368_cru *cru, ulong clk_id) break; default: - error("%s: SPI clk-id %ld not supported\n", __func__, clk_id); + pr_err("%s: SPI clk-id %ld not supported\n", __func__, clk_id); return -EINVAL; } @@ -384,7 +384,7 @@ static ulong rk3368_spi_set_clk(struct rk3368_cru *cru, ulong clk_id, uint hz) break; default: - error("%s: SPI clk-id %ld not supported\n", __func__, clk_id); + pr_err("%s: SPI clk-id %ld not supported\n", __func__, clk_id); return -EINVAL; } @@ -498,7 +498,7 @@ static int rk3368_clk_bind(struct udevice *dev) /* The reset driver does not have a device node, so bind it here */ ret = device_bind_driver(gd->dm_root, "rk3368_sysreset", "reset", &dev); if (ret) - error("bind RK3368 reset driver failed: ret=%d\n", ret); + pr_err("bind RK3368 reset driver failed: ret=%d\n", ret); return ret; } diff --git a/drivers/clk/rockchip/clk_rk3399.c b/drivers/clk/rockchip/clk_rk3399.c index 3edafea14007..c6859f3d5f5e 100644 --- a/drivers/clk/rockchip/clk_rk3399.c +++ b/drivers/clk/rockchip/clk_rk3399.c @@ -661,7 +661,7 @@ static ulong rk3399_spi_get_clk(struct rk3399_cru *cru, ulong clk_id) break; default: - error("%s: SPI clk-id %ld not supported\n", __func__, clk_id); + pr_err("%s: SPI clk-id %ld not supported\n", __func__, clk_id); return -EINVAL; } @@ -685,7 +685,7 @@ static ulong rk3399_spi_set_clk(struct rk3399_cru *cru, ulong clk_id, uint hz) break; default: - error("%s: SPI clk-id %ld not supported\n", __func__, clk_id); + pr_err("%s: SPI clk-id %ld not supported\n", __func__, clk_id); return -EINVAL; } @@ -854,7 +854,7 @@ static ulong rk3399_ddr_set_clk(struct rk3399_cru *cru, {.refdiv = 1, .fbdiv = 116, .postdiv1 = 3, .postdiv2 = 1}; break; default: - error("Unsupported SDRAM frequency!,%ld\n", set_rate); + pr_err("Unsupported SDRAM frequency!,%ld\n", set_rate); } rkclk_set_pll(&cru->dpll_con[0], &dpll_cfg); diff --git a/drivers/clk/rockchip/clk_rv1108.c b/drivers/clk/rockchip/clk_rv1108.c index cf966bbdc339..9f0ae6c941ac 100644 --- a/drivers/clk/rockchip/clk_rv1108.c +++ b/drivers/clk/rockchip/clk_rv1108.c @@ -196,7 +196,7 @@ static int rv1108_clk_bind(struct udevice *dev) /* The reset driver does not have a device node, so bind it here */ ret = device_bind_driver(gd->dm_root, "rv1108_sysreset", "reset", &dev); if (ret) - error("No Rv1108 reset driver: ret=%d\n", ret); + pr_err("No Rv1108 reset driver: ret=%d\n", ret); return 0; } diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c index ff732ac309fe..2c22b625b8bd 100644 --- a/drivers/dfu/dfu.c +++ b/drivers/dfu/dfu.c @@ -64,14 +64,14 @@ int dfu_init_env_entities(char *interface, char *devstr) #endif str_env = env_get("dfu_alt_info"); if (!str_env) { - error("\"dfu_alt_info\" env variable not defined!\n"); + pr_err("\"dfu_alt_info\" env variable not defined!\n"); return -EINVAL; } env_bkp = strdup(str_env); ret = dfu_config_entities(env_bkp, interface, devstr); if (ret) { - error("DFU entities configuration failed!\n"); + pr_err("DFU entities configuration failed!\n"); return ret; } @@ -132,7 +132,7 @@ static char *dfu_get_hash_algo(void) return s; } - error("DFU hash method: %s not supported!\n", s); + pr_err("DFU hash method: %s not supported!\n", s); return NULL; } @@ -273,7 +273,7 @@ int dfu_write(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num) /* we should be in buffer now (if not then size too large) */ if ((dfu->i_buf + size) > dfu->i_buf_end) { - error("Buffer overflow! (0x%p + 0x%x > 0x%p)\n", dfu->i_buf, + pr_err("Buffer overflow! (0x%p + 0x%x > 0x%p)\n", dfu->i_buf, size, dfu->i_buf_end); dfu_transaction_cleanup(dfu); return -1; @@ -451,7 +451,7 @@ int dfu_config_entities(char *env, char *interface, char *devstr) if (s) { ret = hash_lookup_algo(s, &dfu_hash_algo); if (ret) - error("Hash algorithm %s not supported\n", s); + pr_err("Hash algorithm %s not supported\n", s); } dfu = calloc(sizeof(*dfu), dfu_alt_num); @@ -576,7 +576,7 @@ int dfu_write_from_mem_addr(struct dfu_entity *dfu, void *buf, int size) dp, left, write); ret = dfu_write(dfu, dp, write, i); if (ret) { - error("DFU write failed\n"); + pr_err("DFU write failed\n"); return ret; } @@ -586,7 +586,7 @@ int dfu_write_from_mem_addr(struct dfu_entity *dfu, void *buf, int size) ret = dfu_flush(dfu, NULL, 0, i); if (ret) - error("DFU flush failed!"); + pr_err("DFU flush failed!"); return ret; } diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c index 39e10b1a5a67..47948d369d95 100644 --- a/drivers/dfu/dfu_mmc.c +++ b/drivers/dfu/dfu_mmc.c @@ -29,7 +29,7 @@ static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu, mmc = find_mmc_device(dfu->data.mmc.dev_num); if (!mmc) { - error("Device MMC %d - not found!", dfu->data.mmc.dev_num); + pr_err("Device MMC %d - not found!", dfu->data.mmc.dev_num); return -ENODEV; } @@ -69,11 +69,11 @@ static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu, buf); break; default: - error("Operation not supported\n"); + pr_err("Operation not supported\n"); } if (n != blk_count) { - error("MMC operation failed"); + pr_err("MMC operation failed"); if (dfu->data.mmc.hw_partition >= 0) blk_select_hwpart_devnum(IF_TYPE_MMC, dfu->data.mmc.dev_num, @@ -312,7 +312,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s) for (; parg < argv + sizeof(argv) / sizeof(*argv); ++parg) { *parg = strsep(&s, " "); if (*parg == NULL) { - error("Invalid number of arguments.\n"); + pr_err("Invalid number of arguments.\n"); return -ENODEV; } } @@ -327,13 +327,13 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s) mmc = find_mmc_device(dfu->data.mmc.dev_num); if (mmc == NULL) { - error("Couldn't find MMC device no. %d.\n", + pr_err("Couldn't find MMC device no. %d.\n", dfu->data.mmc.dev_num); return -ENODEV; } if (mmc_init(mmc)) { - error("Couldn't init MMC device.\n"); + pr_err("Couldn't init MMC device.\n"); return -ENODEV; } @@ -360,7 +360,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s) int mmcpart = third_arg; if (part_get_info(blk_dev, mmcpart, &partinfo) != 0) { - error("Couldn't find part #%d on mmc device #%d\n", + pr_err("Couldn't find part #%d on mmc device #%d\n", mmcpart, mmcdev); return -ENODEV; } @@ -374,7 +374,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s) } else if (!strcmp(entity_type, "ext4")) { dfu->layout = DFU_FS_EXT4; } else { - error("Memory layout (%s) not supported!\n", entity_type); + pr_err("Memory layout (%s) not supported!\n", entity_type); return -ENODEV; } @@ -397,7 +397,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s) dfu_file_buf = memalign(CONFIG_SYS_CACHELINE_SIZE, CONFIG_SYS_DFU_MAX_FILE_SIZE); if (!dfu_file_buf) { - error("Could not memalign 0x%x bytes", + pr_err("Could not memalign 0x%x bytes", CONFIG_SYS_DFU_MAX_FILE_SIZE); return -ENOMEM; } diff --git a/drivers/dfu/dfu_ram.c b/drivers/dfu/dfu_ram.c index 6e3f5316f5ad..2b5e05a913ee 100644 --- a/drivers/dfu/dfu_ram.c +++ b/drivers/dfu/dfu_ram.c @@ -18,12 +18,12 @@ static int dfu_transfer_medium_ram(enum dfu_op op, struct dfu_entity *dfu, u64 offset, void *buf, long *len) { if (dfu->layout != DFU_RAM_ADDR) { - error("unsupported layout: %s\n", dfu_get_layout(dfu->layout)); + pr_err("unsupported layout: %s\n", dfu_get_layout(dfu->layout)); return -EINVAL; } if (offset > dfu->data.ram.size) { - error("request exceeds allowed area\n"); + pr_err("request exceeds allowed area\n"); return -EINVAL; } @@ -62,14 +62,14 @@ int dfu_fill_entity_ram(struct dfu_entity *dfu, char *devstr, char *s) for (; parg < argv + sizeof(argv) / sizeof(*argv); ++parg) { *parg = strsep(&s, " "); if (*parg == NULL) { - error("Invalid number of arguments.\n"); + pr_err("Invalid number of arguments.\n"); return -ENODEV; } } dfu->dev_type = DFU_DEV_RAM; if (strcmp(argv[0], "ram")) { - error("unsupported device: %s\n", argv[0]); + pr_err("unsupported device: %s\n", argv[0]); return -ENODEV; } diff --git a/drivers/dfu/dfu_tftp.c b/drivers/dfu/dfu_tftp.c index cd71708231f5..62bf797dac9f 100644 --- a/drivers/dfu/dfu_tftp.c +++ b/drivers/dfu/dfu_tftp.c @@ -43,7 +43,7 @@ int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, unsigned int len, alt_setting_num = dfu_get_alt(sb); free(sb); if (alt_setting_num < 0) { - error("Alt setting [%d] to write not found!", + pr_err("Alt setting [%d] to write not found!", alt_setting_num); ret = -ENODEV; goto done; @@ -51,7 +51,7 @@ int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, unsigned int len, dfu = dfu_get_entity(alt_setting_num); if (!dfu) { - error("DFU entity for alt: %d not found!", alt_setting_num); + pr_err("DFU entity for alt: %d not found!", alt_setting_num); ret = -ENODEV; goto done; } diff --git a/drivers/dma/dma-uclass.c b/drivers/dma/dma-uclass.c index ea21fd9c6feb..3d0ce22fbc21 100644 --- a/drivers/dma/dma-uclass.c +++ b/drivers/dma/dma-uclass.c @@ -33,7 +33,7 @@ int dma_get_device(u32 transfer_type, struct udevice **devp) } if (!dev) { - error("No DMA device found that supports %x type\n", + pr_err("No DMA device found that supports %x type\n", transfer_type); return -EPROTONOSUPPORT; } diff --git a/drivers/dma/lpc32xx_dma.c b/drivers/dma/lpc32xx_dma.c index 955adfeccda1..63a8a2f34080 100644 --- a/drivers/dma/lpc32xx_dma.c +++ b/drivers/dma/lpc32xx_dma.c @@ -96,7 +96,7 @@ int lpc32xx_dma_start_xfer(unsigned int channel, { if (unlikely(((BIT_MASK(channel) & alloc_ch) == 0) || (channel >= DMA_NO_OF_CHANNELS))) { - error("Request for xfer on unallocated channel %d", channel); + pr_err("Request for xfer on unallocated channel %d", channel); return -1; } writel(BIT_MASK(channel), &dma->int_tc_clear); @@ -117,7 +117,7 @@ int lpc32xx_dma_wait_status(unsigned int channel) /* Check if given channel is valid */ if (unlikely(channel >= DMA_NO_OF_CHANNELS)) { - error("Request for status on unallocated channel %d", channel); + pr_err("Request for status on unallocated channel %d", channel); return -1; } @@ -129,7 +129,7 @@ int lpc32xx_dma_wait_status(unsigned int channel) break; if (get_timer(start) > CONFIG_SYS_HZ) { - error("DMA status timeout channel %d\n", channel); + pr_err("DMA status timeout channel %d\n", channel); return -ETIMEDOUT; } udelay(1); @@ -138,7 +138,7 @@ int lpc32xx_dma_wait_status(unsigned int channel) if (unlikely(readl(&dma->raw_err_stat) & BIT_MASK(channel))) { setbits_le32(&dma->int_err_clear, BIT_MASK(channel)); setbits_le32(&dma->raw_err_stat, BIT_MASK(channel)); - error("DMA error on channel %d\n", channel); + pr_err("DMA error on channel %d\n", channel); return -1; } setbits_le32(&dma->int_tc_clear, BIT_MASK(channel)); diff --git a/drivers/dma/ti-edma3.c b/drivers/dma/ti-edma3.c index 39e97930135a..635eb7876d55 100644 --- a/drivers/dma/ti-edma3.c +++ b/drivers/dma/ti-edma3.c @@ -491,7 +491,7 @@ static int ti_edma3_transfer(struct udevice *dev, int direction, void *dst, __edma3_transfer(priv->base, 1, dst, src, len); break; default: - error("Transfer type not implemented in DMA driver\n"); + pr_err("Transfer type not implemented in DMA driver\n"); break; } diff --git a/drivers/i2c/i2c-gpio.c b/drivers/i2c/i2c-gpio.c index aeeb304a876f..4e8fa214739a 100644 --- a/drivers/i2c/i2c-gpio.c +++ b/drivers/i2c/i2c-gpio.c @@ -322,7 +322,7 @@ static int i2c_gpio_ofdata_to_platdata(struct udevice *dev) return 0; error: - error("Can't get %s gpios! Error: %d", dev->name, ret); + pr_err("Can't get %s gpios! Error: %d", dev->name, ret); return ret; } diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c index c98c6276ddb4..5d3381514621 100644 --- a/drivers/i2c/omap24xx_i2c.c +++ b/drivers/i2c/omap24xx_i2c.c @@ -755,7 +755,7 @@ static uint omap24_i2c_setspeed(struct i2c_adapter *adap, uint speed) ret = __omap24_i2c_setspeed(i2c_base, speed, &adap->waitdelay); if (ret) { - error("%s: set i2c speed failed\n", __func__); + pr_err("%s: set i2c speed failed\n", __func__); return ret; } diff --git a/drivers/i2c/stm32f7_i2c.c b/drivers/i2c/stm32f7_i2c.c index bf5fefab7bfb..196f2365ea5f 100644 --- a/drivers/i2c/stm32f7_i2c.c +++ b/drivers/i2c/stm32f7_i2c.c @@ -549,7 +549,7 @@ static int stm32_i2c_compute_solutions(struct stm32_i2c_setup *setup, } if (list_empty(solutions)) { - error("%s: no Prescaler solution\n", __func__); + pr_err("%s: no Prescaler solution\n", __func__); ret = -EPERM; } @@ -627,7 +627,7 @@ static int stm32_i2c_choose_solution(struct stm32_i2c_setup *setup, } if (!s) { - error("%s: no solution at all\n", __func__); + pr_err("%s: no solution at all\n", __func__); ret = -EPERM; } @@ -643,14 +643,14 @@ static int stm32_i2c_compute_timing(struct stm32_i2c_priv *i2c_priv, int ret; if (setup->speed >= STM32_I2C_SPEED_END) { - error("%s: speed out of bound {%d/%d}\n", __func__, + pr_err("%s: speed out of bound {%d/%d}\n", __func__, setup->speed, STM32_I2C_SPEED_END - 1); return -EINVAL; } if ((setup->rise_time > i2c_specs[setup->speed].rise_max) || (setup->fall_time > i2c_specs[setup->speed].fall_max)) { - error("%s :timings out of bound Rise{%d>%d}/Fall{%d>%d}\n", + pr_err("%s :timings out of bound Rise{%d>%d}/Fall{%d>%d}\n", __func__, setup->rise_time, i2c_specs[setup->speed].rise_max, setup->fall_time, i2c_specs[setup->speed].fall_max); @@ -658,13 +658,13 @@ static int stm32_i2c_compute_timing(struct stm32_i2c_priv *i2c_priv, } if (setup->dnf > STM32_I2C_DNF_MAX) { - error("%s: DNF out of bound %d/%d\n", __func__, + pr_err("%s: DNF out of bound %d/%d\n", __func__, setup->dnf, STM32_I2C_DNF_MAX); return -EINVAL; } if (setup->speed_freq > i2c_specs[setup->speed].rate) { - error("%s: Freq {%d/%d}\n", __func__, + pr_err("%s: Freq {%d/%d}\n", __func__, setup->speed_freq, i2c_specs[setup->speed].rate); return -EINVAL; } @@ -711,7 +711,7 @@ static int stm32_i2c_setup_timing(struct stm32_i2c_priv *i2c_priv, setup->clock_src = clk_get_rate(&i2c_priv->clk); if (!setup->clock_src) { - error("%s: clock rate is 0\n", __func__); + pr_err("%s: clock rate is 0\n", __func__); return -EINVAL; } @@ -734,7 +734,7 @@ static int stm32_i2c_setup_timing(struct stm32_i2c_priv *i2c_priv, } while (ret); if (ret) { - error("%s: impossible to compute I2C timings.\n", __func__); + pr_err("%s: impossible to compute I2C timings.\n", __func__); return ret; } diff --git a/drivers/i2c/tegra_i2c.c b/drivers/i2c/tegra_i2c.c index 3255e8ed3709..7d23e51b69d2 100644 --- a/drivers/i2c/tegra_i2c.c +++ b/drivers/i2c/tegra_i2c.c @@ -372,12 +372,12 @@ static int tegra_i2c_probe(struct udevice *dev) ret = reset_get_by_name(dev, "i2c", &i2c_bus->reset_ctl); if (ret) { - error("reset_get_by_name() failed: %d\n", ret); + pr_err("reset_get_by_name() failed: %d\n", ret); return ret; } ret = clk_get_by_name(dev, "div-clk", &i2c_bus->clk); if (ret) { - error("clk_get_by_name() failed: %d\n", ret); + pr_err("clk_get_by_name() failed: %d\n", ret); return ret; } diff --git a/drivers/misc/tegra186_bpmp.c b/drivers/misc/tegra186_bpmp.c index d61bacfc44f2..1fdf8efff3b9 100644 --- a/drivers/misc/tegra186_bpmp.c +++ b/drivers/misc/tegra186_bpmp.c @@ -44,7 +44,7 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg, ret = tegra_ivc_write_get_next_frame(&priv->ivc, &ivc_frame); if (ret) { - error("tegra_ivc_write_get_next_frame() failed: %d\n", ret); + pr_err("tegra_ivc_write_get_next_frame() failed: %d\n", ret); return ret; } @@ -55,7 +55,7 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg, ret = tegra_ivc_write_advance(&priv->ivc); if (ret) { - error("tegra_ivc_write_advance() failed: %d\n", ret); + pr_err("tegra_ivc_write_advance() failed: %d\n", ret); return ret; } @@ -63,7 +63,7 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg, for (;;) { ret = tegra_ivc_channel_notified(&priv->ivc); if (ret) { - error("tegra_ivc_channel_notified() failed: %d\n", ret); + pr_err("tegra_ivc_channel_notified() failed: %d\n", ret); return ret; } @@ -73,7 +73,7 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg, /* Timeout 20ms; roughly 10x current max observed duration */ if ((timer_get_us() - start_time) > 20 * 1000) { - error("tegra_ivc_read_get_next_frame() timed out (%d)\n", + pr_err("tegra_ivc_read_get_next_frame() timed out (%d)\n", ret); return -ETIMEDOUT; } @@ -86,12 +86,12 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg, ret = tegra_ivc_read_advance(&priv->ivc); if (ret) { - error("tegra_ivc_write_advance() failed: %d\n", ret); + pr_err("tegra_ivc_write_advance() failed: %d\n", ret); return ret; } if (err) { - error("BPMP responded with error %d\n", err); + pr_err("BPMP responded with error %d\n", err); /* err isn't a U-Boot error code, so don't that */ return -EIO; } @@ -144,14 +144,14 @@ static ulong tegra186_bpmp_get_shmem(struct udevice *dev, int index) ret = fdtdec_parse_phandle_with_args(gd->fdt_blob, dev_of_offset(dev), "shmem", NULL, 0, index, &args); if (ret < 0) { - error("fdtdec_parse_phandle_with_args() failed: %d\n", ret); + pr_err("fdtdec_parse_phandle_with_args() failed: %d\n", ret); return ret; } reg = fdtdec_get_addr_size_auto_noparent(gd->fdt_blob, args.node, "reg", 0, NULL, true); if (reg == FDT_ADDR_T_NONE) { - error("fdtdec_get_addr_size_auto_noparent() failed\n"); + pr_err("fdtdec_get_addr_size_auto_noparent() failed\n"); return -ENODEV; } @@ -166,7 +166,7 @@ static void tegra186_bpmp_ivc_notify(struct tegra_ivc *ivc) ret = mbox_send(&priv->mbox, NULL); if (ret) - error("mbox_send() failed: %d\n", ret); + pr_err("mbox_send() failed: %d\n", ret); } static int tegra186_bpmp_probe(struct udevice *dev) @@ -179,18 +179,18 @@ static int tegra186_bpmp_probe(struct udevice *dev) ret = mbox_get_by_index(dev, 0, &priv->mbox); if (ret) { - error("mbox_get_by_index() failed: %d\n", ret); + pr_err("mbox_get_by_index() failed: %d\n", ret); return ret; } tx_base = tegra186_bpmp_get_shmem(dev, 0); if (IS_ERR_VALUE(tx_base)) { - error("tegra186_bpmp_get_shmem failed for tx_base\n"); + pr_err("tegra186_bpmp_get_shmem failed for tx_base\n"); return tx_base; } rx_base = tegra186_bpmp_get_shmem(dev, 1); if (IS_ERR_VALUE(rx_base)) { - error("tegra186_bpmp_get_shmem failed for rx_base\n"); + pr_err("tegra186_bpmp_get_shmem failed for rx_base\n"); return rx_base; } debug("shmem: rx=%lx, tx=%lx\n", rx_base, tx_base); @@ -198,7 +198,7 @@ static int tegra186_bpmp_probe(struct udevice *dev) ret = tegra_ivc_init(&priv->ivc, rx_base, tx_base, BPMP_IVC_FRAME_COUNT, BPMP_IVC_FRAME_SIZE, tegra186_bpmp_ivc_notify); if (ret) { - error("tegra_ivc_init() failed: %d\n", ret); + pr_err("tegra_ivc_init() failed: %d\n", ret); return ret; } @@ -211,7 +211,7 @@ static int tegra186_bpmp_probe(struct udevice *dev) /* Timeout 100ms */ if ((timer_get_us() - start_time) > 100 * 1000) { - error("Initial IVC reset timed out (%d)\n", ret); + pr_err("Initial IVC reset timed out (%d)\n", ret); ret = -ETIMEDOUT; goto err_free_mbox; } diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 40f7892ac80b..5edd383c6848 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -155,7 +155,7 @@ static int exynos_dwmci_get_config(const void *blob, int node, priv = malloc(sizeof(struct dwmci_exynos_priv_data)); if (!priv) { - error("dwmci_exynos_priv_data malloc fail!\n"); + pr_err("dwmci_exynos_priv_data malloc fail!\n"); return -ENOMEM; } diff --git a/drivers/mmc/hi6220_dw_mmc.c b/drivers/mmc/hi6220_dw_mmc.c index d795198534b7..44a8ef825f32 100644 --- a/drivers/mmc/hi6220_dw_mmc.c +++ b/drivers/mmc/hi6220_dw_mmc.c @@ -44,7 +44,7 @@ int hi6220_dwmci_add_port(int index, u32 regbase, int bus_width) host = calloc(1, sizeof(struct dwmci_host)); if (!host) { - error("dwmci_host calloc failed!\n"); + pr_err("dwmci_host calloc failed!\n"); return -ENOMEM; } diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c index 2b7cb7f6b66a..490a01f9bdb8 100644 --- a/drivers/mmc/xenon_sdhci.c +++ b/drivers/mmc/xenon_sdhci.c @@ -159,7 +159,7 @@ static int xenon_mmc_phy_init(struct sdhci_host *host) } if (time <= 0) { - error("Failed to enable MMC internal clock in time\n"); + pr_err("Failed to enable MMC internal clock in time\n"); return -ETIMEDOUT; } @@ -187,7 +187,7 @@ static int xenon_mmc_phy_init(struct sdhci_host *host) } if (time <= 0) { - error("Failed to init MMC PHY in time\n"); + pr_err("Failed to init MMC PHY in time\n"); return -ETIMEDOUT; } diff --git a/drivers/mtd/nand/lpc32xx_nand_mlc.c b/drivers/mtd/nand/lpc32xx_nand_mlc.c index 3af7e6dfac69..e1b36706cab3 100644 --- a/drivers/mtd/nand/lpc32xx_nand_mlc.c +++ b/drivers/mtd/nand/lpc32xx_nand_mlc.c @@ -583,21 +583,21 @@ void board_nand_init(void) /* identify chip */ ret = nand_scan_ident(mtd, CONFIG_SYS_MAX_NAND_CHIPS, NULL); if (ret) { - error("nand_scan_ident returned %i", ret); + pr_err("nand_scan_ident returned %i", ret); return; } /* finish scanning the chip */ ret = nand_scan_tail(mtd); if (ret) { - error("nand_scan_tail returned %i", ret); + pr_err("nand_scan_tail returned %i", ret); return; } /* chip is good, register it */ ret = nand_register(0, mtd); if (ret) - error("nand_register returned %i", ret); + pr_err("nand_register returned %i", ret); } #else /* defined(CONFIG_SPL_BUILD) */ diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 0042a7ba11df..6ab3c8a25add 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1559,7 +1559,7 @@ static int pxa3xx_nand_probe_dt(struct pxa3xx_nand_info *info) pdata->num_cs = fdtdec_get_int(blob, node, "num-cs", 1); if (pdata->num_cs != 1) { - error("pxa3xx driver supports single CS only\n"); + pr_err("pxa3xx driver supports single CS only\n"); break; } diff --git a/drivers/net/bcm-sf2-eth-gmac.c b/drivers/net/bcm-sf2-eth-gmac.c index 9ff72fa1edc7..a2b594ed739a 100644 --- a/drivers/net/bcm-sf2-eth-gmac.c +++ b/drivers/net/bcm-sf2-eth-gmac.c @@ -610,7 +610,7 @@ int gmac_miiphy_read(struct mii_dev *bus, int phyaddr, int devad, int reg) /* Busy wait timeout is 1ms */ if (gmac_mii_busywait(1000)) { - error("%s: Prepare MII read: MII/MDIO busy\n", __func__); + pr_err("%s: Prepare MII read: MII/MDIO busy\n", __func__); return -1; } @@ -622,7 +622,7 @@ int gmac_miiphy_read(struct mii_dev *bus, int phyaddr, int devad, int reg) writel(tmp, GMAC_MII_DATA_ADDR); if (gmac_mii_busywait(1000)) { - error("%s: MII read failure: MII/MDIO busy\n", __func__); + pr_err("%s: MII read failure: MII/MDIO busy\n", __func__); return -1; } @@ -638,7 +638,7 @@ int gmac_miiphy_write(struct mii_dev *bus, int phyaddr, int devad, int reg, /* Busy wait timeout is 1ms */ if (gmac_mii_busywait(1000)) { - error("%s: Prepare MII write: MII/MDIO busy\n", __func__); + pr_err("%s: Prepare MII write: MII/MDIO busy\n", __func__); return -1; } @@ -651,7 +651,7 @@ int gmac_miiphy_write(struct mii_dev *bus, int phyaddr, int devad, int reg, writel(tmp, GMAC_MII_DATA_ADDR); if (gmac_mii_busywait(1000)) { - error("%s: MII write failure: MII/MDIO busy\n", __func__); + pr_err("%s: MII write failure: MII/MDIO busy\n", __func__); return -1; } @@ -742,7 +742,7 @@ int gmac_set_speed(int speed, int duplex) } else if (speed == 10) { speed_cfg = 0; } else { - error("%s: Invalid GMAC speed(%d)!\n", __func__, speed); + pr_err("%s: Invalid GMAC speed(%d)!\n", __func__, speed); return -1; } @@ -820,7 +820,7 @@ int gmac_mac_init(struct eth_device *dev) writel(0, GMAC0_INT_STATUS_ADDR); if (dma_init(dma) < 0) { - error("%s: GMAC dma_init failed\n", __func__); + pr_err("%s: GMAC dma_init failed\n", __func__); goto err_exit; } @@ -855,7 +855,7 @@ int gmac_mac_init(struct eth_device *dev) writel(tmp, GMAC_MII_CTRL_ADDR); if (gmac_mii_busywait(1000)) { - error("%s: Configure MDIO: MII/MDIO busy\n", __func__); + pr_err("%s: Configure MDIO: MII/MDIO busy\n", __func__); goto err_exit; } diff --git a/drivers/net/bcm-sf2-eth.c b/drivers/net/bcm-sf2-eth.c index e2747365a20b..9056f71b9ace 100644 --- a/drivers/net/bcm-sf2-eth.c +++ b/drivers/net/bcm-sf2-eth.c @@ -40,7 +40,7 @@ static int bcm_sf2_eth_init(struct eth_device *dev) rc = eth->mac_init(dev); if (rc) { - error("%s: Couldn't cofigure MAC!\n", __func__); + pr_err("%s: Couldn't cofigure MAC!\n", __func__); return rc; } @@ -90,7 +90,7 @@ static int bcm_sf2_eth_send(struct eth_device *dev, void *packet, int length) debug("."); i++; if (i > 20) { - error("%s: Tx timeout: retried 20 times\n", __func__); + pr_err("%s: Tx timeout: retried 20 times\n", __func__); rc = -1; break; } @@ -117,7 +117,7 @@ static int bcm_sf2_eth_receive(struct eth_device *dev) debug("\nNO More Rx\n"); break; } else if ((rcvlen == 0) || (rcvlen > RX_BUF_SIZE)) { - error("%s: Wrong Ethernet packet size (%d B), skip!\n", + pr_err("%s: Wrong Ethernet packet size (%d B), skip!\n", __func__, rcvlen); break; } else { @@ -166,9 +166,9 @@ static int bcm_sf2_eth_open(struct eth_device *dev, bd_t *bt) */ for (i = 0; i < eth->port_num; i++) { if (phy_startup(eth->port[i])) { - error("%s: PHY %d startup failed!\n", __func__, i); + pr_err("%s: PHY %d startup failed!\n", __func__, i); if (i == CONFIG_BCM_SF2_ETH_DEFAULT_PORT) { - error("%s: No default port %d!\n", __func__, i); + pr_err("%s: No default port %d!\n", __func__, i); return -1; } } @@ -205,13 +205,13 @@ int bcm_sf2_eth_register(bd_t *bis, u8 dev_num) dev = (struct eth_device *)malloc(sizeof(struct eth_device)); if (dev == NULL) { - error("%s: Not enough memory!\n", __func__); + pr_err("%s: Not enough memory!\n", __func__); return -1; } eth = (struct eth_info *)malloc(sizeof(struct eth_info)); if (eth == NULL) { - error("%s: Not enough memory!\n", __func__); + pr_err("%s: Not enough memory!\n", __func__); return -1; } @@ -234,7 +234,7 @@ int bcm_sf2_eth_register(bd_t *bis, u8 dev_num) if (gmac_add(dev)) { free(eth); free(dev); - error("%s: Adding GMAC failed!\n", __func__); + pr_err("%s: Adding GMAC failed!\n", __func__); return -1; } #else @@ -263,7 +263,7 @@ int bcm_sf2_eth_register(bd_t *bis, u8 dev_num) rc = bcm_sf2_eth_init(dev); if (rc != 0) { - error("%s: configuration failed!\n", __func__); + pr_err("%s: configuration failed!\n", __func__); return -1; } diff --git a/drivers/net/cpsw-common.c b/drivers/net/cpsw-common.c index 8970ee00af30..0dc83ab82052 100644 --- a/drivers/net/cpsw-common.c +++ b/drivers/net/cpsw-common.c @@ -29,14 +29,14 @@ static int davinci_emac_3517_get_macid(struct udevice *dev, u16 offset, syscon = fdtdec_lookup_phandle(fdt, node, "syscon"); if (syscon < 0) { - error("Syscon offset not found\n"); + pr_err("Syscon offset not found\n"); return -ENOENT; } addr = (u32)map_physmem(fdt_translate_address(fdt, syscon, &gmii), sizeof(u32), MAP_NOCACHE); if (addr == FDT_ADDR_T_NONE) { - error("Not able to get syscon address to get mac efuse address\n"); + pr_err("Not able to get syscon address to get mac efuse address\n"); return -ENOENT; } @@ -69,14 +69,14 @@ static int cpsw_am33xx_cm_get_macid(struct udevice *dev, u16 offset, int slave, syscon = fdtdec_lookup_phandle(fdt, node, "syscon"); if (syscon < 0) { - error("Syscon offset not found\n"); + pr_err("Syscon offset not found\n"); return -ENOENT; } addr = (u32)map_physmem(fdt_translate_address(fdt, syscon, &gmii), sizeof(u32), MAP_NOCACHE); if (addr == FDT_ADDR_T_NONE) { - error("Not able to get syscon address to get mac efuse address\n"); + pr_err("Not able to get syscon address to get mac efuse address\n"); return -ENOENT; } diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c index d7db0fc432f7..b72258f83bfe 100644 --- a/drivers/net/cpsw.c +++ b/drivers/net/cpsw.c @@ -1368,7 +1368,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev) mdio_base = cpsw_get_addr_by_node(fdt, subnode); if (mdio_base == FDT_ADDR_T_NONE) { - error("Not able to get MDIO address space\n"); + pr_err("Not able to get MDIO address space\n"); return -ENOENT; } priv->data.mdio_base = mdio_base; @@ -1407,7 +1407,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev) subnode); if (priv->data.gmii_sel == FDT_ADDR_T_NONE) { - error("Not able to get gmii_sel reg address\n"); + pr_err("Not able to get gmii_sel reg address\n"); return -ENOENT; } @@ -1418,7 +1418,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev) phy_sel_compat = fdt_getprop(fdt, subnode, "compatible", NULL); if (!phy_sel_compat) { - error("Not able to get gmii_sel compatible\n"); + pr_err("Not able to get gmii_sel compatible\n"); return -ENOENT; } } @@ -1434,7 +1434,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev) ret = ti_cm_get_macid(dev, active_slave, pdata->enetaddr); if (ret < 0) { - error("cpsw read efuse mac failed\n"); + pr_err("cpsw read efuse mac failed\n"); return ret; } diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c index 5c4315ffeaad..00076cffbed2 100644 --- a/drivers/net/dwc_eth_qos.c +++ b/drivers/net/dwc_eth_qos.c @@ -377,7 +377,7 @@ static int eqos_mdio_read(struct mii_dev *bus, int mdio_addr, int mdio_devad, ret = eqos_mdio_wait_idle(eqos); if (ret) { - error("MDIO not idle at entry"); + pr_err("MDIO not idle at entry"); return ret; } @@ -397,7 +397,7 @@ static int eqos_mdio_read(struct mii_dev *bus, int mdio_addr, int mdio_devad, ret = eqos_mdio_wait_idle(eqos); if (ret) { - error("MDIO read didn't complete"); + pr_err("MDIO read didn't complete"); return ret; } @@ -421,7 +421,7 @@ static int eqos_mdio_write(struct mii_dev *bus, int mdio_addr, int mdio_devad, ret = eqos_mdio_wait_idle(eqos); if (ret) { - error("MDIO not idle at entry"); + pr_err("MDIO not idle at entry"); return ret; } @@ -443,7 +443,7 @@ static int eqos_mdio_write(struct mii_dev *bus, int mdio_addr, int mdio_devad, ret = eqos_mdio_wait_idle(eqos); if (ret) { - error("MDIO read didn't complete"); + pr_err("MDIO read didn't complete"); return ret; } @@ -459,37 +459,37 @@ static int eqos_start_clks_tegra186(struct udevice *dev) ret = clk_enable(&eqos->clk_slave_bus); if (ret < 0) { - error("clk_enable(clk_slave_bus) failed: %d", ret); + pr_err("clk_enable(clk_slave_bus) failed: %d", ret); goto err; } ret = clk_enable(&eqos->clk_master_bus); if (ret < 0) { - error("clk_enable(clk_master_bus) failed: %d", ret); + pr_err("clk_enable(clk_master_bus) failed: %d", ret); goto err_disable_clk_slave_bus; } ret = clk_enable(&eqos->clk_rx); if (ret < 0) { - error("clk_enable(clk_rx) failed: %d", ret); + pr_err("clk_enable(clk_rx) failed: %d", ret); goto err_disable_clk_master_bus; } ret = clk_enable(&eqos->clk_ptp_ref); if (ret < 0) { - error("clk_enable(clk_ptp_ref) failed: %d", ret); + pr_err("clk_enable(clk_ptp_ref) failed: %d", ret); goto err_disable_clk_rx; } ret = clk_set_rate(&eqos->clk_ptp_ref, 125 * 1000 * 1000); if (ret < 0) { - error("clk_set_rate(clk_ptp_ref) failed: %d", ret); + pr_err("clk_set_rate(clk_ptp_ref) failed: %d", ret); goto err_disable_clk_ptp_ref; } ret = clk_enable(&eqos->clk_tx); if (ret < 0) { - error("clk_enable(clk_tx) failed: %d", ret); + pr_err("clk_enable(clk_tx) failed: %d", ret); goto err_disable_clk_ptp_ref; } @@ -533,7 +533,7 @@ static int eqos_start_resets_tegra186(struct udevice *dev) ret = dm_gpio_set_value(&eqos->phy_reset_gpio, 1); if (ret < 0) { - error("dm_gpio_set_value(phy_reset, assert) failed: %d", ret); + pr_err("dm_gpio_set_value(phy_reset, assert) failed: %d", ret); return ret; } @@ -541,13 +541,13 @@ static int eqos_start_resets_tegra186(struct udevice *dev) ret = dm_gpio_set_value(&eqos->phy_reset_gpio, 0); if (ret < 0) { - error("dm_gpio_set_value(phy_reset, deassert) failed: %d", ret); + pr_err("dm_gpio_set_value(phy_reset, deassert) failed: %d", ret); return ret; } ret = reset_assert(&eqos->reset_ctl); if (ret < 0) { - error("reset_assert() failed: %d", ret); + pr_err("reset_assert() failed: %d", ret); return ret; } @@ -555,7 +555,7 @@ static int eqos_start_resets_tegra186(struct udevice *dev) ret = reset_deassert(&eqos->reset_ctl); if (ret < 0) { - error("reset_deassert() failed: %d", ret); + pr_err("reset_deassert() failed: %d", ret); return ret; } @@ -591,14 +591,14 @@ static int eqos_calibrate_pads_tegra186(struct udevice *dev) ret = wait_for_bit(__func__, &eqos->tegra186_regs->auto_cal_status, EQOS_AUTO_CAL_STATUS_ACTIVE, true, 10, false); if (ret) { - error("calibrate didn't start"); + pr_err("calibrate didn't start"); goto failed; } ret = wait_for_bit(__func__, &eqos->tegra186_regs->auto_cal_status, EQOS_AUTO_CAL_STATUS_ACTIVE, false, 10, false); if (ret) { - error("calibrate didn't finish"); + pr_err("calibrate didn't finish"); goto failed; } @@ -713,13 +713,13 @@ static int eqos_set_tx_clk_speed_tegra186(struct udevice *dev) rate = 2.5 * 1000 * 1000; break; default: - error("invalid speed %d", eqos->phy->speed); + pr_err("invalid speed %d", eqos->phy->speed); return -EINVAL; } ret = clk_set_rate(&eqos->clk_tx, rate); if (ret < 0) { - error("clk_set_rate(tx_clk, %lu) failed: %d", rate, ret); + pr_err("clk_set_rate(tx_clk, %lu) failed: %d", rate, ret); return ret; } @@ -739,7 +739,7 @@ static int eqos_adjust_link(struct udevice *dev) else ret = eqos_set_half_duplex(dev); if (ret < 0) { - error("eqos_set_*_duplex() failed: %d", ret); + pr_err("eqos_set_*_duplex() failed: %d", ret); return ret; } @@ -757,24 +757,24 @@ static int eqos_adjust_link(struct udevice *dev) ret = eqos_set_mii_speed_10(dev); break; default: - error("invalid speed %d", eqos->phy->speed); + pr_err("invalid speed %d", eqos->phy->speed); return -EINVAL; } if (ret < 0) { - error("eqos_set_*mii_speed*() failed: %d", ret); + pr_err("eqos_set_*mii_speed*() failed: %d", ret); return ret; } if (en_calibration) { ret = eqos_calibrate_pads_tegra186(dev); if (ret < 0) { - error("eqos_calibrate_pads_tegra186() failed: %d", ret); + pr_err("eqos_calibrate_pads_tegra186() failed: %d", ret); return ret; } } else { ret = eqos_disable_calibration_tegra186(dev); if (ret < 0) { - error("eqos_disable_calibration_tegra186() failed: %d", + pr_err("eqos_disable_calibration_tegra186() failed: %d", ret); return ret; } @@ -782,7 +782,7 @@ static int eqos_adjust_link(struct udevice *dev) ret = eqos_set_tx_clk_speed_tegra186(dev); if (ret < 0) { - error("eqos_set_tx_clk_speed_tegra186() failed: %d", ret); + pr_err("eqos_set_tx_clk_speed_tegra186() failed: %d", ret); return ret; } @@ -848,13 +848,13 @@ static int eqos_start(struct udevice *dev) ret = eqos_start_clks_tegra186(dev); if (ret < 0) { - error("eqos_start_clks_tegra186() failed: %d", ret); + pr_err("eqos_start_clks_tegra186() failed: %d", ret); goto err; } ret = eqos_start_resets_tegra186(dev); if (ret < 0) { - error("eqos_start_resets_tegra186() failed: %d", ret); + pr_err("eqos_start_resets_tegra186() failed: %d", ret); goto err_stop_clks; } @@ -865,13 +865,13 @@ static int eqos_start(struct udevice *dev) ret = wait_for_bit(__func__, &eqos->dma_regs->mode, EQOS_DMA_MODE_SWR, false, 10, false); if (ret) { - error("EQOS_DMA_MODE_SWR stuck"); + pr_err("EQOS_DMA_MODE_SWR stuck"); goto err_stop_resets; } ret = eqos_calibrate_pads_tegra186(dev); if (ret < 0) { - error("eqos_calibrate_pads_tegra186() failed: %d", ret); + pr_err("eqos_calibrate_pads_tegra186() failed: %d", ret); goto err_stop_resets; } @@ -881,28 +881,28 @@ static int eqos_start(struct udevice *dev) eqos->phy = phy_connect(eqos->mii, 0, dev, 0); if (!eqos->phy) { - error("phy_connect() failed"); + pr_err("phy_connect() failed"); goto err_stop_resets; } ret = phy_config(eqos->phy); if (ret < 0) { - error("phy_config() failed: %d", ret); + pr_err("phy_config() failed: %d", ret); goto err_shutdown_phy; } ret = phy_startup(eqos->phy); if (ret < 0) { - error("phy_startup() failed: %d", ret); + pr_err("phy_startup() failed: %d", ret); goto err_shutdown_phy; } if (!eqos->phy->link) { - error("No link"); + pr_err("No link"); goto err_shutdown_phy; } ret = eqos_adjust_link(dev); if (ret < 0) { - error("eqos_adjust_link() failed: %d", ret); + pr_err("eqos_adjust_link() failed: %d", ret); goto err_shutdown_phy; } @@ -1119,7 +1119,7 @@ err_stop_resets: err_stop_clks: eqos_stop_clks_tegra186(dev); err: - error("FAILED: %d", ret); + pr_err("FAILED: %d", ret); return ret; } @@ -1361,7 +1361,7 @@ static int eqos_probe_resources_tegra186(struct udevice *dev) ret = reset_get_by_name(dev, "eqos", &eqos->reset_ctl); if (ret) { - error("reset_get_by_name(rst) failed: %d", ret); + pr_err("reset_get_by_name(rst) failed: %d", ret); return ret; } @@ -1369,38 +1369,38 @@ static int eqos_probe_resources_tegra186(struct udevice *dev) &eqos->phy_reset_gpio, GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE); if (ret) { - error("gpio_request_by_name(phy reset) failed: %d", ret); + pr_err("gpio_request_by_name(phy reset) failed: %d", ret); goto err_free_reset_eqos; } ret = clk_get_by_name(dev, "slave_bus", &eqos->clk_slave_bus); if (ret) { - error("clk_get_by_name(slave_bus) failed: %d", ret); + pr_err("clk_get_by_name(slave_bus) failed: %d", ret); goto err_free_gpio_phy_reset; } ret = clk_get_by_name(dev, "master_bus", &eqos->clk_master_bus); if (ret) { - error("clk_get_by_name(master_bus) failed: %d", ret); + pr_err("clk_get_by_name(master_bus) failed: %d", ret); goto err_free_clk_slave_bus; } ret = clk_get_by_name(dev, "rx", &eqos->clk_rx); if (ret) { - error("clk_get_by_name(rx) failed: %d", ret); + pr_err("clk_get_by_name(rx) failed: %d", ret); goto err_free_clk_master_bus; } ret = clk_get_by_name(dev, "ptp_ref", &eqos->clk_ptp_ref); if (ret) { - error("clk_get_by_name(ptp_ref) failed: %d", ret); + pr_err("clk_get_by_name(ptp_ref) failed: %d", ret); goto err_free_clk_rx; return ret; } ret = clk_get_by_name(dev, "tx", &eqos->clk_tx); if (ret) { - error("clk_get_by_name(tx) failed: %d", ret); + pr_err("clk_get_by_name(tx) failed: %d", ret); goto err_free_clk_ptp_ref; } @@ -1454,7 +1454,7 @@ static int eqos_probe(struct udevice *dev) eqos->regs = devfdt_get_addr(dev); if (eqos->regs == FDT_ADDR_T_NONE) { - error("devfdt_get_addr() failed"); + pr_err("devfdt_get_addr() failed"); return -ENODEV; } eqos->mac_regs = (void *)(eqos->regs + EQOS_MAC_REGS_BASE); @@ -1464,19 +1464,19 @@ static int eqos_probe(struct udevice *dev) ret = eqos_probe_resources_core(dev); if (ret < 0) { - error("eqos_probe_resources_core() failed: %d", ret); + pr_err("eqos_probe_resources_core() failed: %d", ret); return ret; } ret = eqos_probe_resources_tegra186(dev); if (ret < 0) { - error("eqos_probe_resources_tegra186() failed: %d", ret); + pr_err("eqos_probe_resources_tegra186() failed: %d", ret); goto err_remove_resources_core; } eqos->mii = mdio_alloc(); if (!eqos->mii) { - error("mdio_alloc() failed"); + pr_err("mdio_alloc() failed"); goto err_remove_resources_tegra; } eqos->mii->read = eqos_mdio_read; @@ -1486,7 +1486,7 @@ static int eqos_probe(struct udevice *dev) ret = mdio_register(eqos->mii); if (ret < 0) { - error("mdio_register() failed: %d", ret); + pr_err("mdio_register() failed: %d", ret); goto err_free_mdio; } diff --git a/drivers/net/ep93xx_eth.c b/drivers/net/ep93xx_eth.c index a94191b9e671..bc4570624332 100644 --- a/drivers/net/ep93xx_eth.c +++ b/drivers/net/ep93xx_eth.c @@ -324,7 +324,7 @@ static int ep93xx_eth_rcv_packet(struct eth_device *dev) debug("reporting %d bytes...\n", len); } else { /* Do we have an erroneous packet? */ - error("packet rx error, status %08X %08X", + pr_err("packet rx error, status %08X %08X", priv->rx_sq.current->word1, priv->rx_sq.current->word2); dump_rx_descriptor_queue(dev); @@ -401,7 +401,7 @@ static int ep93xx_eth_send_packet(struct eth_device *dev, ; /* noop */ if (!TX_STATUS_TXWE(priv->tx_sq.current)) { - error("packet tx error, status %08X", + pr_err("packet tx error, status %08X", priv->tx_sq.current->word1); dump_tx_descriptor_queue(dev); dump_tx_status_queue(dev); @@ -452,7 +452,7 @@ int ep93xx_eth_initialize(u8 dev_num, int base_addr) priv = malloc(sizeof(*priv)); if (!priv) { - error("malloc() failed"); + pr_err("malloc() failed"); goto eth_init_failed_0; } memset(priv, 0, sizeof(*priv)); @@ -462,34 +462,34 @@ int ep93xx_eth_initialize(u8 dev_num, int base_addr) priv->tx_dq.base = calloc(NUMTXDESC, sizeof(struct tx_descriptor)); if (priv->tx_dq.base == NULL) { - error("calloc() failed"); + pr_err("calloc() failed"); goto eth_init_failed_1; } priv->tx_sq.base = calloc(NUMTXDESC, sizeof(struct tx_status)); if (priv->tx_sq.base == NULL) { - error("calloc() failed"); + pr_err("calloc() failed"); goto eth_init_failed_2; } priv->rx_dq.base = calloc(NUMRXDESC, sizeof(struct rx_descriptor)); if (priv->rx_dq.base == NULL) { - error("calloc() failed"); + pr_err("calloc() failed"); goto eth_init_failed_3; } priv->rx_sq.base = calloc(NUMRXDESC, sizeof(struct rx_status)); if (priv->rx_sq.base == NULL) { - error("calloc() failed"); + pr_err("calloc() failed"); goto eth_init_failed_4; } dev = malloc(sizeof *dev); if (dev == NULL) { - error("malloc() failed"); + pr_err("malloc() failed"); goto eth_init_failed_5; } memset(dev, 0, sizeof *dev); diff --git a/drivers/net/keystone_net.c b/drivers/net/keystone_net.c index 72ef42cca883..21ccab47ae27 100644 --- a/drivers/net/keystone_net.c +++ b/drivers/net/keystone_net.c @@ -757,7 +757,7 @@ static int ks2_eth_start(struct udevice *dev) qm_init(); if (ksnav_init(priv->netcp_pktdma, &priv->net_rx_buffs)) { - error("ksnav_init failed\n"); + pr_err("ksnav_init failed\n"); goto err_knav_init; } @@ -773,7 +773,7 @@ static int ks2_eth_start(struct udevice *dev) phy_startup(priv->phydev); if (priv->phydev->link == 0) { - error("phy startup failed\n"); + pr_err("phy startup failed\n"); goto err_phy_start; } } @@ -923,7 +923,7 @@ static int ks2_eth_probe(struct udevice *dev) */ mdio_bus = mdio_alloc(); if (!mdio_bus) { - error("MDIO alloc failed\n"); + pr_err("MDIO alloc failed\n"); return -ENOMEM; } priv->mdio_bus = mdio_bus; @@ -935,7 +935,7 @@ static int ks2_eth_probe(struct udevice *dev) ret = mdio_register(mdio_bus); if (ret) { - error("MDIO bus register failed\n"); + pr_err("MDIO bus register failed\n"); return ret; } } else { @@ -1011,7 +1011,7 @@ static int ks2_eth_bind_slaves(struct udevice *dev, int gbe, int *gbe_0) slave_name, offset_to_ofnode(slave), &sl_dev); if (ret) { - error("ks2_net - not able to bind slave interfaces\n"); + pr_err("ks2_net - not able to bind slave interfaces\n"); return ret; } } @@ -1031,7 +1031,7 @@ static int ks2_eth_bind_slaves(struct udevice *dev, int gbe, int *gbe_0) ret = device_bind_driver_to_node(dev, "eth_ks2_sl", slave_name, offset_to_ofnode(slave), &sl_dev); if (ret) { - error("ks2_net - not able to bind slave interfaces\n"); + pr_err("ks2_net - not able to bind slave interfaces\n"); return ret; } } @@ -1074,7 +1074,7 @@ static int ks2_eth_parse_slave_interface(int netcp, int slave, mdio = fdt_parent_offset(fdt, phy); if (mdio < 0) { - error("mdio dt not found\n"); + pr_err("mdio dt not found\n"); return -ENODEV; } priv->mdio_base = (void *)fdtdec_get_addr(fdt, mdio, "reg"); diff --git a/drivers/pci/pci_tegra.c b/drivers/pci/pci_tegra.c index cb5cf8b043bd..c15d84b4c2df 100644 --- a/drivers/pci/pci_tegra.c +++ b/drivers/pci/pci_tegra.c @@ -371,7 +371,7 @@ static int tegra_pcie_port_parse_dt(ofnode node, struct tegra_pcie_port *port) addr = ofnode_get_property(node, "assigned-addresses", &len); if (!addr) { - error("property \"assigned-addresses\" not found"); + pr_err("property \"assigned-addresses\" not found"); return -FDT_ERR_NOTFOUND; } @@ -462,7 +462,7 @@ static int tegra_pcie_parse_port_info(ofnode node, uint *index, uint *lanes) err = ofnode_read_u32_default(node, "nvidia,num-lanes", -1); if (err < 0) { - error("failed to parse \"nvidia,num-lanes\" property"); + pr_err("failed to parse \"nvidia,num-lanes\" property"); return err; } @@ -470,7 +470,7 @@ static int tegra_pcie_parse_port_info(ofnode node, uint *index, uint *lanes) err = ofnode_read_pci_addr(node, 0, "reg", &addr); if (err < 0) { - error("failed to parse \"reg\" property"); + pr_err("failed to parse \"reg\" property"); return err; } @@ -493,25 +493,25 @@ static int tegra_pcie_parse_dt(struct udevice *dev, enum tegra_pci_id id, err = dev_read_resource(dev, 0, &pcie->pads); if (err < 0) { - error("resource \"pads\" not found"); + pr_err("resource \"pads\" not found"); return err; } err = dev_read_resource(dev, 1, &pcie->afi); if (err < 0) { - error("resource \"afi\" not found"); + pr_err("resource \"afi\" not found"); return err; } err = dev_read_resource(dev, 2, &pcie->cs); if (err < 0) { - error("resource \"cs\" not found"); + pr_err("resource \"cs\" not found"); return err; } err = tegra_pcie_board_init(); if (err < 0) { - error("tegra_pcie_board_init() failed: err=%d", err); + pr_err("tegra_pcie_board_init() failed: err=%d", err); return err; } @@ -520,7 +520,7 @@ static int tegra_pcie_parse_dt(struct udevice *dev, enum tegra_pci_id id, if (pcie->phy) { err = tegra_xusb_phy_prepare(pcie->phy); if (err < 0) { - error("failed to prepare PHY: %d", err); + pr_err("failed to prepare PHY: %d", err); return err; } } @@ -532,7 +532,7 @@ static int tegra_pcie_parse_dt(struct udevice *dev, enum tegra_pci_id id, err = tegra_pcie_parse_port_info(subnode, &index, &num_lanes); if (err < 0) { - error("failed to obtain root port info"); + pr_err("failed to obtain root port info"); continue; } @@ -562,7 +562,7 @@ static int tegra_pcie_parse_dt(struct udevice *dev, enum tegra_pci_id id, err = tegra_pcie_get_xbar_config(dev_ofnode(dev), lanes, id, &pcie->xbar); if (err < 0) { - error("invalid lane configuration"); + pr_err("invalid lane configuration"); return err; } @@ -576,31 +576,31 @@ static int tegra_pcie_power_on(struct tegra_pcie *pcie) ret = power_domain_on(&pcie->pwrdom); if (ret) { - error("power_domain_on() failed: %d\n", ret); + pr_err("power_domain_on() failed: %d\n", ret); return ret; } ret = clk_enable(&pcie->clk_afi); if (ret) { - error("clk_enable(afi) failed: %d\n", ret); + pr_err("clk_enable(afi) failed: %d\n", ret); return ret; } ret = clk_enable(&pcie->clk_pex); if (ret) { - error("clk_enable(pex) failed: %d\n", ret); + pr_err("clk_enable(pex) failed: %d\n", ret); return ret; } ret = reset_deassert(&pcie->reset_afi); if (ret) { - error("reset_deassert(afi) failed: %d\n", ret); + pr_err("reset_deassert(afi) failed: %d\n", ret); return ret; } ret = reset_deassert(&pcie->reset_pex); if (ret) { - error("reset_deassert(pex) failed: %d\n", ret); + pr_err("reset_deassert(pex) failed: %d\n", ret); return ret; } @@ -620,14 +620,14 @@ static int tegra_pcie_power_on(struct tegra_pcie *pcie) err = tegra_powergate_power_off(TEGRA_POWERGATE_PCIE); if (err < 0) { - error("failed to power off PCIe partition: %d", err); + pr_err("failed to power off PCIe partition: %d", err); return err; } err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_PCIE, PERIPH_ID_PCIE); if (err < 0) { - error("failed to power up PCIe partition: %d", err); + pr_err("failed to power up PCIe partition: %d", err); return err; } @@ -647,7 +647,7 @@ static int tegra_pcie_power_on(struct tegra_pcie *pcie) err = tegra_plle_enable(); if (err < 0) { - error("failed to enable PLLE: %d\n", err); + pr_err("failed to enable PLLE: %d\n", err); return err; } @@ -707,7 +707,7 @@ static int tegra_pcie_phy_enable(struct tegra_pcie *pcie) /* wait for the PLL to lock */ err = tegra_pcie_pll_wait(pcie, 500); if (err < 0) { - error("PLL failed to lock: %d", err); + pr_err("PLL failed to lock: %d", err); return err; } @@ -771,7 +771,7 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie) err = tegra_pcie_phy_enable(pcie); if (err < 0) { - error("failed to power on PHY: %d\n", err); + pr_err("failed to power on PHY: %d\n", err); return err; } #endif @@ -780,7 +780,7 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie) #ifdef CONFIG_TEGRA186 err = reset_deassert(&pcie->reset_pcie_x); if (err) { - error("reset_deassert(pcie_x) failed: %d\n", err); + pr_err("reset_deassert(pcie_x) failed: %d\n", err); return err; } #else @@ -1145,25 +1145,25 @@ static int pci_tegra_probe(struct udevice *dev) err = tegra_pcie_power_on(pcie); if (err < 0) { - error("failed to power on"); + pr_err("failed to power on"); return err; } err = tegra_pcie_enable_controller(pcie); if (err < 0) { - error("failed to enable controller"); + pr_err("failed to enable controller"); return err; } err = tegra_pcie_setup_translations(dev); if (err < 0) { - error("failed to decode ranges"); + pr_err("failed to decode ranges"); return err; } err = tegra_pcie_enable(pcie); if (err < 0) { - error("failed to enable PCIe"); + pr_err("failed to enable PCIe"); return err; } diff --git a/drivers/pci/pcie_xilinx.c b/drivers/pci/pcie_xilinx.c index 08e2e9344583..6b8b96a73432 100644 --- a/drivers/pci/pcie_xilinx.c +++ b/drivers/pci/pcie_xilinx.c @@ -189,7 +189,7 @@ static int pcie_xilinx_ofdata_to_platdata(struct udevice *dev) err = fdt_get_resource(gd->fdt_blob, dev_of_offset(dev), "reg", 0, ®_res); if (err < 0) { - error("\"reg\" resource not found\n"); + pr_err("\"reg\" resource not found\n"); return err; } diff --git a/drivers/phy/marvell/comphy_cp110.c b/drivers/phy/marvell/comphy_cp110.c index 3ac405a9be6e..37187885fa05 100644 --- a/drivers/phy/marvell/comphy_cp110.c +++ b/drivers/phy/marvell/comphy_cp110.c @@ -509,7 +509,7 @@ static int comphy_pcie_power_up(u32 lane, u32 pcie_width, bool clk_src, debug("Read from reg = %p - value = 0x%x\n", hpipe_addr + HPIPE_LANE_STATUS1_REG, data); - error("HPIPE_LANE_STATUS1_PCLK_EN_MASK is 0\n"); + pr_err("HPIPE_LANE_STATUS1_PCLK_EN_MASK is 0\n"); ret = 0; } } @@ -633,7 +633,7 @@ static int comphy_usb3_power_up(u32 lane, void __iomem *hpipe_base, if (data != 0) { debug("Read from reg = %p - value = 0x%x\n", hpipe_addr + HPIPE_LANE_STATUS1_REG, data); - error("HPIPE_LANE_STATUS1_PCLK_EN_MASK is 0\n"); + pr_err("HPIPE_LANE_STATUS1_PCLK_EN_MASK is 0\n"); ret = 0; } @@ -666,14 +666,14 @@ static int comphy_sata_power_up(u32 lane, void __iomem *hpipe_base, gd->fdt_blob, sata_node, "marvell,armada-8k-ahci"); if (sata_node == 0) { - error("SATA node not found in FDT\n"); + pr_err("SATA node not found in FDT\n"); return 0; } sata_base = (void __iomem *)fdtdec_get_addr_size_auto_noparent( gd->fdt_blob, sata_node, "reg", 0, NULL, true); if (sata_base == NULL) { - error("SATA address not found in FDT\n"); + pr_err("SATA address not found in FDT\n"); return 0; } @@ -976,7 +976,7 @@ static int comphy_sata_power_up(u32 lane, void __iomem *hpipe_base, if (data != 0) { debug("Read from reg = %p - value = 0x%x\n", hpipe_addr + HPIPE_LANE_STATUS1_REG, data); - error("SD_EXTERNAL_STATUS0_PLL_TX is %d, SD_EXTERNAL_STATUS0_PLL_RX is %d\n", + pr_err("SD_EXTERNAL_STATUS0_PLL_TX is %d, SD_EXTERNAL_STATUS0_PLL_RX is %d\n", (data & SD_EXTERNAL_STATUS0_PLL_TX_MASK), (data & SD_EXTERNAL_STATUS0_PLL_RX_MASK)); ret = 0; @@ -1099,7 +1099,7 @@ static int comphy_sgmii_power_up(u32 lane, u32 sgmii_speed, if (data != 0) { debug("Read from reg = %p - value = 0x%x\n", sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data); - error("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n", + pr_err("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n", (data & SD_EXTERNAL_STATUS0_PLL_RX_MASK), (data & SD_EXTERNAL_STATUS0_PLL_TX_MASK)); ret = 0; @@ -1117,7 +1117,7 @@ static int comphy_sgmii_power_up(u32 lane, u32 sgmii_speed, data = polling_with_timeout(addr, data, mask, 100); if (data != 0) { debug("Read from reg = %p - value = 0x%x\n", sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data); - error("SD_EXTERNAL_STATUS0_RX_INIT is 0\n"); + pr_err("SD_EXTERNAL_STATUS0_RX_INIT is 0\n"); ret = 0; } @@ -1398,7 +1398,7 @@ static int comphy_sfi_power_up(u32 lane, void __iomem *hpipe_base, data = polling_with_timeout(addr, data, mask, 15000); if (data != 0) { debug("Read from reg = %p - value = 0x%x\n", sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data); - error("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n", + pr_err("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n", (data & SD_EXTERNAL_STATUS0_PLL_RX_MASK), (data & SD_EXTERNAL_STATUS0_PLL_TX_MASK)); ret = 0; @@ -1418,7 +1418,7 @@ static int comphy_sfi_power_up(u32 lane, void __iomem *hpipe_base, if (data != 0) { debug("Read from reg = %p - value = 0x%x\n", sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data); - error("SD_EXTERNAL_STATUS0_RX_INIT is 0\n"); + pr_err("SD_EXTERNAL_STATUS0_RX_INIT is 0\n"); ret = 0; } @@ -1577,7 +1577,7 @@ static int comphy_rxauii_power_up(u32 lane, void __iomem *hpipe_base, if (data != 0) { debug("Read from reg = %p - value = 0x%x\n", sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data); - error("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n", + pr_err("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n", (data & SD_EXTERNAL_STATUS0_PLL_RX_MASK), (data & SD_EXTERNAL_STATUS0_PLL_TX_MASK)); ret = 0; @@ -1596,7 +1596,7 @@ static int comphy_rxauii_power_up(u32 lane, void __iomem *hpipe_base, if (data != 0) { debug("Read from reg = %p - value = 0x%x\n", sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data); - error("SD_EXTERNAL_STATUS0_RX_INIT is 0\n"); + pr_err("SD_EXTERNAL_STATUS0_RX_INIT is 0\n"); ret = 0; } @@ -1742,7 +1742,7 @@ static int comphy_utmi_power_up(u32 utmi_index, void __iomem *utmi_base_addr, mask = data; data = polling_with_timeout(addr, data, mask, 100); if (data != 0) { - error("Impedance calibration is not done\n"); + pr_err("Impedance calibration is not done\n"); debug("Read from reg = %p - value = 0x%x\n", addr, data); ret = 0; } @@ -1751,7 +1751,7 @@ static int comphy_utmi_power_up(u32 utmi_index, void __iomem *utmi_base_addr, mask = data; data = polling_with_timeout(addr, data, mask, 100); if (data != 0) { - error("PLL calibration is not done\n"); + pr_err("PLL calibration is not done\n"); debug("Read from reg = %p - value = 0x%x\n", addr, data); ret = 0; } @@ -1761,7 +1761,7 @@ static int comphy_utmi_power_up(u32 utmi_index, void __iomem *utmi_base_addr, mask = data; data = polling_with_timeout(addr, data, mask, 100); if (data != 0) { - error("PLL is not ready\n"); + pr_err("PLL is not ready\n"); debug("Read from reg = %p - value = 0x%x\n", addr, data); ret = 0; } @@ -1818,7 +1818,7 @@ static void comphy_utmi_phy_init(u32 utmi_phy_count, cp110_utmi_data[i].usb_cfg_addr, cp110_utmi_data[i].utmi_cfg_addr, cp110_utmi_data[i].utmi_phy_port)) { - error("Failed to initialize UTMI PHY %d\n", i); + pr_err("Failed to initialize UTMI PHY %d\n", i); continue; } printf("UTMI PHY %d initialized to ", i); @@ -1864,7 +1864,7 @@ void comphy_dedicated_phys_init(void) (void __iomem *)fdtdec_get_addr_size_auto_noparent( gd->fdt_blob, node, "reg", 0, NULL, true); if (cp110_utmi_data[i].utmi_base_addr == NULL) { - error("UTMI PHY base address is invalid\n"); + pr_err("UTMI PHY base address is invalid\n"); i++; continue; } @@ -1874,7 +1874,7 @@ void comphy_dedicated_phys_init(void) (void __iomem *)fdtdec_get_addr_size_auto_noparent( gd->fdt_blob, node, "reg", 1, NULL, true); if (cp110_utmi_data[i].usb_cfg_addr == NULL) { - error("UTMI PHY base address is invalid\n"); + pr_err("UTMI PHY base address is invalid\n"); i++; continue; } @@ -1884,7 +1884,7 @@ void comphy_dedicated_phys_init(void) (void __iomem *)fdtdec_get_addr_size_auto_noparent( gd->fdt_blob, node, "reg", 2, NULL, true); if (cp110_utmi_data[i].utmi_cfg_addr == NULL) { - error("UTMI PHY base address is invalid\n"); + pr_err("UTMI PHY base address is invalid\n"); i++; continue; } @@ -1896,7 +1896,7 @@ void comphy_dedicated_phys_init(void) cp110_utmi_data[i].utmi_phy_port = fdtdec_get_int( gd->fdt_blob, node, "utmi-port", UTMI_PHY_INVALID); if (cp110_utmi_data[i].utmi_phy_port == UTMI_PHY_INVALID) { - error("UTMI PHY port type is invalid\n"); + pr_err("UTMI PHY port type is invalid\n"); i++; continue; } @@ -2049,7 +2049,7 @@ int comphy_cp110_init(struct chip_serdes_phy_config *ptr_chip_cfg, * PHY_TYPE_UNCONNECTED state. */ ptr_comphy_map->type = PHY_TYPE_UNCONNECTED; - error("PLL is not locked - Failed to initialize lane %d\n", + pr_err("PLL is not locked - Failed to initialize lane %d\n", lane); } } diff --git a/drivers/phy/ti-pipe3-phy.c b/drivers/phy/ti-pipe3-phy.c index 680e32f3ea6f..babf2ffe393e 100644 --- a/drivers/phy/ti-pipe3-phy.c +++ b/drivers/phy/ti-pipe3-phy.c @@ -261,7 +261,7 @@ static int pipe3_exit(struct phy *phy) } while (--timeout); if (!(val & PLL_TICOPWDN) || !(val & PLL_LDOPWDN)) { - error("%s: Failed to power down DPLL: PLL_STATUS 0x%x\n", + pr_err("%s: Failed to power down DPLL: PLL_STATUS 0x%x\n", __func__, val); return -EBUSY; } @@ -284,14 +284,14 @@ static void *get_reg(struct udevice *dev, const char *name) err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev, name, &syscon); if (err) { - error("unable to find syscon device for %s (%d)\n", + pr_err("unable to find syscon device for %s (%d)\n", name, err); return NULL; } regmap = syscon_get_regmap(syscon); if (IS_ERR(regmap)) { - error("unable to find regmap for %s (%ld)\n", + pr_err("unable to find regmap for %s (%ld)\n", name, PTR_ERR(regmap)); return NULL; } @@ -299,7 +299,7 @@ static void *get_reg(struct udevice *dev, const char *name) cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), name, &len); if (len < 2*sizeof(fdt32_t)) { - error("offset not available for %s\n", name); + pr_err("offset not available for %s\n", name); return NULL; } @@ -318,13 +318,13 @@ static int pipe3_phy_probe(struct udevice *dev) addr = devfdt_get_addr_size_index(dev, 2, &sz); if (addr == FDT_ADDR_T_NONE) { - error("missing pll ctrl address\n"); + pr_err("missing pll ctrl address\n"); return -EINVAL; } pipe3->pll_ctrl_base = map_physmem(addr, sz, MAP_NOCACHE); if (!pipe3->pll_ctrl_base) { - error("unable to remap pll ctrl\n"); + pr_err("unable to remap pll ctrl\n"); return -EINVAL; } diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c index 27165b000773..2bf853eba13d 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c @@ -578,7 +578,7 @@ int armada_37xx_pinctrl_probe(struct udevice *dev) info->base = (void __iomem *)devfdt_get_addr(dev); if (!info->base) { - error("unable to find regmap\n"); + pr_err("unable to find regmap\n"); return -ENODEV; } diff --git a/drivers/pinctrl/pinctrl-sti.c b/drivers/pinctrl/pinctrl-sti.c index 40341b4eeb75..735e412f608e 100644 --- a/drivers/pinctrl/pinctrl-sti.c +++ b/drivers/pinctrl/pinctrl-sti.c @@ -142,7 +142,7 @@ void sti_pin_configure(struct udevice *dev, struct sti_pin_desc *pin_desc) break; default: - error("%s invalid direction value: 0x%x\n", + pr_err("%s invalid direction value: 0x%x\n", __func__, pin_desc->dir); BUG(); break; @@ -237,14 +237,14 @@ static int sti_pinctrl_set_state(struct udevice *dev, struct udevice *config) prop_name, "#gpio-cells", 0, 0, &args); if (ret < 0) { - error("Can't get the gpio bank phandle: %d\n", ret); + pr_err("Can't get the gpio bank phandle: %d\n", ret); return ret; } bank_name = fdt_getprop(blob, args.node, "st,bank-name", &count); if (count < 0) { - error("Can't find bank-name property %d\n", count); + pr_err("Can't find bank-name property %d\n", count); return -EINVAL; } @@ -254,12 +254,12 @@ static int sti_pinctrl_set_state(struct udevice *dev, struct udevice *config) prop_name, cells, ARRAY_SIZE(cells)); if (count < 0) { - error("Bad pin configuration array %d\n", count); + pr_err("Bad pin configuration array %d\n", count); return -EINVAL; } if (count > MAX_STI_PINCONF_ENTRIES) { - error("Unsupported pinconf array count %d\n", count); + pr_err("Unsupported pinconf array count %d\n", count); return -EINVAL; } @@ -284,13 +284,13 @@ static int sti_pinctrl_probe(struct udevice *dev) err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev, "st,syscfg", &syscon); if (err) { - error("unable to find syscon device\n"); + pr_err("unable to find syscon device\n"); return err; } plat->regmap = syscon_get_regmap(syscon); if (!plat->regmap) { - error("unable to find regmap\n"); + pr_err("unable to find regmap\n"); return -ENODEV; } diff --git a/drivers/pinctrl/pinctrl_stm32.c b/drivers/pinctrl/pinctrl_stm32.c index fb2593c69044..62ba0890837c 100644 --- a/drivers/pinctrl/pinctrl_stm32.c +++ b/drivers/pinctrl/pinctrl_stm32.c @@ -160,7 +160,7 @@ static int stm32_pinctrl_set_state_simple(struct udevice *dev, config_node = fdt_node_offset_by_phandle(fdt, phandle); if (config_node < 0) { - error("prop pinctrl-0 index %d invalid phandle\n", i); + pr_err("prop pinctrl-0 index %d invalid phandle\n", i); return -EINVAL; } diff --git a/drivers/power/pmic/as3722.c b/drivers/power/pmic/as3722.c index 4efe8ee183d5..3b0427e0b918 100644 --- a/drivers/power/pmic/as3722.c +++ b/drivers/power/pmic/as3722.c @@ -46,14 +46,14 @@ static int as3722_read_id(struct udevice *dev, uint *idp, uint *revisionp) ret = pmic_reg_read(dev, AS3722_ASIC_ID1); if (ret < 0) { - error("failed to read ID1 register: %d", ret); + pr_err("failed to read ID1 register: %d", ret); return ret; } *idp = ret; ret = pmic_reg_read(dev, AS3722_ASIC_ID2); if (ret < 0) { - error("failed to read ID2 register: %d", ret); + pr_err("failed to read ID2 register: %d", ret); return ret; } *revisionp = ret; @@ -71,7 +71,7 @@ int as3722_sd_set_voltage(struct udevice *dev, unsigned int sd, u8 value) ret = pmic_reg_write(dev, AS3722_SD_VOLTAGE(sd), value); if (ret < 0) { - error("failed to write SD%u voltage register: %d", sd, ret); + pr_err("failed to write SD%u voltage register: %d", sd, ret); return ret; } @@ -87,7 +87,7 @@ int as3722_ldo_set_voltage(struct udevice *dev, unsigned int ldo, u8 value) ret = pmic_reg_write(dev, AS3722_LDO_VOLTAGE(ldo), value); if (ret < 0) { - error("failed to write LDO%u voltage register: %d", ldo, + pr_err("failed to write LDO%u voltage register: %d", ldo, ret); return ret; } @@ -102,12 +102,12 @@ static int as3722_probe(struct udevice *dev) ret = as3722_read_id(dev, &id, &revision); if (ret < 0) { - error("failed to read ID: %d", ret); + pr_err("failed to read ID: %d", ret); return ret; } if (id != AS3722_DEVICE_ID) { - error("unknown device"); + pr_err("unknown device"); return -ENOENT; } diff --git a/drivers/power/pmic/as3722_gpio.c b/drivers/power/pmic/as3722_gpio.c index d0b681ca4ab9..5cf4cb6b518e 100644 --- a/drivers/power/pmic/as3722_gpio.c +++ b/drivers/power/pmic/as3722_gpio.c @@ -26,7 +26,7 @@ int as3722_gpio_configure(struct udevice *pmic, unsigned int gpio, err = pmic_reg_write(pmic, AS3722_GPIO_CONTROL(gpio), value); if (err) { - error("failed to configure GPIO#%u: %d", gpio, err); + pr_err("failed to configure GPIO#%u: %d", gpio, err); return err; } @@ -46,7 +46,7 @@ static int as3722_gpio_set_value(struct udevice *dev, unsigned int gpio, err = pmic_reg_read(pmic, AS3722_GPIO_SIGNAL_OUT); if (err < 0) { - error("failed to read GPIO signal out register: %d", err); + pr_err("failed to read GPIO signal out register: %d", err); return err; } value = err; @@ -61,7 +61,7 @@ static int as3722_gpio_set_value(struct udevice *dev, unsigned int gpio, err = pmic_reg_write(pmic, AS3722_GPIO_SIGNAL_OUT, value); if (err) { - error("failed to set GPIO#%u %s: %d", gpio, l, err); + pr_err("failed to set GPIO#%u %s: %d", gpio, l, err); return err; } @@ -84,13 +84,13 @@ int as3722_gpio_direction_output(struct udevice *dev, unsigned int gpio, err = pmic_reg_write(pmic, AS3722_GPIO_CONTROL(gpio), value); if (err) { - error("failed to configure GPIO#%u as output: %d", gpio, err); + pr_err("failed to configure GPIO#%u as output: %d", gpio, err); return err; } err = as3722_gpio_set_value(pmic, gpio, value); if (err < 0) { - error("failed to set GPIO#%u high: %d", gpio, err); + pr_err("failed to set GPIO#%u high: %d", gpio, err); return err; } diff --git a/drivers/power/pmic/i2c_pmic_emul.c b/drivers/power/pmic/i2c_pmic_emul.c index 2d35d09d454c..38a2a04f1776 100644 --- a/drivers/power/pmic/i2c_pmic_emul.c +++ b/drivers/power/pmic/i2c_pmic_emul.c @@ -31,7 +31,7 @@ static int sandbox_i2c_pmic_read_data(struct udevice *emul, uchar chip, struct sandbox_i2c_pmic_plat_data *plat = dev_get_platdata(emul); if (plat->rw_reg + len > SANDBOX_PMIC_REG_COUNT) { - error("Request exceeds PMIC register range! Max register: %#x", + pr_err("Request exceeds PMIC register range! Max register: %#x", SANDBOX_PMIC_REG_COUNT); return -EFAULT; } @@ -68,7 +68,7 @@ static int sandbox_i2c_pmic_write_data(struct udevice *emul, uchar chip, len--; if (plat->rw_reg + len > SANDBOX_PMIC_REG_COUNT) { - error("Request exceeds PMIC register range! Max register: %#x", + pr_err("Request exceeds PMIC register range! Max register: %#x", SANDBOX_PMIC_REG_COUNT); } @@ -111,7 +111,7 @@ static int sandbox_i2c_pmic_ofdata_to_platdata(struct udevice *emul) SANDBOX_PMIC_REG_COUNT); if (!reg_defaults) { - error("Property \"reg-defaults\" not found for device: %s!", + pr_err("Property \"reg-defaults\" not found for device: %s!", emul->name); return -EINVAL; } diff --git a/drivers/power/pmic/lp873x.c b/drivers/power/pmic/lp873x.c index f5054683139a..95c2b7e8c74c 100644 --- a/drivers/power/pmic/lp873x.c +++ b/drivers/power/pmic/lp873x.c @@ -27,7 +27,7 @@ static int lp873x_write(struct udevice *dev, uint reg, const uint8_t *buff, int len) { if (dm_i2c_write(dev, reg, buff, len)) { - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return -EIO; } @@ -37,7 +37,7 @@ static int lp873x_write(struct udevice *dev, uint reg, const uint8_t *buff, static int lp873x_read(struct udevice *dev, uint reg, uint8_t *buff, int len) { if (dm_i2c_read(dev, reg, buff, len)) { - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return -EIO; } diff --git a/drivers/power/pmic/lp87565.c b/drivers/power/pmic/lp87565.c index 782a46c4cc31..506769e36267 100644 --- a/drivers/power/pmic/lp87565.c +++ b/drivers/power/pmic/lp87565.c @@ -29,7 +29,7 @@ static int lp87565_write(struct udevice *dev, uint reg, const uint8_t *buff, ret = dm_i2c_write(dev, reg, buff, len); if (ret) - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return ret; } @@ -40,7 +40,7 @@ static int lp87565_read(struct udevice *dev, uint reg, uint8_t *buff, int len) ret = dm_i2c_read(dev, reg, buff, len); if (ret) - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return ret; } diff --git a/drivers/power/pmic/max77686.c b/drivers/power/pmic/max77686.c index ceca9f96a7f3..b3ed84992ff8 100644 --- a/drivers/power/pmic/max77686.c +++ b/drivers/power/pmic/max77686.c @@ -31,7 +31,7 @@ static int max77686_write(struct udevice *dev, uint reg, const uint8_t *buff, int len) { if (dm_i2c_write(dev, reg, buff, len)) { - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return -EIO; } @@ -41,7 +41,7 @@ static int max77686_write(struct udevice *dev, uint reg, const uint8_t *buff, static int max77686_read(struct udevice *dev, uint reg, uint8_t *buff, int len) { if (dm_i2c_read(dev, reg, buff, len)) { - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return -EIO; } diff --git a/drivers/power/pmic/max8997.c b/drivers/power/pmic/max8997.c index f749d7debfc3..5ebeb8a316be 100644 --- a/drivers/power/pmic/max8997.c +++ b/drivers/power/pmic/max8997.c @@ -26,7 +26,7 @@ static int max8997_write(struct udevice *dev, uint reg, const uint8_t *buff, ret = dm_i2c_write(dev, reg, buff, len); if (ret) - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return ret; } @@ -37,7 +37,7 @@ static int max8997_read(struct udevice *dev, uint reg, uint8_t *buff, int len) ret = dm_i2c_read(dev, reg, buff, len); if (ret) - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return ret; } diff --git a/drivers/power/pmic/max8998.c b/drivers/power/pmic/max8998.c index 7c4773c7b3aa..a7e04699e8ba 100644 --- a/drivers/power/pmic/max8998.c +++ b/drivers/power/pmic/max8998.c @@ -26,7 +26,7 @@ static int max8998_write(struct udevice *dev, uint reg, const uint8_t *buff, ret = dm_i2c_write(dev, reg, buff, len); if (ret) - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return ret; } @@ -37,7 +37,7 @@ static int max8998_read(struct udevice *dev, uint reg, uint8_t *buff, int len) ret = dm_i2c_read(dev, reg, buff, len); if (ret) - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return ret; } diff --git a/drivers/power/pmic/palmas.c b/drivers/power/pmic/palmas.c index 804c0d13a0c9..1e1ecb382e3a 100644 --- a/drivers/power/pmic/palmas.c +++ b/drivers/power/pmic/palmas.c @@ -27,7 +27,7 @@ static int palmas_write(struct udevice *dev, uint reg, const uint8_t *buff, int len) { if (dm_i2c_write(dev, reg, buff, len)) { - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return -EIO; } @@ -37,7 +37,7 @@ static int palmas_write(struct udevice *dev, uint reg, const uint8_t *buff, static int palmas_read(struct udevice *dev, uint reg, uint8_t *buff, int len) { if (dm_i2c_read(dev, reg, buff, len)) { - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return -EIO; } diff --git a/drivers/power/pmic/pfuze100.c b/drivers/power/pmic/pfuze100.c index 5f361c7696f4..a06cbc07d491 100644 --- a/drivers/power/pmic/pfuze100.c +++ b/drivers/power/pmic/pfuze100.c @@ -33,7 +33,7 @@ static int pfuze100_write(struct udevice *dev, uint reg, const uint8_t *buff, int len) { if (dm_i2c_write(dev, reg, buff, len)) { - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return -EIO; } @@ -43,7 +43,7 @@ static int pfuze100_write(struct udevice *dev, uint reg, const uint8_t *buff, static int pfuze100_read(struct udevice *dev, uint reg, uint8_t *buff, int len) { if (dm_i2c_read(dev, reg, buff, len)) { - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return -EIO; } diff --git a/drivers/power/pmic/s2mps11.c b/drivers/power/pmic/s2mps11.c index 9d83059c403a..522105e5ff05 100644 --- a/drivers/power/pmic/s2mps11.c +++ b/drivers/power/pmic/s2mps11.c @@ -27,7 +27,7 @@ static int s2mps11_write(struct udevice *dev, uint reg, const uint8_t *buff, ret = dm_i2c_write(dev, reg, buff, len); if (ret) - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return ret; } @@ -38,7 +38,7 @@ static int s2mps11_read(struct udevice *dev, uint reg, uint8_t *buff, int len) ret = dm_i2c_read(dev, reg, buff, len); if (ret) - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return ret; } diff --git a/drivers/power/pmic/s5m8767.c b/drivers/power/pmic/s5m8767.c index f8ae5ea2dba4..3812e240ab08 100644 --- a/drivers/power/pmic/s5m8767.c +++ b/drivers/power/pmic/s5m8767.c @@ -30,7 +30,7 @@ static int s5m8767_write(struct udevice *dev, uint reg, const uint8_t *buff, int len) { if (dm_i2c_write(dev, reg, buff, len)) { - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return -EIO; } @@ -40,7 +40,7 @@ static int s5m8767_write(struct udevice *dev, uint reg, const uint8_t *buff, static int s5m8767_read(struct udevice *dev, uint reg, uint8_t *buff, int len) { if (dm_i2c_read(dev, reg, buff, len)) { - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return -EIO; } diff --git a/drivers/power/pmic/sandbox.c b/drivers/power/pmic/sandbox.c index 6763303c6671..e8d6faca160c 100644 --- a/drivers/power/pmic/sandbox.c +++ b/drivers/power/pmic/sandbox.c @@ -31,7 +31,7 @@ static int sandbox_pmic_write(struct udevice *dev, uint reg, const uint8_t *buff, int len) { if (dm_i2c_write(dev, reg, buff, len)) { - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return -EIO; } @@ -42,7 +42,7 @@ static int sandbox_pmic_read(struct udevice *dev, uint reg, uint8_t *buff, int len) { if (dm_i2c_read(dev, reg, buff, len)) { - error("read error from device: %p register: %#x!", dev, reg); + pr_err("read error from device: %p register: %#x!", dev, reg); return -EIO; } @@ -52,7 +52,7 @@ static int sandbox_pmic_read(struct udevice *dev, uint reg, static int sandbox_pmic_bind(struct udevice *dev) { if (!pmic_bind_children(dev, dev_ofnode(dev), pmic_children_info)) - error("%s:%d PMIC: %s - no child found!", __func__, __LINE__, + pr_err("%s:%d PMIC: %s - no child found!", __func__, __LINE__, dev->name); /* Always return success for this device - allows for PMIC I/O */ diff --git a/drivers/power/pmic/tps65090.c b/drivers/power/pmic/tps65090.c index 4565e3b54c1b..ee5358bcedc8 100644 --- a/drivers/power/pmic/tps65090.c +++ b/drivers/power/pmic/tps65090.c @@ -29,7 +29,7 @@ static int tps65090_write(struct udevice *dev, uint reg, const uint8_t *buff, int len) { if (dm_i2c_write(dev, reg, buff, len)) { - error("write error to device: %p register: %#x!", dev, reg); + pr_err("write error to device: %p register: %#x!", dev, reg); return -EIO; } @@ -42,7 +42,7 @@ static int tps65090_read(struct udevice *dev, uint reg, uint8_t *buff, int len) ret = dm_i2c_read(dev, reg, buff, len); if (ret) { - error("read error %d from device: %p register: %#x!", ret, dev, + pr_err("read error %d from device: %p register: %#x!", ret, dev, reg); return -EIO; } diff --git a/drivers/power/regulator/fixed.c b/drivers/power/regulator/fixed.c index 35c292222b97..97b4a98bf0b6 100644 --- a/drivers/power/regulator/fixed.c +++ b/drivers/power/regulator/fixed.c @@ -117,7 +117,7 @@ static int fixed_regulator_set_enable(struct udevice *dev, bool enable) ret = dm_gpio_set_value(&dev_pdata->gpio, enable); if (ret) { - error("Can't set regulator : %s gpio to: %d\n", dev->name, + pr_err("Can't set regulator : %s gpio to: %d\n", dev->name, enable); return ret; } diff --git a/drivers/power/regulator/gpio-regulator.c b/drivers/power/regulator/gpio-regulator.c index 42391c69b430..1031a0362b67 100644 --- a/drivers/power/regulator/gpio-regulator.c +++ b/drivers/power/regulator/gpio-regulator.c @@ -109,7 +109,7 @@ static int gpio_regulator_set_value(struct udevice *dev, int uV) ret = dm_gpio_set_value(&dev_pdata->gpio, enable); if (ret) { - error("Can't set regulator : %s gpio to: %d\n", dev->name, + pr_err("Can't set regulator : %s gpio to: %d\n", dev->name, enable); return ret; } diff --git a/drivers/power/regulator/max77686.c b/drivers/power/regulator/max77686.c index 8780806cff04..2212d36ed6a9 100644 --- a/drivers/power/regulator/max77686.c +++ b/drivers/power/regulator/max77686.c @@ -98,7 +98,7 @@ static int max77686_buck_volt2hex(int buck, int uV) if (hex >= 0 && hex <= hex_max) return hex; - error("Value: %d uV is wrong for BUCK%d", uV, buck); + pr_err("Value: %d uV is wrong for BUCK%d", uV, buck); return -EINVAL; } @@ -134,7 +134,7 @@ static int max77686_buck_hex2volt(int buck, int hex) return uV; bad_hex: - error("Value: %#x is wrong for BUCK%d", hex, buck); + pr_err("Value: %#x is wrong for BUCK%d", hex, buck); return -EINVAL; } @@ -160,7 +160,7 @@ static int max77686_ldo_volt2hex(int ldo, int uV) if (hex >= 0 && hex <= MAX77686_LDO_VOLT_MAX_HEX) return hex; - error("Value: %d uV is wrong for LDO%d", uV, ldo); + pr_err("Value: %d uV is wrong for LDO%d", uV, ldo); return -EINVAL; } @@ -189,7 +189,7 @@ static int max77686_ldo_hex2volt(int ldo, int hex) return uV; bad_hex: - error("Value: %#x is wrong for ldo%d", hex, ldo); + pr_err("Value: %#x is wrong for ldo%d", hex, ldo); return -EINVAL; } @@ -328,7 +328,7 @@ static int max77686_ldo_val(struct udevice *dev, int op, int *uV) ldo = dev->driver_data; if (ldo < 1 || ldo > MAX77686_LDO_NUM) { - error("Wrong ldo number: %d", ldo); + pr_err("Wrong ldo number: %d", ldo); return -EINVAL; } @@ -366,7 +366,7 @@ static int max77686_buck_val(struct udevice *dev, int op, int *uV) buck = dev->driver_data; if (buck < 1 || buck > MAX77686_BUCK_NUM) { - error("Wrong buck number: %d", buck); + pr_err("Wrong buck number: %d", buck); return -EINVAL; } @@ -423,7 +423,7 @@ static int max77686_ldo_mode(struct udevice *dev, int op, int *opmode) ldo = dev->driver_data; if (ldo < 1 || ldo > MAX77686_LDO_NUM) { - error("Wrong ldo number: %d", ldo); + pr_err("Wrong ldo number: %d", ldo); return -EINVAL; } @@ -493,7 +493,7 @@ static int max77686_ldo_mode(struct udevice *dev, int op, int *opmode) } if (mode == 0xff) { - error("Wrong mode: %d for ldo%d", *opmode, ldo); + pr_err("Wrong mode: %d for ldo%d", *opmode, ldo); return -EINVAL; } @@ -545,7 +545,7 @@ static int max77686_buck_mode(struct udevice *dev, int op, int *opmode) buck = dev->driver_data; if (buck < 1 || buck > MAX77686_BUCK_NUM) { - error("Wrong buck number: %d", buck); + pr_err("Wrong buck number: %d", buck); return -EINVAL; } @@ -614,7 +614,7 @@ static int max77686_buck_mode(struct udevice *dev, int op, int *opmode) } if (mode == 0xff) { - error("Wrong mode: %d for buck: %d\n", *opmode, buck); + pr_err("Wrong mode: %d for buck: %d\n", *opmode, buck); return -EINVAL; } diff --git a/drivers/power/regulator/sandbox.c b/drivers/power/regulator/sandbox.c index 06c09fd05151..f980a17389eb 100644 --- a/drivers/power/regulator/sandbox.c +++ b/drivers/power/regulator/sandbox.c @@ -87,7 +87,7 @@ int out_get_value(struct udevice *dev, int output_count, int reg_type, int ret; if (dev->driver_data > output_count) { - error("Unknown regulator number: %lu for PMIC %s!", + pr_err("Unknown regulator number: %lu for PMIC %s!", dev->driver_data, dev->name); return -EINVAL; } @@ -95,7 +95,7 @@ int out_get_value(struct udevice *dev, int output_count, int reg_type, reg = (dev->driver_data - 1) * OUT_REG_COUNT + reg_type; ret = pmic_read(dev->parent, reg, ®_val, 1); if (ret) { - error("PMIC read failed: %d\n", ret); + pr_err("PMIC read failed: %d\n", ret); return ret; } @@ -115,14 +115,14 @@ static int out_set_value(struct udevice *dev, int output_count, int reg_type, int max_value; if (dev->driver_data > output_count) { - error("Unknown regulator number: %lu for PMIC %s!", + pr_err("Unknown regulator number: %lu for PMIC %s!", dev->driver_data, dev->name); return -EINVAL; } max_value = range[dev->driver_data - 1].max; if (value > max_value) { - error("Wrong value for %s: %lu. Max is: %d.", + pr_err("Wrong value for %s: %lu. Max is: %d.", dev->name, dev->driver_data, max_value); return -EINVAL; } @@ -134,7 +134,7 @@ static int out_set_value(struct udevice *dev, int output_count, int reg_type, reg = (dev->driver_data - 1) * OUT_REG_COUNT + reg_type; ret = pmic_write(dev->parent, reg, ®_val, 1); if (ret) { - error("PMIC write failed: %d\n", ret); + pr_err("PMIC write failed: %d\n", ret); return ret; } @@ -154,7 +154,7 @@ static int out_get_mode(struct udevice *dev) reg = (dev->driver_data - 1) * OUT_REG_COUNT + OUT_REG_OM; ret = pmic_read(dev->parent, reg, ®_val, 1); if (ret) { - error("PMIC read failed: %d\n", ret); + pr_err("PMIC read failed: %d\n", ret); return ret; } @@ -163,7 +163,7 @@ static int out_get_mode(struct udevice *dev) return uc_pdata->mode[i].id; } - error("Unknown operation mode for %s!", dev->name); + pr_err("Unknown operation mode for %s!", dev->name); return -EINVAL; } @@ -188,14 +188,14 @@ static int out_set_mode(struct udevice *dev, int mode) } if (reg_val == -1) { - error("Unknown operation mode for %s!", dev->name); + pr_err("Unknown operation mode for %s!", dev->name); return -EINVAL; } reg = (dev->driver_data - 1) * OUT_REG_COUNT + OUT_REG_OM; ret = pmic_write(dev->parent, reg, (uint8_t *)®_val, 1); if (ret) { - error("PMIC write failed: %d\n", ret); + pr_err("PMIC write failed: %d\n", ret); return ret; } diff --git a/drivers/ram/rockchip/dmc-rk3368.c b/drivers/ram/rockchip/dmc-rk3368.c index ca7b1ff0c841..975c81201ca1 100644 --- a/drivers/ram/rockchip/dmc-rk3368.c +++ b/drivers/ram/rockchip/dmc-rk3368.c @@ -230,7 +230,7 @@ static int memory_init(struct rk3368_ddr_pctl *pctl, tmp = get_timer(0); do { if (get_timer(tmp) > timeout_ms) { - error("%s: POWER_UP_START did not complete in %ld ms\n", + pr_err("%s: POWER_UP_START did not complete in %ld ms\n", __func__, timeout_ms); return -ETIME; } @@ -422,7 +422,7 @@ static int dfi_cfg(struct rk3368_ddr_pctl *pctl) tmp = get_timer(0); do { if (get_timer(tmp) > timeout_ms) { - error("%s: DFI init did not complete within %ld ms\n", + pr_err("%s: DFI init did not complete within %ld ms\n", __func__, timeout_ms); return -ETIME; } @@ -457,7 +457,7 @@ static int pctl_calc_timings(struct rk3368_sdram_params *params, u32 tfaw_as_ps; if (params->ddr_speed_bin != DDR3_1600K) { - error("%s: unimplemented DDR3 speed bin %d\n", + pr_err("%s: unimplemented DDR3 speed bin %d\n", __func__, params->ddr_speed_bin); return -1; } @@ -585,7 +585,7 @@ static int ddrphy_data_training(struct rk3368_ddr_pctl *pctl, tmp = get_timer(0); do { if (get_timer(tmp) > timeout_ms) { - error("%s: did not complete within %ld ms\n", + pr_err("%s: did not complete within %ld ms\n", __func__, timeout_ms); return -ETIME; } @@ -625,7 +625,7 @@ static int sdram_col_row_detect(struct udevice *dev) } if (col == 8) { - error("%s: col detect error\n", __func__); + pr_err("%s: col detect error\n", __func__); return -EINVAL; } @@ -644,7 +644,7 @@ static int sdram_col_row_detect(struct udevice *dev) } if (row == 11) { - error("%s: row detect error\n", __func__); + pr_err("%s: row detect error\n", __func__); return -EINVAL; } @@ -764,7 +764,7 @@ static int msch_niu_config(struct rk3368_msch *msch, } } - error("%s: ddrconf (NIU config) not found\n", __func__); + pr_err("%s: ddrconf (NIU config) not found\n", __func__); return -EINVAL; } diff --git a/drivers/ram/stm32_sdram.c b/drivers/ram/stm32_sdram.c index b1b0289a1b05..fdf088e78336 100644 --- a/drivers/ram/stm32_sdram.c +++ b/drivers/ram/stm32_sdram.c @@ -262,7 +262,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev) bank_name = (char *)ofnode_get_name(bank_node); strsep(&bank_name, "@"); if (!bank_name) { - error("missing sdram bank index"); + pr_err("missing sdram bank index"); return -EINVAL; } @@ -271,7 +271,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev) (long unsigned int *)&bank_params->target_bank); if (bank_params->target_bank >= MAX_SDRAM_BANK) { - error("Found bank %d , but only bank 0 and 1 are supported", + pr_err("Found bank %d , but only bank 0 and 1 are supported", bank_params->target_bank); return -EINVAL; } @@ -285,7 +285,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev) sizeof(struct stm32_sdram_control)); if (!params->bank_params[bank].sdram_control) { - error("st,sdram-control not found for %s", + pr_err("st,sdram-control not found for %s", ofnode_get_name(bank_node)); return -EINVAL; } @@ -298,7 +298,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev) sizeof(struct stm32_sdram_timing)); if (!params->bank_params[bank].sdram_timing) { - error("st,sdram-timing not found for %s", + pr_err("st,sdram-timing not found for %s", ofnode_get_name(bank_node)); return -EINVAL; } diff --git a/drivers/reset/sti-reset.c b/drivers/reset/sti-reset.c index a79708cde280..024b996f0c16 100644 --- a/drivers/reset/sti-reset.c +++ b/drivers/reset/sti-reset.c @@ -201,20 +201,20 @@ phys_addr_t sti_reset_get_regmap(const char *compatible) node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, compatible); if (node < 0) { - error("unable to find %s node\n", compatible); + pr_err("unable to find %s node\n", compatible); return node; } ret = uclass_get_device_by_of_offset(UCLASS_SYSCON, node, &syscon); if (ret) { - error("%s: uclass_get_device_by_of_offset failed: %d\n", + pr_err("%s: uclass_get_device_by_of_offset failed: %d\n", __func__, ret); return ret; } regmap = syscon_get_regmap(syscon); if (!regmap) { - error("unable to get regmap for %s\n", syscon->name); + pr_err("unable to get regmap for %s\n", syscon->name); return -ENODEV; } @@ -251,7 +251,7 @@ static int sti_reset_program_hw(struct reset_ctl *reset_ctl, int assert) if (ch->deassert_cnt > 0) return 0; } else - error("Reset balancing error: reset_ctl=%p dev=%p id=%lu\n", + pr_err("Reset balancing error: reset_ctl=%p dev=%p id=%lu\n", reset_ctl, reset_ctl->dev, reset_ctl->id); } @@ -268,7 +268,7 @@ static int sti_reset_program_hw(struct reset_ctl *reset_ctl, int assert) reg = (void __iomem *)base + ch->ack_offset; if (wait_for_bit(__func__, reg, BIT(ch->ack_bit), ctrl_val, 1000, false)) { - error("Stuck on waiting ack reset_ctl=%p dev=%p id=%lu\n", + pr_err("Stuck on waiting ack reset_ctl=%p dev=%p id=%lu\n", reset_ctl, reset_ctl->dev, reset_ctl->id); return -ETIMEDOUT; diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index e2f8342e887f..228e714e0933 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c @@ -474,7 +474,7 @@ static int atmel_spi_probe(struct udevice *bus) ret = gpio_request_list_by_name(bus, "cs-gpios", priv->cs_gpios, ARRAY_SIZE(priv->cs_gpios), 0); if (ret < 0) { - error("Can't get %s gpios! Error: %d", bus->name, ret); + pr_err("Can't get %s gpios! Error: %d", bus->name, ret); return ret; } diff --git a/drivers/spi/lpc32xx_ssp.c b/drivers/spi/lpc32xx_ssp.c index c5b766c0dd00..e2a593b93444 100644 --- a/drivers/spi/lpc32xx_ssp.c +++ b/drivers/spi/lpc32xx_ssp.c @@ -66,17 +66,17 @@ struct spi_slave *spi_setup_slave(uint bus, uint cs, uint max_hz, uint mode) /* we only set up SSP0 for now, so ignore bus */ if (mode & SPI_3WIRE) { - error("3-wire mode not supported"); + pr_err("3-wire mode not supported"); return NULL; } if (mode & SPI_SLAVE) { - error("slave mode not supported\n"); + pr_err("slave mode not supported\n"); return NULL; } if (mode & SPI_PREAMBLE) { - error("preamble byte skipping not supported\n"); + pr_err("preamble byte skipping not supported\n"); return NULL; } diff --git a/drivers/sysreset/sysreset_sti.c b/drivers/sysreset/sysreset_sti.c index 9b58aa8e97b2..bf698a737bd7 100644 --- a/drivers/sysreset/sysreset_sti.c +++ b/drivers/sysreset/sysreset_sti.c @@ -39,7 +39,7 @@ static int sti_sysreset_probe(struct udevice *dev) "st,syscfg", NULL, 0, 0, &syscfg_phandle); if (ret < 0) { - error("Can't get syscfg phandle: %d\n", ret); + pr_err("Can't get syscfg phandle: %d\n", ret); return ret; } @@ -47,14 +47,14 @@ static int sti_sysreset_probe(struct udevice *dev) syscfg_phandle.node, &syscon); if (ret) { - error("%s: uclass_get_device_by_of_offset failed: %d\n", + pr_err("%s: uclass_get_device_by_of_offset failed: %d\n", __func__, ret); return ret; } regmap = syscon_get_regmap(syscon); if (!regmap) { - error("unable to get regmap for %s\n", syscon->name); + pr_err("unable to get regmap for %s\n", syscon->name); return -ENODEV; } diff --git a/drivers/sysreset/sysreset_syscon.c b/drivers/sysreset/sysreset_syscon.c index 3818faeb462f..3abce7f67867 100644 --- a/drivers/sysreset/sysreset_syscon.c +++ b/drivers/sysreset/sysreset_syscon.c @@ -45,13 +45,13 @@ int syscon_reboot_probe(struct udevice *dev) err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev, "regmap", &syscon); if (err) { - error("unable to find syscon device\n"); + pr_err("unable to find syscon device\n"); return err; } priv->regmap = syscon_get_regmap(syscon); if (!priv->regmap) { - error("unable to find regmap\n"); + pr_err("unable to find regmap\n"); return -ENODEV; } diff --git a/drivers/sysreset/sysreset_watchdog.c b/drivers/sysreset/sysreset_watchdog.c index 304ed052a2c3..ab250aea292f 100644 --- a/drivers/sysreset/sysreset_watchdog.c +++ b/drivers/sysreset/sysreset_watchdog.c @@ -38,7 +38,7 @@ int wdt_reboot_probe(struct udevice *dev) err = uclass_get_device_by_phandle(UCLASS_WDT, dev, "wdt", &priv->wdt); if (err) { - error("unable to find wdt device\n"); + pr_err("unable to find wdt device\n"); return err; } diff --git a/drivers/tpm/tpm_tis_infineon.c b/drivers/tpm/tpm_tis_infineon.c index ef3ff0dbf67e..e3e20d899689 100644 --- a/drivers/tpm/tpm_tis_infineon.c +++ b/drivers/tpm/tpm_tis_infineon.c @@ -539,7 +539,7 @@ static int tpm_tis_i2c_init(struct udevice *dev) } if (chip->chip_type != UNKNOWN && vendor != expected_did_vid) { - error("Vendor id did not match! ID was %08x\n", vendor); + pr_err("Vendor id did not match! ID was %08x\n", vendor); return -ENODEV; } diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c index 35c2dc18d955..e8432bb016eb 100644 --- a/drivers/usb/common/common.c +++ b/drivers/usb/common/common.c @@ -28,7 +28,7 @@ enum usb_dr_mode usb_get_dr_mode(int node) dr_mode = fdt_getprop(fdt, node, "dr_mode", NULL); if (!dr_mode) { - error("usb dr_mode not found\n"); + pr_err("usb dr_mode not found\n"); return USB_DR_MODE_UNKNOWN; } diff --git a/drivers/usb/eth/mcs7830.c b/drivers/usb/eth/mcs7830.c index 4abef5d5c88e..941d612a68a8 100644 --- a/drivers/usb/eth/mcs7830.c +++ b/drivers/usb/eth/mcs7830.c @@ -418,25 +418,25 @@ static int mcs7830_basic_reset(struct usb_device *udev, rc = mcs7830_set_autoneg(udev); if (rc < 0) { - error("setting autoneg failed\n"); + pr_err("setting autoneg failed\n"); return rc; } rc = mcs7830_write_mchash(udev, priv); if (rc < 0) { - error("failed to set multicast hash\n"); + pr_err("failed to set multicast hash\n"); return rc; } rc = mcs7830_write_config(udev, priv); if (rc < 0) { - error("failed to set configuration\n"); + pr_err("failed to set configuration\n"); return rc; } rc = mcs7830_apply_fixup(udev); if (rc < 0) { - error("fixup application failed\n"); + pr_err("fixup application failed\n"); return rc; } @@ -541,11 +541,11 @@ static int mcs7830_recv_common(struct ueth_data *ueth, uint8_t *buf) debug("%s() RX want len %d, got len %d, rc %d\n", __func__, wantlen, gotlen, rc); if (rc != 0) { - error("RX: failed to receive\n"); + pr_err("RX: failed to receive\n"); return rc; } if (gotlen > wantlen) { - error("RX: got too many bytes (%d)\n", gotlen); + pr_err("RX: got too many bytes (%d)\n", gotlen); return -EIO; } diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 9df6d32c65f9..ad2f606b78bc 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c @@ -1456,7 +1456,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) ret = driver->bind(&udc->gadget); if (ret) { - error("driver->bind() returned %d\n", ret); + pr_err("driver->bind() returned %d\n", ret); udc->driver = NULL; } @@ -1468,7 +1468,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) struct at91_udc *udc = controller; if (!driver || !driver->unbind || !driver->disconnect) { - error("bad paramter\n"); + pr_err("bad paramter\n"); return -EINVAL; } diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index ad31703c7376..c0a95a97c9f4 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c @@ -1228,7 +1228,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) ret = driver->bind(&udc->gadget); if (ret) { - error("driver->bind() returned %d\n", ret); + pr_err("driver->bind() returned %d\n", ret); udc->driver = NULL; } @@ -1240,7 +1240,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) struct usba_udc *udc = &controller; if (!driver || !driver->unbind || !driver->disconnect) { - error("bad paramter\n"); + pr_err("bad paramter\n"); return -EINVAL; } @@ -1261,7 +1261,7 @@ static struct usba_ep *usba_udc_pdata(struct usba_platform_data *pdata, eps = malloc(sizeof(struct usba_ep) * pdata->num_ep); if (!eps) { - error("failed to alloc eps\n"); + pr_err("failed to alloc eps\n"); return NULL; } diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c index cb44374e81a6..088811c19136 100644 --- a/drivers/usb/gadget/dwc2_udc_otg.c +++ b/drivers/usb/gadget/dwc2_udc_otg.c @@ -835,7 +835,7 @@ int dwc2_udc_probe(struct dwc2_plat_otg_data *pdata) ROUND(sizeof(struct usb_ctrlrequest), CONFIG_SYS_CACHELINE_SIZE)); if (!usb_ctrl) { - error("No memory available for UDC!\n"); + pr_err("No memory available for UDC!\n"); return -ENOMEM; } diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 2cf5c8d31e25..2e0ff452d85f 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -1059,7 +1059,7 @@ static int eth_set_config(struct eth_dev *dev, unsigned number, && dev->config && dev->tx_qlen != 0) { /* tx fifo is full, but we can't clear it...*/ - error("can't change configurations"); + pr_err("can't change configurations"); return -ESPIPE; } eth_reset_config(dev); @@ -1233,7 +1233,7 @@ static void rndis_command_complete(struct usb_ep *ep, struct usb_request *req) /* received RNDIS command from USB_CDC_SEND_ENCAPSULATED_COMMAND */ status = rndis_msg_parser(dev->rndis_config, (u8 *) req->buf); if (status < 0) - error("%s: rndis parse error %d", __func__, status); + pr_err("%s: rndis parse error %d", __func__, status); } #endif /* RNDIS */ @@ -1554,7 +1554,7 @@ static int rx_submit(struct eth_dev *dev, struct usb_request *req, retval = usb_ep_queue(dev->out_ep, req, gfp_flags); if (retval) - error("rx submit --> %d", retval); + pr_err("rx submit --> %d", retval); return retval; } @@ -1624,7 +1624,7 @@ static int alloc_requests(struct eth_dev *dev, unsigned n, gfp_t gfp_flags) fail2: usb_ep_free_request(dev->in_ep, dev->tx_req); fail1: - error("can't alloc requests"); + pr_err("can't alloc requests"); return -1; } @@ -2060,7 +2060,7 @@ static int eth_bind(struct usb_gadget *gadget) * anything less functional on CDC-capable hardware, * so we fail in this case. */ - error("controller '%s' not recognized", + pr_err("controller '%s' not recognized", gadget->name); return -ENODEV; } @@ -2121,7 +2121,7 @@ static int eth_bind(struct usb_gadget *gadget) in_ep = usb_ep_autoconfig(gadget, &fs_source_desc); if (!in_ep) { autoconf_fail: - error("can't autoconfigure on %s\n", + pr_err("can't autoconfigure on %s\n", gadget->name); return -ENODEV; } @@ -2142,7 +2142,7 @@ autoconf_fail: if (status_ep) { status_ep->driver_data = status_ep; /* claim */ } else if (rndis) { - error("can't run RNDIS on %s", gadget->name); + pr_err("can't run RNDIS on %s", gadget->name); return -ENODEV; #ifdef CONFIG_USB_ETH_CDC } else if (cdc) { @@ -2244,7 +2244,7 @@ autoconf_fail: if (rndis) { status = rndis_init(); if (status < 0) { - error("can't init RNDIS, %d", status); + pr_err("can't init RNDIS, %d", status); goto fail; } } @@ -2335,7 +2335,7 @@ fail0: return 0; fail: - error("%s failed, status = %d", __func__, status); + pr_err("%s failed, status = %d", __func__, status); eth_unbind(gadget); return status; } @@ -2350,7 +2350,7 @@ int dm_usb_init(struct eth_dev *e_dev) ret = uclass_first_device(UCLASS_USB_DEV_GENERIC, &dev); if (!dev || ret) { - error("No USB device found\n"); + pr_err("No USB device found\n"); return -ENODEV; } @@ -2369,7 +2369,7 @@ static int _usb_eth_init(struct ether_priv *priv) #ifdef CONFIG_DM_USB if (dm_usb_init(dev)) { - error("USB ether not found\n"); + pr_err("USB ether not found\n"); return -ENODEV; } #else @@ -2393,11 +2393,11 @@ static int _usb_eth_init(struct ether_priv *priv) sizeof(host_addr)); if (!is_eth_addr_valid(dev_addr)) { - error("Need valid 'usbnet_devaddr' to be set"); + pr_err("Need valid 'usbnet_devaddr' to be set"); goto fail; } if (!is_eth_addr_valid(host_addr)) { - error("Need valid 'usbnet_hostaddr' to be set"); + pr_err("Need valid 'usbnet_hostaddr' to be set"); goto fail; } @@ -2427,7 +2427,7 @@ static int _usb_eth_init(struct ether_priv *priv) while (!dev->network_started) { /* Handle control-c and timeouts */ if (ctrlc() || (get_timer(ts) > timeout)) { - error("The remote end did not respond in time."); + pr_err("The remote end did not respond in time."); goto fail; } usb_gadget_handle_interrupts(0); @@ -2456,7 +2456,7 @@ static int _usb_eth_send(struct ether_priv *priv, void *packet, int length) rndis_pkt = malloc(length + sizeof(struct rndis_packet_msg_type)); if (!rndis_pkt) { - error("No memory to alloc RNDIS packet"); + pr_err("No memory to alloc RNDIS packet"); goto drop; } rndis_add_hdr(rndis_pkt, length); @@ -2574,7 +2574,7 @@ static int usb_eth_recv(struct eth_device *netdev) ret = _usb_eth_recv(priv); if (ret) { - error("error packet receive\n"); + pr_err("error packet receive\n"); return ret; } @@ -2585,7 +2585,7 @@ static int usb_eth_recv(struct eth_device *netdev) net_process_received_packet(net_rx_packets[0], dev->rx_req->length); } else { - error("dev->rx_req invalid"); + pr_err("dev->rx_req invalid"); } packet_received = 0; rx_submit(dev, dev->rx_req, 0); @@ -2641,7 +2641,7 @@ static int usb_eth_recv(struct udevice *dev, int flags, uchar **packetp) ret = _usb_eth_recv(priv); if (ret) { - error("error packet receive\n"); + pr_err("error packet receive\n"); return ret; } @@ -2650,7 +2650,7 @@ static int usb_eth_recv(struct udevice *dev, int flags, uchar **packetp) *packetp = (uchar *)net_rx_packets[0]; return ethdev->rx_req->length; } else { - error("dev->rx_req invalid"); + pr_err("dev->rx_req invalid"); return -EFAULT; } } @@ -2706,13 +2706,13 @@ int usb_ether_init(void) ret = uclass_first_device(UCLASS_USB_DEV_GENERIC, &usb_dev); if (!usb_dev || ret) { - error("No USB device found\n"); + pr_err("No USB device found\n"); return ret; } ret = device_bind_driver(usb_dev, "usb_ether", "usb_ether", &dev); if (!dev || ret) { - error("usb - not able to bind usb_ether device\n"); + pr_err("usb - not able to bind usb_ether device\n"); return ret; } diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index f3382a965bed..7acffb6c87e0 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -410,7 +410,7 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req) strsep(&cmd, ":"); if (!cmd) { - error("missing variable"); + pr_err("missing variable"); fastboot_tx_write_str("FAILmissing var"); return; } @@ -593,7 +593,7 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req) strsep(&cmd, ":"); if (!cmd) { - error("missing partition name"); + pr_err("missing partition name"); fastboot_tx_write_str("FAILmissing partition name"); return; } @@ -645,7 +645,7 @@ static void cb_erase(struct usb_ep *ep, struct usb_request *req) strsep(&cmd, ":"); if (!cmd) { - error("missing partition name"); + pr_err("missing partition name"); fastboot_tx_write_str("FAILmissing partition name"); return; } @@ -718,7 +718,7 @@ static void rx_handler_command(struct usb_ep *ep, struct usb_request *req) } if (!func_cb) { - error("unknown command: %.*s", req->actual, cmdbuf); + pr_err("unknown command: %.*s", req->actual, cmdbuf); fastboot_tx_write_str("FAILunknown command"); } else { if (req->actual < req->length) { @@ -726,7 +726,7 @@ static void rx_handler_command(struct usb_ep *ep, struct usb_request *req) buf[req->actual] = 0; func_cb(ep, req); } else { - error("buffer overflow"); + pr_err("buffer overflow"); fastboot_tx_write_str("FAILbuffer overflow"); } } diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c index 0fae66beabab..fd3da922a690 100644 --- a/drivers/usb/gadget/f_sdp.c +++ b/drivers/usb/gadget/f_sdp.c @@ -237,12 +237,12 @@ static void sdp_rx_command_complete(struct usb_ep *ep, struct usb_request *req) u8 report = data[0]; if (status != 0) { - error("Status: %d", status); + pr_err("Status: %d", status); return; } if (report != 1) { - error("Unexpected report %d", report); + pr_err("Unexpected report %d", report); return; } @@ -309,7 +309,7 @@ static void sdp_rx_command_complete(struct usb_ep *ep, struct usb_request *req) sdp->next_state = SDP_STATE_IDLE; break; default: - error("Unknown command: %04x\n", be16_to_cpu(cmd->cmd)); + pr_err("Unknown command: %04x\n", be16_to_cpu(cmd->cmd)); } } @@ -322,12 +322,12 @@ static void sdp_rx_data_complete(struct usb_ep *ep, struct usb_request *req) int datalen = req->length - 1; if (status != 0) { - error("Status: %d", status); + pr_err("Status: %d", status); return; } if (report != 2) { - error("Unexpected report %d", report); + pr_err("Unexpected report %d", report); return; } @@ -360,7 +360,7 @@ static void sdp_rx_data_complete(struct usb_ep *ep, struct usb_request *req) sdp->state = SDP_STATE_TX_SEC_CONF; break; default: - error("Invalid state: %d", sdp->state); + pr_err("Invalid state: %d", sdp->state); } } @@ -370,7 +370,7 @@ static void sdp_tx_complete(struct usb_ep *ep, struct usb_request *req) int status = req->status; if (status != 0) { - error("Status: %d", status); + pr_err("Status: %d", status); return; } @@ -393,7 +393,7 @@ static void sdp_tx_complete(struct usb_ep *ep, struct usb_request *req) sdp->state = SDP_STATE_IDLE; break; default: - error("Wrong State: %d", sdp->state); + pr_err("Wrong State: %d", sdp->state); sdp->state = SDP_STATE_IDLE; break; } diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c index cd4d9e659a39..18f233ab5876 100644 --- a/drivers/usb/gadget/f_thor.c +++ b/drivers/usb/gadget/f_thor.c @@ -174,7 +174,7 @@ static long long int download_head(unsigned long long total, transfer_buffer, THOR_STORE_UNIT_SIZE, (*cnt)++); if (ret) { - error("DFU write failed [%d] cnt: %d", + pr_err("DFU write failed [%d] cnt: %d", ret, *cnt); return ret; } @@ -218,20 +218,20 @@ static int download_tail(long long int left, int cnt) dfu_entity = dfu_get_entity(alt_setting_num); if (!dfu_entity) { - error("Alt setting: %d entity not found!\n", alt_setting_num); + pr_err("Alt setting: %d entity not found!\n", alt_setting_num); return -ENOENT; } transfer_buffer = dfu_get_buf(dfu_entity); if (!transfer_buffer) { - error("Transfer buffer not allocated!"); + pr_err("Transfer buffer not allocated!"); return -ENXIO; } if (left) { ret = dfu_write(dfu_entity, transfer_buffer, left, cnt++); if (ret) { - error("DFU write failed [%d]: left: %llu", ret, left); + pr_err("DFU write failed [%d]: left: %llu", ret, left); return ret; } } @@ -245,7 +245,7 @@ static int download_tail(long long int left, int cnt) */ ret = dfu_flush(dfu_entity, transfer_buffer, 0, cnt); if (ret) - error("DFU flush failed!"); + pr_err("DFU flush failed!"); return ret; } @@ -285,7 +285,7 @@ static long long int process_rqt_download(const struct rqt_box *rqt) alt_setting_num = dfu_get_alt(f_name); if (alt_setting_num < 0) { - error("Alt setting [%d] to write not found!", + pr_err("Alt setting [%d] to write not found!", alt_setting_num); rsp->ack = -ENODEV; ret = rsp->ack; @@ -311,7 +311,7 @@ static long long int process_rqt_download(const struct rqt_box *rqt) debug("DL EXIT\n"); break; default: - error("Operation not supported: %d", rqt->rqt_data); + pr_err("Operation not supported: %d", rqt->rqt_data); ret = -ENOTSUPP; } @@ -342,7 +342,7 @@ static int process_data(void) puts("RQT: UPLOAD not supported!\n"); break; default: - error("unknown request (%d)", rqt->rqt); + pr_err("unknown request (%d)", rqt->rqt); } return ret; @@ -541,7 +541,7 @@ static int thor_rx_data(void) status = usb_ep_queue(dev->out_ep, dev->out_req, 0); if (status) { - error("kill %s: resubmit %d bytes --> %d", + pr_err("kill %s: resubmit %d bytes --> %d", dev->out_ep->name, dev->out_req->length, status); usb_ep_set_halt(dev->out_ep); return -EAGAIN; @@ -575,7 +575,7 @@ static void thor_tx_data(unsigned char *data, int len) status = usb_ep_queue(dev->in_ep, dev->in_req, 0); if (status) { - error("kill %s: resubmit %d bytes --> %d", + pr_err("kill %s: resubmit %d bytes --> %d", dev->in_ep->name, dev->in_req->length, status); usb_ep_set_halt(dev->in_ep); } @@ -608,7 +608,7 @@ static void thor_rx_tx_complete(struct usb_ep *ep, struct usb_request *req) case -ESHUTDOWN: /* disconnect from host */ case -EREMOTEIO: /* short read */ case -EOVERFLOW: - error("ERROR:%d", status); + pr_err("ERROR:%d", status); break; } @@ -664,7 +664,7 @@ thor_func_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl) break; default: - error("thor_setup: unknown request: %d", ctrl->bRequest); + pr_err("thor_setup: unknown request: %d", ctrl->bRequest); } if (value >= 0) { @@ -973,7 +973,7 @@ static int thor_func_set_alt(struct usb_function *f, debug("Communication Data interface\n"); result = thor_eps_setup(f); if (result) - error("%s: EPs setup failed!", __func__); + pr_err("%s: EPs setup failed!", __func__); dev->configuration_done = 1; break; } diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c index 64c42ac47153..56406f2fd3c9 100644 --- a/drivers/usb/host/dwc2.c +++ b/drivers/usb/host/dwc2.c @@ -179,7 +179,7 @@ static int dwc_vbus_supply_init(struct udevice *dev) ret = regulator_set_enable(vbus_supply, true); if (ret) { - error("Error enabling vbus supply\n"); + pr_err("Error enabling vbus supply\n"); return ret; } diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c index 03f8d321af13..3947124f4044 100644 --- a/drivers/usb/host/ehci-generic.c +++ b/drivers/usb/host/ehci-generic.c @@ -51,7 +51,7 @@ static int ehci_usb_probe(struct udevice *dev) break; err = clk_enable(&priv->clocks[i]); if (err) { - error("failed to enable clock %d\n", i); + pr_err("failed to enable clock %d\n", i); clk_free(&priv->clocks[i]); goto clk_err; } @@ -59,7 +59,7 @@ static int ehci_usb_probe(struct udevice *dev) } } else { if (clock_nb != -ENOENT) { - error("failed to get clock phandle(%d)\n", clock_nb); + pr_err("failed to get clock phandle(%d)\n", clock_nb); return clock_nb; } } @@ -80,7 +80,7 @@ static int ehci_usb_probe(struct udevice *dev) break; if (reset_deassert(&priv->resets[i])) { - error("failed to deassert reset %d\n", i); + pr_err("failed to deassert reset %d\n", i); reset_free(&priv->resets[i]); goto reset_err; } @@ -88,7 +88,7 @@ static int ehci_usb_probe(struct udevice *dev) } } else { if (reset_nb != -ENOENT) { - error("failed to get reset phandle(%d)\n", reset_nb); + pr_err("failed to get reset phandle(%d)\n", reset_nb); goto clk_err; } } @@ -96,14 +96,14 @@ static int ehci_usb_probe(struct udevice *dev) err = generic_phy_get_by_index(dev, 0, &priv->phy); if (err) { if (err != -ENOENT) { - error("failed to get usb phy\n"); + pr_err("failed to get usb phy\n"); goto reset_err; } } else { err = generic_phy_init(&priv->phy); if (err) { - error("failed to init usb phy\n"); + pr_err("failed to init usb phy\n"); goto reset_err; } } @@ -122,17 +122,17 @@ phy_err: if (generic_phy_valid(&priv->phy)) { ret = generic_phy_exit(&priv->phy); if (ret) - error("failed to release phy\n"); + pr_err("failed to release phy\n"); } reset_err: ret = reset_release_all(priv->resets, priv->reset_count); if (ret) - error("failed to assert all resets\n"); + pr_err("failed to assert all resets\n"); clk_err: ret = clk_release_all(priv->clocks, priv->clock_count); if (ret) - error("failed to disable all clocks\n"); + pr_err("failed to disable all clocks\n"); return err; } diff --git a/drivers/usb/host/ohci-generic.c b/drivers/usb/host/ohci-generic.c index e22ee9793914..bf55a71d66c2 100644 --- a/drivers/usb/host/ohci-generic.c +++ b/drivers/usb/host/ohci-generic.c @@ -47,14 +47,14 @@ static int ohci_usb_probe(struct udevice *dev) err = clk_enable(&priv->clocks[i]); if (err) { - error("failed to enable clock %d\n", i); + pr_err("failed to enable clock %d\n", i); clk_free(&priv->clocks[i]); goto clk_err; } priv->clock_count++; } } else if (clock_nb != -ENOENT) { - error("failed to get clock phandle(%d)\n", clock_nb); + pr_err("failed to get clock phandle(%d)\n", clock_nb); return clock_nb; } @@ -74,28 +74,28 @@ static int ohci_usb_probe(struct udevice *dev) err = reset_deassert(&priv->resets[i]); if (err) { - error("failed to deassert reset %d\n", i); + pr_err("failed to deassert reset %d\n", i); reset_free(&priv->resets[i]); goto reset_err; } priv->reset_count++; } } else if (reset_nb != -ENOENT) { - error("failed to get reset phandle(%d)\n", reset_nb); + pr_err("failed to get reset phandle(%d)\n", reset_nb); goto clk_err; } err = generic_phy_get_by_index(dev, 0, &priv->phy); if (err) { if (err != -ENOENT) { - error("failed to get usb phy\n"); + pr_err("failed to get usb phy\n"); goto reset_err; } } else { err = generic_phy_init(&priv->phy); if (err) { - error("failed to init usb phy\n"); + pr_err("failed to init usb phy\n"); goto reset_err; } } @@ -110,17 +110,17 @@ phy_err: if (generic_phy_valid(&priv->phy)) { ret = generic_phy_exit(&priv->phy); if (ret) - error("failed to release phy\n"); + pr_err("failed to release phy\n"); } reset_err: ret = reset_release_all(priv->resets, priv->reset_count); if (ret) - error("failed to assert all resets\n"); + pr_err("failed to assert all resets\n"); clk_err: ret = clk_release_all(priv->clocks, priv->clock_count); if (ret) - error("failed to disable all clocks\n"); + pr_err("failed to disable all clocks\n"); return err; } diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c index 4191a894218f..258d1cd00a08 100644 --- a/drivers/usb/host/xhci-dwc3.c +++ b/drivers/usb/host/xhci-dwc3.c @@ -128,13 +128,13 @@ static int xhci_dwc3_probe(struct udevice *dev) ret = generic_phy_get_by_index(dev, 0, &plat->usb_phy); if (ret) { if (ret != -ENOENT) { - error("Failed to get USB PHY for %s\n", dev->name); + pr_err("Failed to get USB PHY for %s\n", dev->name); return ret; } } else { ret = generic_phy_init(&plat->usb_phy); if (ret) { - error("Can't init USB PHY for %s\n", dev->name); + pr_err("Can't init USB PHY for %s\n", dev->name); return ret; } } @@ -161,7 +161,7 @@ static int xhci_dwc3_remove(struct udevice *dev) if (generic_phy_valid(&plat->usb_phy)) { ret = generic_phy_exit(&plat->usb_phy); if (ret) { - error("Can't deinit USB PHY for %s\n", dev->name); + pr_err("Can't deinit USB PHY for %s\n", dev->name); return ret; } } diff --git a/drivers/usb/host/xhci-rockchip.c b/drivers/usb/host/xhci-rockchip.c index ec55f4e59f75..a72d305df296 100644 --- a/drivers/usb/host/xhci-rockchip.c +++ b/drivers/usb/host/xhci-rockchip.c @@ -48,7 +48,7 @@ static int xhci_usb_ofdata_to_platdata(struct udevice *dev) */ plat->hcd_base = devfdt_get_addr(dev); if (plat->hcd_base == FDT_ADDR_T_NONE) { - error("Can't get the XHCI register base address\n"); + pr_err("Can't get the XHCI register base address\n"); return -ENXIO; } @@ -62,7 +62,7 @@ static int xhci_usb_ofdata_to_platdata(struct udevice *dev) } if (plat->phy_base == FDT_ADDR_T_NONE) { - error("Can't get the usbphy register address\n"); + pr_err("Can't get the usbphy register address\n"); return -ENXIO; } @@ -119,7 +119,7 @@ static int rockchip_xhci_core_init(struct rockchip_xhci *rkxhci, ret = dwc3_core_init(rkxhci->dwc3_reg); if (ret) { - error("failed to initialize core\n"); + pr_err("failed to initialize core\n"); return ret; } @@ -151,14 +151,14 @@ static int xhci_usb_probe(struct udevice *dev) if (plat->vbus_supply) { ret = regulator_set_enable(plat->vbus_supply, true); if (ret) { - error("XHCI: failed to set VBus supply\n"); + pr_err("XHCI: failed to set VBus supply\n"); return ret; } } ret = rockchip_xhci_core_init(ctx, dev); if (ret) { - error("XHCI: failed to initialize controller\n"); + pr_err("XHCI: failed to initialize controller\n"); return ret; } @@ -181,7 +181,7 @@ static int xhci_usb_remove(struct udevice *dev) if (plat->vbus_supply) { ret = regulator_set_enable(plat->vbus_supply, false); if (ret) - error("XHCI: failed to set VBus supply\n"); + pr_err("XHCI: failed to set VBus supply\n"); } return ret; diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c index de101319cdaa..233857ad7a13 100644 --- a/drivers/usb/musb-new/ti-musb.c +++ b/drivers/usb/musb-new/ti-musb.c @@ -106,7 +106,7 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev) "mentor,multipoint", -1); if (platdata->musb_config.multipoint < 0) { - error("MUSB multipoint DT entry missing\n"); + pr_err("MUSB multipoint DT entry missing\n"); return -ENOENT; } @@ -115,14 +115,14 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev) platdata->musb_config.num_eps = fdtdec_get_int(fdt, node, "mentor,num-eps", -1); if (platdata->musb_config.num_eps < 0) { - error("MUSB num-eps DT entry missing\n"); + pr_err("MUSB num-eps DT entry missing\n"); return -ENOENT; } platdata->musb_config.ram_bits = fdtdec_get_int(fdt, node, "mentor,ram-bits", -1); if (platdata->musb_config.ram_bits < 0) { - error("MUSB ram-bits DT entry missing\n"); + pr_err("MUSB ram-bits DT entry missing\n"); return -ENOENT; } @@ -132,7 +132,7 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev) platdata->plat.power = fdtdec_get_int(fdt, node, "mentor,power", -1); if (platdata->plat.power < 0) { - error("MUSB mentor,power DT entry missing\n"); + pr_err("MUSB mentor,power DT entry missing\n"); return -ENOENT; } @@ -183,7 +183,7 @@ static int ti_musb_host_ofdata_to_platdata(struct udevice *dev) ret = ti_musb_ofdata_to_platdata(dev); if (ret) { - error("platdata dt parse error\n"); + pr_err("platdata dt parse error\n"); return ret; } @@ -229,7 +229,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent) ret = device_bind_driver_to_node(parent, "ti-musb-host", name, offset_to_ofnode(node), &dev); if (ret) { - error("musb - not able to bind usb host node\n"); + pr_err("musb - not able to bind usb host node\n"); return ret; } break; diff --git a/drivers/video/am335x-fb.c b/drivers/video/am335x-fb.c index bb5cc9788abf..a8b3e747a032 100644 --- a/drivers/video/am335x-fb.c +++ b/drivers/video/am335x-fb.c @@ -128,7 +128,7 @@ int am335xfb_init(struct am335x_lcdpanel *panel) raster_ctrl |= LCD_TFT_24BPP_MODE; break; default: - error("am335x-fb: invalid bpp value: %d\n", panel->bpp); + pr_err("am335x-fb: invalid bpp value: %d\n", panel->bpp); return -1; } diff --git a/env/common.c b/env/common.c index b403bd5f6c12..70715bb6e756 100644 --- a/env/common.c +++ b/env/common.c @@ -84,7 +84,7 @@ void set_default_env(const char *s) if (himport_r(&env_htab, (char *)default_environment, sizeof(default_environment), '\0', flags, 0, 0, NULL) == 0) - error("Environment import failed: errno = %d\n", errno); + pr_err("Environment import failed: errno = %d\n", errno); gd->flags |= GD_FLG_ENV_READY; gd->flags |= GD_FLG_ENV_DEFAULT; @@ -172,7 +172,7 @@ int env_import(const char *buf, int check) /* Decrypt the env if desired. */ ret = env_aes_cbc_crypt(ep, 0); if (ret) { - error("Failed to decrypt env!\n"); + pr_err("Failed to decrypt env!\n"); set_default_env("!import failed"); return ret; } @@ -183,7 +183,7 @@ int env_import(const char *buf, int check) return 1; } - error("Cannot import environment: errno = %d\n", errno); + pr_err("Cannot import environment: errno = %d\n", errno); set_default_env("!import failed"); @@ -247,7 +247,7 @@ int env_export(env_t *env_out) res = (char *)env_out->data; len = hexport_r(&env_htab, '\0', 0, &res, ENV_SIZE, 0, NULL); if (len < 0) { - error("Cannot export environment: errno = %d\n", errno); + pr_err("Cannot export environment: errno = %d\n", errno); return 1; } diff --git a/env/sf.c b/env/sf.c index 6f74371c0982..e51b1ae18916 100644 --- a/env/sf.c +++ b/env/sf.c @@ -236,7 +236,7 @@ static int env_sf_load(void) ret = env_import((char *)ep, 0); if (!ret) { - error("Cannot import environment: errno = %d\n", errno); + pr_err("Cannot import environment: errno = %d\n", errno); set_default_env("!env_import failed"); } diff --git a/fs/jffs2/jffs2_nand_1pass.c b/fs/jffs2/jffs2_nand_1pass.c index 1d63fc94340e..b16005e6045f 100644 --- a/fs/jffs2/jffs2_nand_1pass.c +++ b/fs/jffs2/jffs2_nand_1pass.c @@ -798,7 +798,7 @@ jffs2_1pass_build_lists(struct part_info * part) struct mtdids *id = part->dev->id; mtd = get_nand_dev_by_index(id->num); if (!mtd) { - error("\nno NAND devices available\n"); + pr_err("\nno NAND devices available\n"); return 0; } diff --git a/fs/yaffs2/yaffs_uboot_glue.c b/fs/yaffs2/yaffs_uboot_glue.c index bd66d31697f5..2a70e4a543e0 100644 --- a/fs/yaffs2/yaffs_uboot_glue.c +++ b/fs/yaffs2/yaffs_uboot_glue.c @@ -168,7 +168,7 @@ void cmd_yaffs_devconfig(char *_mp, int flash_dev, mtd = get_nand_dev_by_index(flash_dev); if (!mtd) { - error("\nno NAND devices available\n"); + pr_err("\nno NAND devices available\n"); return; } From patchwork Sat Sep 16 05:10:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 112776 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1390323qgf; Fri, 15 Sep 2017 22:12:26 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBCxhLZZZBHZUwPaYm/BOoi26kDDzj2t5MbHY4WNtYhRPW8M0Aerqk/bzLcDQjFxPtFA55f X-Received: by 10.80.166.145 with SMTP id e17mr10884806edc.51.1505538746253; Fri, 15 Sep 2017 22:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505538746; cv=none; d=google.com; s=arc-20160816; b=w8xNjsP3nLSf30jEn9WYW6HYukTDsJigKfzikRSnJRZ2cIfut6biZL3zJEDaHNUbnl lFoUzcVZTr76uFkaXREtqyIVcS263EjzvJGS/IBfuU2RfFnhFGK4K8Nbf52mjqQ4Jk7o Wkziks/UKEpG4wwnteorQewlRkVfLP/mujuFllosj9oTfBOHBAm7LHj50GfVwXKs2zA8 oZil31B+sHydcA8Ej153Ijl7Ashkg462EkdgSJxP8JIz5oHWide9M9ZY+/7oCTDiQoyr Sk43k5QuTpZ0ki0AD1uHcERN2VpXLJI0TUXVL+DwwZ4HiOESQnBZNNo7u/50SMM4Xe0R E5/A== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=HjIEfD0ATEfkKOnjte7qMFTU+PlbrSX90KYfZk3Uytg=; b=JzTZy5dwwIbNQrjM4N7R6sIdyRdht2hvBKgoXzMVCyU/bIOMmg3j9uFJV62kq8eAn/ s5gpxM6+l/YFg6NZgI5LS7IthT0OniyHYE9ySl4WEkrtYT5GxejDPIjWWIQv6vSPxykK hfpfGdbusQ2Jn6OQL3YjVTEOBf/Cc0ylkFmt1RqKAO2rGnqk+DS/NUwQsAxHkUHxPPuy Y2r12uFsi5kbxsl0ZgFWOPyanmh6xBxF44mlNG98RtwDCARJ5+HPize6PpmuZH9KXav3 O7p8lWYJeTRzWq3zT6AwAhq6x2XnvlZtmozwkTnPLfOPLmS3ns/xrhsGMWCLBJp4jvRZ oP1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=imbg2Hwz; 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 5si2659584edp.47.2017.09.15.22.12.25; Fri, 15 Sep 2017 22:12:26 -0700 (PDT) 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=imbg2Hwz; 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 9DAD8C21FBE; Sat, 16 Sep 2017 05:11:55 +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 30CDDC21F8B; Sat, 16 Sep 2017 05:11:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8C22DC21C93; Sat, 16 Sep 2017 05:11:18 +0000 (UTC) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lists.denx.de (Postfix) with ESMTPS id D58C5C21E10 for ; Sat, 16 Sep 2017 05:11:16 +0000 (UTC) Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-09.nifty.com with ESMTP id v8G5Asoo028761; Sat, 16 Sep 2017 14:10:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v8G5Asoo028761 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1505538658; bh=ji/xVK2hcYyZFkFV1LPq/yG2wbXQgVjQU1gaR+ayHy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=imbg2HwzqFPtK1aSKAwMBMKhc5os5NyAm4+zX8CAd3LlCbba71PlkRr2kEFMxK4fZ XH2NmsqFagIZDKZ9xUjKj5TjgdEakKi6lLJ/nZxqbZIS1SbbBH8uVIqtLUzt4JHnQQ NcfKVnssAbU1YYceAnEiOF0UbT3jkXIMQV52J2NuZ5+WCQJwr6rGgaFcAagEUkr8nP G+wyo3NqaP6XeAzJaPkq9I3FkRA4T4/ofJpp5TkP0Dbfuq0kd8RLYg7STdGCvDxF54 PNGbf/5RdqqSIAXWkNTzM/hYAMifwPbGOVG+artaTbO+3WVyDsbXe8QdmZn4dvtXJm bQVlTIL0WPdVg== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 16 Sep 2017 14:10:42 +0900 Message-Id: <1505538646-19191-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> References: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH v2 4/8] common.h: remove error() 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" This macro prevents us from using compiletime_error/assert defined in . Now we can remove it, then we will be able to import more BUILD_BUG macros from Linux. Signed-off-by: Masahiro Yamada --- Changes in v2: None include/common.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/common.h b/include/common.h index 4eb92298a207..7ea78bde83f7 100644 --- a/include/common.h +++ b/include/common.h @@ -90,11 +90,6 @@ void __assert_fail(const char *assertion, const char *file, unsigned line, ({ if (!(x) && _DEBUG) \ __assert_fail(#x, __FILE__, __LINE__, __func__); }) -#define error(fmt, args...) do { \ - printf("ERROR: " pr_fmt(fmt) "\nat %s:%d/%s()\n", \ - ##args, __FILE__, __LINE__, __func__); \ -} while (0) - #ifndef BUG #define BUG() do { \ printf("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ From patchwork Sat Sep 16 05:10:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 112775 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1390151qgf; Fri, 15 Sep 2017 22:12:08 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCDJ2iduPX+a/vtidVVyDrXDMuzNojwm6oDR/7sF1WgnmLBEifDbwjn4mejU4wX2TwEGrKT X-Received: by 10.80.179.185 with SMTP id s54mr9733179edd.164.1505538727920; Fri, 15 Sep 2017 22:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505538727; cv=none; d=google.com; s=arc-20160816; b=LKNRDeIvwkR699PGddmUg5QPAo3M6uBuM2rg13qnF6UndOjM0zDWrEqKGhbpiqETE6 u0h/p8eC5qqLqOTeW8ww8oqfaZWkEXlkf7gXmXVmLqge8O4+POLrV9jgFxDHISUz9ONG JcXVgLJ5AkS0So9i6ISQfww042YNJNwqksiXSBbZcgyAwUe3FixReghg7MZh+0cw5uel IljZneRbEovweTEyvAMyzYZz2KupBz63Aiv8irF0UP7PxpaNhRZrqr3kV3u/8s4yg0ms reR2rfOH/ycjNFZb0M7wgT7Np2iNKk+qgOlFNON0mHNv2IwNJxG//Ys2UJ6WvBmedJq6 M5xw== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=gkwsMkooqBIiFrLMN4yhn64hbkPJTWN0wbV8uO2sY3k=; b=ey5H69eFWEJVfX4B8zqpVeBoonEZD9g0ZkRJhfKw0kG8MAoh+aJoTBBilJiqsj5N86 CfvDLF6UQCETUwQdgEAcsdtBl84N/lJPxTmByVUEWqnUiC4yEffvOgniaqsijcNRta44 o/jH34Qw2P+wjao8Jvk32Si0anAU/2TRkUyzvaxRzEmTh+YWpVId2f1XKtZAQth5dfYv 4l9FXS8HUBe+6T31E9mrYLuGSuB1ZUHZdjCcXz5FxLjxt2Eu8vFLAL8rIM+yR3v8OleW o+n08H0MGTDD+d3L/QB9RQq+tpkcWix4RVs1uonB+ngtim7kOrTZb1R86N6LyodTrq1X gV4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=UoAsOQla; 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 y6si2716876edj.244.2017.09.15.22.12.07; Fri, 15 Sep 2017 22:12:07 -0700 (PDT) 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=UoAsOQla; 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 7C82FC21F7F; Sat, 16 Sep 2017 05:11:39 +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 59540C21E9D; Sat, 16 Sep 2017 05:11:20 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7DCF9C21C8F; Sat, 16 Sep 2017 05:11:18 +0000 (UTC) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lists.denx.de (Postfix) with ESMTPS id B8A26C21C93 for ; Sat, 16 Sep 2017 05:11:16 +0000 (UTC) Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-09.nifty.com with ESMTP id v8G5Asop028761; Sat, 16 Sep 2017 14:10:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v8G5Asop028761 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1505538658; bh=NQpmqvMl/G9qZoEAt8YkCfhlvVw055eae53n2UYNAhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UoAsOQlaWhJwt1ZsE3++pJc5sZ5NKA+schRjidQ/f41pdxY1c+tsQAX8MZhGOAgeE PAzkllY7FmF19ru6L/ukJ8uBs9BPqkc9LYFsGKiZG0vVrm+eBrYmLkQyWei1MTknah r32AJH4VnrghUHVO7d0oVxZ6to0JsGlWrtHgk7KqvXC6uphZSJLuEVeQrXvwTP8Nfr zzkO1P1TcKBjku9yzOD3S5/Mq3K7IX3tU/gZVc9h36C/39kFNheYcHX0jbtgdOsmMH +KdokQOqzFbpEa18X9ReG6SM9MmIlW9ogHOiKj1fqIG2dLP7dgyzVqjj2p4kLk+ffn As5Z1qu+Gm/2w== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 16 Sep 2017 14:10:43 +0900 Message-Id: <1505538646-19191-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> References: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH v2 5/8] vsprintf.h: include 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" This header uses ulong, size_t, loff_t. Include to make this header self-contained. Signed-off-by: Masahiro Yamada --- Changes in v2: None include/vsprintf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/vsprintf.h b/include/vsprintf.h index 490c96ca6d1f..33d05aa0c65c 100644 --- a/include/vsprintf.h +++ b/include/vsprintf.h @@ -9,6 +9,7 @@ #define __VSPRINTF_H #include +#include ulong simple_strtoul(const char *cp, char **endp, unsigned int base); From patchwork Sat Sep 16 05:10:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 112779 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1391293qgf; Fri, 15 Sep 2017 22:13:58 -0700 (PDT) X-Google-Smtp-Source: ADKCNb42jprC3vVQESZKNRtFxu5zPH1uklV376qTj9riar9lA+g3ySIYtSru2vUIDnjHg+C0fUZv X-Received: by 10.80.220.202 with SMTP id v10mr14752585edk.226.1505538838432; Fri, 15 Sep 2017 22:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505538838; cv=none; d=google.com; s=arc-20160816; b=qRQetVFCag5exOKMaGU8cjJYVdyZiobOsXB7DtyA5SctgeVXohU6pzxPw213J7CsAT +l8YfoHaNxxLAr2SELmnNrfHIFz2erpM/F1U0xocqqQaSIdJSU4kt1b/iG0+UxDUxy7p DV4XZWF58azEiaJb7I5pmgO6HEUxF1lDqi9f6f0Lbfuf1NC1BdMrfxKVRsdVPRIryzCz f3YSQmRI4s8EDzGb3AjgWFsxnNSlHJTk7B74Em4P+btOIYhg4kV80oMsGxb3oP6dPZFK 9kL8NviTYL2zHLHSLII2CeQR/krQNTlrfyLEnAUX9sNP1A0+cMJZFWvyzYxi3jCX8ip6 tBPw== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=h5GUEKsiiJQ8sxG+bjffeAcGi97wgCvMl0rOkOPhfh8=; b=OmxkbBsHwxhUjPtpMOG+NZlWlTKTBlnH6CxlukzdLmb82dCuF4w4Pw/LnolsC8S/p3 rjR+SDT5LSHmE3XRMHS8MBHKHb7tcMYAFl1hV/qgkA/px5afxWVBe/dpStRRTBbW8Tig OuCVEIQQPgfFVGSSYIyy/VbSVvp9rl94vhFPSGrvfObk/mrjzu8ZJJAAa81I8BGUZLj6 rvE3m6bc9pRgSEFo3Ru56XU/nmgFviZL8uK5SCb6g4lMTvtFVgoKvxNGzKTeBTM518aI puLO2WgEeqVCrIT2lgdzbVp1x3PISAzHph7M0xYg4DB1KwIohS75BnRggC/R4kE0GDas fNEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=UTlJOvw2; 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 28si2718460edv.243.2017.09.15.22.13.58; Fri, 15 Sep 2017 22:13:58 -0700 (PDT) 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=UTlJOvw2; 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 F1A5CC21F54; Sat, 16 Sep 2017 05:12:28 +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 D8512C21FA9; Sat, 16 Sep 2017 05:11:23 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B9FB0C21C8F; Sat, 16 Sep 2017 05:11:18 +0000 (UTC) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lists.denx.de (Postfix) with ESMTPS id D306DC21D75 for ; Sat, 16 Sep 2017 05:11:16 +0000 (UTC) Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-09.nifty.com with ESMTP id v8G5Asoq028761; Sat, 16 Sep 2017 14:10:59 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v8G5Asoq028761 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1505538659; bh=Z8tpfk4MDXbT++gKREjTetQMSvWDgZ1/QaDPyQQRTbw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UTlJOvw2mohfSVPFvT1vNQutwHAM41wbmdOkyS2lGN2D/CgOROaGeSxzUPnvtxdZ7 ncs8dZ1q+qhtj7EnbBukhrNAdH/wGkiK4IiFyyUHv+qfjrrxERpjT4LNGBBFtmZrGo D7+IHEToai9Z5q5bAdEFOKqPZ1oVsxdMNFYATS6Zo8E+pDuWz2DJZvneK6attSWloF mC7dq6slWcW+wAQkxdgqpKrWXg/gQ2QsU7Xw8FbgZy51GT/OEqJKpj2vXk21zBZ+MU l2npcp6QYK3onxPQlnFjTQ+EU68LTMDL51zdXssiBGPkAFxBUNdIPFgmNqNoKOSWuA TaSZC1wNYQwfg== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 16 Sep 2017 14:10:44 +0900 Message-Id: <1505538646-19191-7-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> References: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH v2 6/8] bug.h: sync BUILD_BUG stuff with Linux 4.13 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" As commit 84b8bf6d5d2a ("bug.h: move BUILD_BUG_* defines to include/linux/bug.h") noted, include/linux/bug.h was locally modified for U-Boot because the name conflict of error() caused build errors at that time. Now error() is gone, so we can fully sync BUILD_BUG* with Linux. These macros are just compile-time utilities. Nothing depends on platform code, so it should make sense to simply copy Linux's ones. Please note Linux split BUILD_BUG stuff out into by commit bc6245e5efd7. Let's follow it. Signed-off-by: Masahiro Yamada --- Changes in v2: None include/linux/bug.h | 51 +--------------------------- include/linux/build_bug.h | 84 +++++++++++++++++++++++++++++++++++++++++++++++ include/linux/compiler.h | 6 +++- 3 files changed, 90 insertions(+), 51 deletions(-) create mode 100644 include/linux/build_bug.h diff --git a/include/linux/bug.h b/include/linux/bug.h index 920e3796c38d..133544ca46f0 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h @@ -1,55 +1,6 @@ #ifndef _LINUX_BUG_H #define _LINUX_BUG_H -#include - -#ifdef __CHECKER__ -#define BUILD_BUG_ON_NOT_POWER_OF_2(n) (0) -#define BUILD_BUG_ON_ZERO(e) (0) -#define BUILD_BUG_ON_NULL(e) ((void*)0) -#define BUILD_BUG_ON_INVALID(e) (0) -#define BUILD_BUG_ON(condition) (0) -#define BUILD_BUG() (0) -#else /* __CHECKER__ */ - -/* Force a compilation error if a constant expression is not a power of 2 */ -#define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ - BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) - -/* Force a compilation error if condition is true, but also produce a - result (of value 0 and type size_t), so the expression can be used - e.g. in a structure initializer (or where-ever else comma expressions - aren't permitted). */ -#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) -#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); })) - -/* - * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the - * expression but avoids the generation of any code, even if that expression - * has side-effects. - */ -#define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e)))) - -/** - * BUILD_BUG_ON - break compile if a condition is true. - * @condition: the condition which the compiler should know is false. - * - * If you have some code which relies on certain constants being equal, or - * some other compile-time-evaluated condition, you should use BUILD_BUG_ON to - * detect if someone changes it. - * - * The implementation uses gcc's reluctance to create a negative array, but gcc - * (as of 4.4) only emits that error for obvious cases (e.g. not arguments to - * inline functions). Luckily, in 4.3 they added the "error" function - * attribute just for this type of case. Thus, we use a negative sized array - * (should always create an error on gcc versions older than 4.4) and then call - * an undefined function with the error attribute (should always create an - * error on gcc 4.3 and later). If for some reason, neither creates a - * compile-time error, we'll still have a link-time error, which is harder to - * track down. - */ -#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) - -#endif /* __CHECKER__ */ +#include #endif /* _LINUX_BUG_H */ diff --git a/include/linux/build_bug.h b/include/linux/build_bug.h new file mode 100644 index 000000000000..b7d22d60008a --- /dev/null +++ b/include/linux/build_bug.h @@ -0,0 +1,84 @@ +#ifndef _LINUX_BUILD_BUG_H +#define _LINUX_BUILD_BUG_H + +#include + +#ifdef __CHECKER__ +#define __BUILD_BUG_ON_NOT_POWER_OF_2(n) (0) +#define BUILD_BUG_ON_NOT_POWER_OF_2(n) (0) +#define BUILD_BUG_ON_ZERO(e) (0) +#define BUILD_BUG_ON_NULL(e) ((void *)0) +#define BUILD_BUG_ON_INVALID(e) (0) +#define BUILD_BUG_ON_MSG(cond, msg) (0) +#define BUILD_BUG_ON(condition) (0) +#define BUILD_BUG() (0) +#else /* __CHECKER__ */ + +/* Force a compilation error if a constant expression is not a power of 2 */ +#define __BUILD_BUG_ON_NOT_POWER_OF_2(n) \ + BUILD_BUG_ON(((n) & ((n) - 1)) != 0) +#define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ + BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) + +/* + * Force a compilation error if condition is true, but also produce a + * result (of value 0 and type size_t), so the expression can be used + * e.g. in a structure initializer (or where-ever else comma expressions + * aren't permitted). + */ +#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); })) +#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:(-!!(e)); })) + +/* + * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the + * expression but avoids the generation of any code, even if that expression + * has side-effects. + */ +#define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e)))) + +/** + * BUILD_BUG_ON_MSG - break compile if a condition is true & emit supplied + * error message. + * @condition: the condition which the compiler should know is false. + * + * See BUILD_BUG_ON for description. + */ +#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) + +/** + * BUILD_BUG_ON - break compile if a condition is true. + * @condition: the condition which the compiler should know is false. + * + * If you have some code which relies on certain constants being equal, or + * some other compile-time-evaluated condition, you should use BUILD_BUG_ON to + * detect if someone changes it. + * + * The implementation uses gcc's reluctance to create a negative array, but gcc + * (as of 4.4) only emits that error for obvious cases (e.g. not arguments to + * inline functions). Luckily, in 4.3 they added the "error" function + * attribute just for this type of case. Thus, we use a negative sized array + * (should always create an error on gcc versions older than 4.4) and then call + * an undefined function with the error attribute (should always create an + * error on gcc 4.3 and later). If for some reason, neither creates a + * compile-time error, we'll still have a link-time error, which is harder to + * track down. + */ +#ifndef __OPTIMIZE__ +#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) +#else +#define BUILD_BUG_ON(condition) \ + BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition) +#endif + +/** + * BUILD_BUG - break compile if used. + * + * If you have some code that you expect the compiler to eliminate at + * build time, you should use BUILD_BUG to detect if it is + * unexpectedly used. + */ +#define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") + +#endif /* __CHECKER__ */ + +#endif /* _LINUX_BUILD_BUG_H */ diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 020ad16a0493..0ea6c8fccaab 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -476,7 +476,8 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s # define __compiletime_error_fallback(condition) do { } while (0) #endif -#define __compiletime_assert(condition, msg, prefix, suffix) \ +#ifdef __OPTIMIZE__ +# define __compiletime_assert(condition, msg, prefix, suffix) \ do { \ bool __cond = !(condition); \ extern void prefix ## suffix(void) __compiletime_error(msg); \ @@ -484,6 +485,9 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s prefix ## suffix(); \ __compiletime_error_fallback(__cond); \ } while (0) +#else +# define __compiletime_assert(condition, msg, prefix, suffix) do { } while (0) +#endif #define _compiletime_assert(condition, msg, prefix, suffix) \ __compiletime_assert(condition, msg, prefix, suffix) From patchwork Sat Sep 16 05:10:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 112774 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1389827qgf; Fri, 15 Sep 2017 22:11:36 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5Zb/LZYbqk1nDKteR/Ackdt7sHorgpsaTQDiiUwbEzt4n1CR9uiZ4fo+5STC9VLUyxT0tV X-Received: by 10.80.204.151 with SMTP id q23mr21912583edi.104.1505538696186; Fri, 15 Sep 2017 22:11:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505538696; cv=none; d=google.com; s=arc-20160816; b=02R8reJN7oC7Ie2lgkUdZBFIp1ypVAKlLzvr0EWeQsWx4gZFz4cyAdrSrSFrhyYl9L YCLq4r6Mz65ACo4aY4fqUtCoYzoYq0+TADAujdShnkDhi2Yh7YWBIocDdcd2JiPww31h Qvl4X6SnOMoO5og4OiF17xIE673U2cUp6rITfTabbsBnFSH4fSghNvHAQA8NiKY9zusU iGlWY0YCpVx0zP6GxFE4FS4cxShFCCTAOqNH4C0MmHByW/FBMSEk2GlxaNcvVLj+zoIe V6SDquhP4Np6SIJS0ewV1Aby5oEaKoDsaW1o8lMfxCfXaMx1u6QsQCwMF02MDg++OXnB NgvA== 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=CHft9mSOcTSd23r6ZLNnLbaRzRee2zwaWOk7a3H1ta8=; b=EURZ31LqFsyUkKOedqzqTxhyxo8jNBmns+ap3LdEMzQwke0MRIfH1Zn1691vMBRZqm 1RshSAIQcAobkuforiN+befRkPN0mCCKDxLc0ksDci33iLStd5WRPj7I3jG6lFWmWnnO tY82cn1JQzjMDfXrrWW+x13Hp/z1meGp4MbY2bL0vWJ0vJKJy7TIlvjvn2lQkSq4xuDP E9ns9aWRT5JUJN9gXAC0GOgArVh82PienyZK7tXDiXAKx4wxqP+nD3cLqxOLwduV1jyM NlshdKCKjbexConDzbjJqzwACFZK1uAPNZYFjD3dO05lAB6DQvEb5hM8nqZ298eFkLib Gwjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=gI4WSdFf; 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 l92si2986925edl.554.2017.09.15.22.11.34; Fri, 15 Sep 2017 22:11:36 -0700 (PDT) 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=gI4WSdFf; 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 B2382C21EE5; Sat, 16 Sep 2017 05:11:21 +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 8BD88C21C8F; Sat, 16 Sep 2017 05:11:19 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 720D8C21E3A; Sat, 16 Sep 2017 05:11:18 +0000 (UTC) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lists.denx.de (Postfix) with ESMTPS id B83FEC21C8F for ; Sat, 16 Sep 2017 05:11:16 +0000 (UTC) Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-09.nifty.com with ESMTP id v8G5Asor028761; Sat, 16 Sep 2017 14:10:59 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v8G5Asor028761 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1505538659; bh=A63E+oN4bdOzQW6ervG8jDMF1APDB6VdHqCymxPHA2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gI4WSdFf1JJaICwRJT8ietKt4vl3PuDIvNawXi/puGBj4U8BsdD6ttjlLd+7lxDVW nzoJLQZVWb2VILu/I3Qzj5m73U4g30jFsNV4z3eaqpLpcRO8A6VLlWZIjIBVeg4RTE /PWygn4r9dtQ6twv1dqUP1DSo/6Dlg72Bt8gD9snshWq8vHxbM2gOM/NIH8u8ap5Kj Vx+grHcMZuWDR57p/GxOpRbXGhC4OjEaTWpisj98PmiS7kO9XkpF++UZt+dTwn2dNh 883Nc/Tl49rPNrcN6apAzEv1UGrcwb4iEbfXVJ5/95VAEFir02b1sHZUuwd3s/D854 JYZdCicUC0pyA== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 16 Sep 2017 14:10:45 +0900 Message-Id: <1505538646-19191-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> References: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> Cc: Marek Vasut Subject: [U-Boot] [PATCH v2 7/8] bug.h: move runtime BUG/WARN macros into 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" Collect runtime BUG/WARN into a self-contained header to make these macros easier to use. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/usb/dwc3/linux-compat.h | 1 - include/common.h | 9 +-------- include/linux/bug.h | 28 ++++++++++++++++++++++++++++ include/linux/compat.h | 15 --------------- 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/drivers/usb/dwc3/linux-compat.h b/drivers/usb/dwc3/linux-compat.h index 64db4ecc3c6f..5cbe377e3cd9 100644 --- a/drivers/usb/dwc3/linux-compat.h +++ b/drivers/usb/dwc3/linux-compat.h @@ -14,7 +14,6 @@ #define WARN(val, format, arg...) debug(format, ##arg) #define dev_WARN(dev, format, arg...) debug(format, ##arg) -#define WARN_ON_ONCE(val) debug("Error %d\n", val) static inline size_t strlcat(char *dest, const char *src, size_t n) { diff --git a/include/common.h b/include/common.h index 7ea78bde83f7..18963355840d 100644 --- a/include/common.h +++ b/include/common.h @@ -23,6 +23,7 @@ typedef volatile unsigned char vu_char; #include #include #include +#include #include #include #include @@ -90,14 +91,6 @@ void __assert_fail(const char *assertion, const char *file, unsigned line, ({ if (!(x) && _DEBUG) \ __assert_fail(#x, __FILE__, __LINE__, __func__); }) -#ifndef BUG -#define BUG() do { \ - printf("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ - panic("BUG!"); \ -} while (0) -#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0) -#endif /* BUG */ - typedef void (interrupt_handler_t)(void *); #include /* boot information for Linux kernel */ diff --git a/include/linux/bug.h b/include/linux/bug.h index 133544ca46f0..f07bb716fc04 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h @@ -1,6 +1,34 @@ #ifndef _LINUX_BUG_H #define _LINUX_BUG_H +#include /* for panic() */ #include +#include +#include + +#define BUG() do { \ + printk("BUG at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ + panic("BUG!"); \ +} while (0) + +#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) + +#define WARN_ON(condition) ({ \ + int __ret_warn_on = !!(condition); \ + if (unlikely(__ret_warn_on)) \ + printk("WARNING at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ + unlikely(__ret_warn_on); \ +}) + +#define WARN_ON_ONCE(condition) ({ \ + static bool __warned; \ + int __ret_warn_once = !!(condition); \ + \ + if (unlikely(__ret_warn_once && !__warned)) { \ + __warned = true; \ + WARN_ON(1); \ + } \ + unlikely(__ret_warn_once); \ +}) #endif /* _LINUX_BUG_H */ diff --git a/include/linux/compat.h b/include/linux/compat.h index bc027adcb936..1b3f089687e4 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -87,21 +87,6 @@ static inline void kmem_cache_destroy(struct kmem_cache *cachep) #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#ifndef BUG -#define BUG() do { \ - printf("U-Boot BUG at %s:%d!\n", __FILE__, __LINE__); \ -} while (0) - -#define BUG_ON(condition) do { if (condition) BUG(); } while(0) -#endif /* BUG */ - -#define WARN_ON(condition) ({ \ - int __ret_warn_on = !!(condition); \ - if (unlikely(__ret_warn_on)) \ - printf("WARNING in %s line %d\n", __FILE__, __LINE__); \ - unlikely(__ret_warn_on); \ -}) - #define PAGE_SIZE 4096 /* drivers/char/random.c */ From patchwork Sat Sep 16 05:10:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 112777 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1391091qgf; Fri, 15 Sep 2017 22:13:38 -0700 (PDT) X-Google-Smtp-Source: ADKCNb44n/1mreR5c6f2WapqOZe2jDWSryVW1c7kQORAEUxaC9UOAqA1xIP/o5pmLF0kolUVreT7 X-Received: by 10.80.193.146 with SMTP id m18mr23644311edf.110.1505538818482; Fri, 15 Sep 2017 22:13:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505538818; cv=none; d=google.com; s=arc-20160816; b=bSMr8xUlBN3X9gSbAGh259LeJiQPJGVQE/9j5S4kisfDZt9MvGxmVM9BG74bZ9t4FN +ihibv3i6fxyYRPvwI7kF+bhtGyhfzH9TqegWK+fTEVXa24s7p2rKPbSeVcyA1A9rAKG eRC47c2gAQsxrroXg9ebWghw68s1fgzqBo6A49QtsTXZd6paOdNWTEvljT848PdZ71Pg RxjVUYKNEBOHga8fuhptrFbQkSsJAVPaRydDlmUTvWC9D3gf9+VjJJhjfuwqE5xqX1zN 64cAa4NQ7bcrce5kPbBiQGC9W2n+39zaD+TSWmCUkEjWVkAi+4nSXKJWoU8ZS4Sj/pTh vCnA== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=qgO596d2/3gJKXSuuRiEGSbETX39aLEoCty/zpIi4mU=; b=uN1FODLKgi9eKKNamkuNwmTqh5kFi5jX2bWo5q0faR2Q5K1UHC+vsSduoDOOOgcgQE +QixsywTXJYVTgeHP2gJb+4tfnJCdf3L3FeEKHOSm9oSa29xA+p3Gh9+W+/C4Yhmk4dx gO35wnz3EgNKe29gpHpsgKRnrIxEnmOz9MRzLpjwHzpq4KKvFpBmo65aUaGifExOJaTP mAmdRWbeHNF8aP7GG2f5SLlmA8CfJ6SLvCiSZOZBUQ96rD51qPTA2Uvghfr58n9jWLYL +eZKoxPLDQBJCVChIczAPnqDUz++dnN4h7XOeh1b//6/IDKXTgauj66cdQGWU7Gy6Hfv UC+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=yngVqRMt; 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 b14si2590490edd.163.2017.09.15.22.13.38; Fri, 15 Sep 2017 22:13:38 -0700 (PDT) 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=yngVqRMt; 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 16CF8C21F5B; Sat, 16 Sep 2017 05:12:50 +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 4C9B4C21F77; Sat, 16 Sep 2017 05:11:40 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 38DECC21FD4; Sat, 16 Sep 2017 05:11:32 +0000 (UTC) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by lists.denx.de (Postfix) with ESMTPS id 9DB57C21F92 for ; Sat, 16 Sep 2017 05:11:27 +0000 (UTC) Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-09.nifty.com with ESMTP id v8G5Asos028761; Sat, 16 Sep 2017 14:10:59 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v8G5Asos028761 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1505538660; bh=AYeozuhoNOpQYKSVFS8NvnkYBU+utfvaBBytcrX7L50=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yngVqRMtffU7k6sVY0z/zEnDSUOmTOu+Nd+MxWNl+vhWBDGbnWZhwoYHDJDO30ZHe W/oDH7SllimaIJnVQE3/smjcmEShEMuDEXQS6vnxmaKcER2ZKdbiucwZIaCoFvI8T+ Z2StkWTvWaZytZGbyN4yxNF4XQV7bVFAGZHk7XGboQU9MmIY9hL+pBMFZcR7VG+TK0 OjqgHn/8cH2hCPaW/H98yWi+dG7upFiXpS7SFuOJgW8Csxbh+UFD8M+Qj4Buo38sGt NbZwpA15isIqJPNnwMyB4VBmz8ET7ePsk0hrRPRry64U30Sw2BBNkAKRANfuo+RQKU ZL5tXRK5nWdUQ== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 16 Sep 2017 14:10:46 +0900 Message-Id: <1505538646-19191-9-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> References: <1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH v2 8/8] dm: define dev_*() log functions in DM header 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" Many drivers use dev_err, dev_info, etc. for logging. Currently, we are relying on , but I guess the best home is , taking into account that Linux defines them in . For now, I am keeping the ones in because lots of Linux-originated code uses dev_*() just for the purpose of syncing, but the first argument is not struct udevice, so we need to ignore it. Once this issue is ironed out, it would be possible to prefix log messages with a device name that emitted it, like Linux. Signed-off-by: Masahiro Yamada Reviewed-by: Simon Glass --- Changes in v2: - newly added include/dm/device.h | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/compat.h | 17 ++++++++++++ 2 files changed, 89 insertions(+) diff --git a/include/dm/device.h b/include/dm/device.h index 4866f7c0028b..cce60b7ed3fd 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -18,6 +18,7 @@ #include #include #include +#include struct driver_info; @@ -879,4 +880,75 @@ static inline void devm_kfree(struct udevice *dev, void *ptr) #endif /* ! CONFIG_DEVRES */ +/* + * REVISIT: + * remove the following after resolving conflicts with + */ +#ifdef dev_dbg +#undef dev_dbg +#endif +#ifdef dev_vdbg +#undef dev_vdbg +#endif +#ifdef dev_info +#undef dev_info +#endif +#ifdef dev_err +#undef dev_err +#endif +#ifdef dev_warn +#undef dev_warn +#endif + +/* + * REVISIT: + * print device name like Linux + */ +#define dev_printk(dev, fmt, ...) \ +({ \ + printk(fmt, ##__VA_ARGS__); \ +}) + +#define __dev_printk(level, dev, fmt, ...) \ +({ \ + if (level < CONFIG_LOGLEVEL) \ + dev_printk(dev, fmt, ##__VA_ARGS__); \ +}) + +#define dev_emerge(dev, fmt, ...) \ + __dev_printk(0, dev, fmt, ##__VA_ARGS__) +#define dev_alert(dev, fmt, ...) \ + __dev_printk(1, dev, fmt, ##__VA_ARGS__) +#define dev_crit(dev, fmt, ...) \ + __dev_printk(2, dev, fmt, ##__VA_ARGS__) +#define dev_err(dev, fmt, ...) \ + __dev_printk(3, dev, fmt, ##__VA_ARGS__) +#define dev_warn(dev, fmt, ...) \ + __dev_printk(4, dev, fmt, ##__VA_ARGS__) +#define dev_notice(dev, fmt, ...) \ + __dev_printk(5, dev, fmt, ##__VA_ARGS__) +#define dev_info(dev, fmt, ...) \ + __dev_printk(6, dev, fmt, ##__VA_ARGS__) + +#ifdef DEBUG +#define dev_dbg(dev, fmt, ...) \ + __dev_printk(7, dev, fmt, ##__VA_ARGS__) +#else +#define dev_dbg(dev, fmt, ...) \ +({ \ + if (0) \ + __dev_printk(7, dev, fmt, ##__VA_ARGS__); \ +}) +#endif + +#ifdef VERBOSE_DEBUG +#define dev_vdbg dev_dbg +#else +#define dev_vdbg(dev, fmt, ...) \ +({ \ + if (0) \ + __dev_printk(7, dev, fmt, ##__VA_ARGS__); \ +}) +#endif + #endif diff --git a/include/linux/compat.h b/include/linux/compat.h index 1b3f089687e4..8711fe2b48c4 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -15,6 +15,23 @@ struct p_current{ extern struct p_current *current; +/* avoid conflict with */ +#ifdef dev_dbg +#undef dev_dbg +#endif +#ifdef dev_vdbg +#undef dev_vdbg +#endif +#ifdef dev_info +#undef dev_info +#endif +#ifdef dev_err +#undef dev_err +#endif +#ifdef dev_warn +#undef dev_warn +#endif + #define dev_dbg(dev, fmt, args...) \ debug(fmt, ##args) #define dev_vdbg(dev, fmt, args...) \