From patchwork Mon Dec 14 09:16:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 343874 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=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable 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 58527C4361B for ; Mon, 14 Dec 2020 09:21:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2211F20771 for ; Mon, 14 Dec 2020 09:21:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730746AbgLNJU7 (ORCPT ); Mon, 14 Dec 2020 04:20:59 -0500 Received: from ns2.baikalchip.com ([94.125.187.42]:46536 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2439807AbgLNJSh (ORCPT ); Mon, 14 Dec 2020 04:18:37 -0500 From: Serge Semin To: Rob Herring , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Johan Hovold , Maxime Ripard , Joao Pinto , Lars Persson , Maxime Coquelin CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Vyacheslav Mitrofanov , , , , , , Anson Huang Subject: [PATCH 19/25] net: stmmac: dwc-qos: Use dev_err_probe() for probe errors handling Date: Mon, 14 Dec 2020 12:16:09 +0300 Message-ID: <20201214091616.13545-20-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20201214091616.13545-1-Sergey.Semin@baikalelectronics.ru> References: <20201214091616.13545-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There is a very handy dev_err_probe() method to handle the deferred probe error number. It reduces the code size, uniforms error handling, records the defer probe reason, etc. Use it to print the probe callback error message. Signed-off-by: Serge Semin Cc: Anson Huang --- drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c index 31ca299a1cfd..57f957898b60 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c @@ -473,11 +473,8 @@ static int dwc_eth_dwmac_probe(struct platform_device *pdev) priv = data->probe(pdev, plat_dat, &stmmac_res); if (IS_ERR(priv)) { ret = PTR_ERR(priv); - - if (ret != -EPROBE_DEFER) - dev_err(&pdev->dev, "failed to probe subdriver: %d\n", - ret); - + dev_err_probe(&pdev->dev, ret, "failed to probe subdriver: %d\n", + ret); goto remove_config; }