From patchwork Thu May 11 19:08:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13238396 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A20EC7EE2A for ; Thu, 11 May 2023 19:09:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239061AbjEKTJb (ORCPT ); Thu, 11 May 2023 15:09:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238452AbjEKTJY (ORCPT ); Thu, 11 May 2023 15:09:24 -0400 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 276F96A7A; Thu, 11 May 2023 12:09:21 -0700 (PDT) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id 28B27E0EBE; Thu, 11 May 2023 22:09:20 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=xGDsTPT86T4LuRJWjhR70wGw0i95sKl3YEXw9Ee0IO4=; b=ODoQRPlPuXyM o1meTISnVUbUucMLG3kaePS1JvuWUe+CqB7jmHkIkRrzNQIF5Vt8yaoxP9kXvvEp D3hSw85fKmsvaCiSZ4QtbikTB5kUpeL5P0zjtW69NiXdO8m/PRn4aSdTUKF9gGy7 LwkubmrLS4cc4xk3j/VgoirgPzh1KQQ= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id 12B7CE0EB1; Thu, 11 May 2023 22:09:20 +0300 (MSK) Received: from localhost (10.8.30.6) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 11 May 2023 22:09:19 +0300 From: Serge Semin To: Bjorn Helgaas , Lorenzo Pieralisi , Cai Huoqing , Jingoo Han , Gustavo Pimentel , Vinod Koul , Manivannan Sadhasivam , Yoshihiro Shimoda , Rob Herring , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , , , Subject: [PATCH RESEND v5 04/14] PCI: bt1: Fix printing false error message Date: Thu, 11 May 2023 22:08:52 +0300 Message-ID: <20230511190902.28896-5-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230511190902.28896-1-Sergey.Semin@baikalelectronics.ru> References: <20230511190902.28896-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 X-Originating-IP: [10.8.30.6] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The dev_err_probe() method is supposed to be invoked only if any error is happened. It was definitely wrong to call it unconditionally. Due to that the DWC PCIe host initialization error-message is printed all the time the Baikal-T1 PCIe controller is probed even if no error actually happened. Fixes: ba6ed462dcf4 ("PCI: dwc: Add Baikal-T1 PCIe controller support") Signed-off-by: Serge Semin Reviewed-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pcie-bt1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-bt1.c b/drivers/pci/controller/dwc/pcie-bt1.c index e36a20bf82cf..6557141873ad 100644 --- a/drivers/pci/controller/dwc/pcie-bt1.c +++ b/drivers/pci/controller/dwc/pcie-bt1.c @@ -597,8 +597,10 @@ static int bt1_pcie_add_port(struct bt1_pcie *btpci) dw_pcie_cap_set(&btpci->dw, REQ_RES); ret = dw_pcie_host_init(&btpci->dw.pp); + if (ret) + dev_err_probe(dev, ret, "Failed to initialize DWC PCIe host\n"); - return dev_err_probe(dev, ret, "Failed to initialize DWC PCIe host\n"); + return ret; } static void bt1_pcie_del_port(struct bt1_pcie *btpci)