From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63D95C433B4 for ; Fri, 21 May 2021 13:21:48 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B377613DA for ; Fri, 21 May 2021 13:21:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B377613DA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 66D7582E52; Fri, 21 May 2021 15:21:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id E8B3382E4C; Fri, 21 May 2021 15:21:42 +0200 (CEST) Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.70.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D231B82E40 for ; Fri, 21 May 2021 15:21:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=kever.yang@rock-chips.com Received: from localhost (unknown [192.168.167.16]) by regular1.263xmail.com (Postfix) with ESMTP id AAFAC3A4 for ; Fri, 21 May 2021 21:21:33 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-SKE-CHECKED: 1 X-ABS-CHECKED: 1 Received: from [172.16.12.120] (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P32529T140357235508992S1621603293694411_; Fri, 21 May 2021 21:21:34 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <530e1d915c141b07d07454f8d526ddfb> X-RL-SENDER: kever.yang@rock-chips.com X-SENDER: yk@rock-chips.com X-LOGIN-NAME: kever.yang@rock-chips.com X-FST-TO: bmeng.cn@gmail.com X-RCPT-COUNT: 4 X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 Subject: Re: [PATCH 1/3] pci: pcie_dw_rockchip: Fixed the below compilation error To: Anand Moon , u-boot@lists.denx.de Cc: Neil Armstrong , Bin Meng References: <20210426132632.10221-1-linux.amoon@gmail.com> From: Kever Yang Message-ID: Date: Fri, 21 May 2021 21:21:32 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210426132632.10221-1-linux.amoon@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean On 2021/4/26 下午9:26, Anand Moon wrote: > Use the Error values that may be returned by PCI functions > Added the error macro from linux/include/linux/pci.h > > drivers/pci/pcie_dw_rockchip.c: In function 'rk_pcie_read': > drivers/pci/pcie_dw_rockchip.c:70:10: error: 'PCIBIOS_UNSUPPORTED' > undeclared (first use in this function) > 70 | return PCIBIOS_UNSUPPORTED; > | ^~~~~~~~~~~~~~~~~~~ > drivers/pci/pcie_dw_rockchip.c: In function 'rk_pcie_write': > drivers/pci/pcie_dw_rockchip.c:90:10: error: 'PCIBIOS_UNSUPPORTED' > undeclared (first use in this function) > 90 | return PCIBIOS_UNSUPPORTED; > | ^~~~~~~~~~~~~~~~~~~ > > Cc: Neil Armstrong > Cc: Kever Yang > Signed-off-by: Anand Moon Reviewed-by: Kever Yang Thanks, - Kever > --- > drivers/pci/pcie_dw_common.h | 9 +++++++++ > drivers/pci/pcie_dw_rockchip.c | 4 ++-- > 2 files changed, 11 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/pcie_dw_common.h b/drivers/pci/pcie_dw_common.h > index 6b701645af..ba5feb5b51 100644 > --- a/drivers/pci/pcie_dw_common.h > +++ b/drivers/pci/pcie_dw_common.h > @@ -90,6 +90,15 @@ > #define PCIE_MISC_CONTROL_1_OFF 0x8bc > #define PCIE_DBI_RO_WR_EN BIT(0) > > +/* Error values that may be returned by PCI functions */ > +#define PCIBIOS_SUCCESSFUL 0x00 > +#define PCIBIOS_FUNC_NOT_SUPPORTED 0x81 > +#define PCIBIOS_BAD_VENDOR_ID 0x83 > +#define PCIBIOS_DEVICE_NOT_FOUND 0x86 > +#define PCIBIOS_BAD_REGISTER_NUMBER 0x87 > +#define PCIBIOS_SET_FAILED 0x88 > +#define PCIBIOS_BUFFER_TOO_SMALL 0x89 > + > /* Parameters for the waiting for iATU enabled routine */ > #define LINK_WAIT_MAX_IATU_RETRIES 5 > #define LINK_WAIT_IATU 10000 > diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c > index bc22af4230..9702b40019 100644 > --- a/drivers/pci/pcie_dw_rockchip.c > +++ b/drivers/pci/pcie_dw_rockchip.c > @@ -67,7 +67,7 @@ static int rk_pcie_read(void __iomem *addr, int size, u32 *val) > { > if ((uintptr_t)addr & (size - 1)) { > *val = 0; > - return PCIBIOS_UNSUPPORTED; > + return PCIBIOS_BAD_REGISTER_NUMBER; > } > > if (size == 4) { > @@ -87,7 +87,7 @@ static int rk_pcie_read(void __iomem *addr, int size, u32 *val) > static int rk_pcie_write(void __iomem *addr, int size, u32 val) > { > if ((uintptr_t)addr & (size - 1)) > - return PCIBIOS_UNSUPPORTED; > + return PCIBIOS_BAD_REGISTER_NUMBER; > > if (size == 4) > writel(val, addr);