Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1567755pxx; Fri, 30 Oct 2020 13:09:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhwjL1y7dD6b93SgOf7HCusT9nZ1RTkvU8LxNXu0Pwye50DoPRVSYWzqlv/tamVwuPJEoF X-Received: by 2002:a05:6402:1482:: with SMTP id e2mr4471864edv.36.1604088581776; Fri, 30 Oct 2020 13:09:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604088581; cv=none; d=google.com; s=arc-20160816; b=TxZZw9h4+ZN/Qw0Wqq02uPxeFXwvFvgUNrkYT4X2CPC5AfmuZmF8hPBwtzS27sIULy bIZ2zVZkC7yycYoJ08qfRnBiH9DAuN7LjZofbIGNp6eG0DxVsSoFGBRgwPMMaRjfslC2 vPkndqsk1HZaAUlmeK3IyOWlO50k5nuejNe7uxQnroXkVnkQn7ylIi2tl4kSDXYod7gq oTSys5xgG3raQzKjhEkUxOl6EVrQ10/HFocix2c/9vNKAXFxrdzzrtgH8Fbk3eeUEpEu cqB7hAlLlPD+SUncfmHGD0ljaKMZ0UinuSSbjQJWIBMdPChCI8pYXAi+k/p7FED65Wyp 7imw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=NmGweRIDX1yhKI72wcflgzMMwyqgecQXkJJNNwnR1iI=; b=G162/2KTg35T2X6Pfhmk57TSdbxkPphoSIWZRYqYNISfTcwvDq46t8lzcznFa5xWAh yZSh9vkKbdDT5s6Yhmdli+iZTZIgyeegjO5qv4KI90nEiFlL8Cbvpgls7cKkt/Cz1w/t 3Z9QNFCfTsTsZVe0ujkU+InOpXqgKuJplMVY5VcPCIvecrW54pIgqF/x8BY9oAPSF18m /4W6MRX7PQ5tOJ+N1xWwkK6FO8baRAJflQFNUFX8rfIIQ6asonOl+x93hm9yKFV7roOw C/7FbNuCkn6wf6aUNXIeJKN2IpFmiR9tfo+X0NavwmKOKBhjSTwxRX8v7FQRp+J+Aun/ ucgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=GndEjExQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si5482373edv.415.2020.10.30.13.09.18; Fri, 30 Oct 2020 13:09:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=GndEjExQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727849AbgJ3UHp (ORCPT + 99 others); Fri, 30 Oct 2020 16:07:45 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:37842 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727218AbgJ3UHm (ORCPT ); Fri, 30 Oct 2020 16:07:42 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 09UK7bel104296; Fri, 30 Oct 2020 15:07:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1604088457; bh=NmGweRIDX1yhKI72wcflgzMMwyqgecQXkJJNNwnR1iI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=GndEjExQ+C9cnER0da4nyjxUa+0uAgFKwNEM7EPhncxs2VRAIWH5qG8g78Jy/nJb4 lLzYrmn31azVTkEGq2J5tQ7aq3jDzBFCSR0gcKPIcXLmUE7wulAYQdSgb87dKWAglT 6bmsxh0gkMk9lgKQLjes/G7Vd3UL0CHuh8iVOhFM= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 09UK7bgR055640 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 30 Oct 2020 15:07:37 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Fri, 30 Oct 2020 15:07:37 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Fri, 30 Oct 2020 15:07:37 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 09UK7aSC009507; Fri, 30 Oct 2020 15:07:36 -0500 From: Grygorii Strashko To: "David S. Miller" , , Jakub Kicinski , Vignesh Raghavendra CC: Sekhar Nori , , , "Reviewed-by : Jesse Brandeburg" , Grygorii Strashko Subject: [PATCH net-next v3 10/10] net: ethernet: ti: am65-cpsw: handle deferred probe with dev_err_probe() Date: Fri, 30 Oct 2020 22:07:07 +0200 Message-ID: <20201030200707.24294-11-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201030200707.24294-1-grygorii.strashko@ti.com> References: <20201030200707.24294-1-grygorii.strashko@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use new dev_err_probe() API to handle deferred probe properly and simplify the code. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 28 +++++++++--------------- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index feb94b813ffc..766e8866bbef 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -1561,9 +1561,8 @@ static int am65_cpsw_nuss_init_tx_chns(struct am65_cpsw_common *common) tx_chn->tx_chn_name, &tx_cfg); if (IS_ERR(tx_chn->tx_chn)) { - ret = PTR_ERR(tx_chn->tx_chn); - dev_err(dev, "Failed to request tx dma channel %d\n", - ret); + ret = dev_err_probe(dev, PTR_ERR(tx_chn->tx_chn), + "Failed to request tx dma channel\n"); goto err; } @@ -1634,8 +1633,8 @@ static int am65_cpsw_nuss_init_rx_chns(struct am65_cpsw_common *common) rx_chn->rx_chn = k3_udma_glue_request_rx_chn(dev, "rx", &rx_cfg); if (IS_ERR(rx_chn->rx_chn)) { - ret = PTR_ERR(rx_chn->rx_chn); - dev_err(dev, "Failed to request rx dma channel %d\n", ret); + ret = dev_err_probe(dev, PTR_ERR(rx_chn->rx_chn), + "Failed to request rx dma channel\n"); goto err; } @@ -1850,12 +1849,10 @@ static int am65_cpsw_nuss_init_slave_ports(struct am65_cpsw_common *common) /* get phy/link info */ if (of_phy_is_fixed_link(port_np)) { ret = of_phy_register_fixed_link(port_np); - if (ret) { - if (ret != -EPROBE_DEFER) - dev_err(dev, "%pOF failed to register fixed-link phy: %d\n", - port_np, ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, + "failed to register fixed-link phy %pOF\n", + port_np); port->slave.phy_node = of_node_get(port_np); } else { port->slave.phy_node = @@ -2180,13 +2177,8 @@ static int am65_cpsw_nuss_probe(struct platform_device *pdev) return -ENOMEM; clk = devm_clk_get(dev, "fck"); - if (IS_ERR(clk)) { - ret = PTR_ERR(clk); - - if (ret != -EPROBE_DEFER) - dev_err(dev, "error getting fck clock %d\n", ret); - return ret; - } + if (IS_ERR(clk)) + return dev_err_probe(dev, PTR_ERR(clk), "getting fck clock\n"); common->bus_freq = clk_get_rate(clk); pm_runtime_enable(dev); -- 2.17.1