From patchwork Tue Sep 1 15:27:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 293092 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.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 46471C433E6 for ; Tue, 1 Sep 2020 16:38:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0ECE020767 for ; Tue, 1 Sep 2020 16:38:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598978325; bh=/XJaGl06CsjTQv2yh1KyHC+7ktek0ZuAsx836iRegvw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fvcMKZgw6AzQeF0qzn+rKdhCq5Q31/CgprHvLXnJYxqa9WfDiduM16KVA2dOhNcug wz69cYNC3QlKJHvaxSNXGMB9K20r/Gf7iLI0zAAZjIhIbm5bo7GHoxmC7RPkyHO48x z44LwBMyRKY3GSPKy4ync7FhN7KhD4ectXfVI0Ho= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730471AbgIAQig (ORCPT ); Tue, 1 Sep 2020 12:38:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:57276 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730401AbgIAP2p (ORCPT ); Tue, 1 Sep 2020 11:28:45 -0400 Received: from kozik-lap.mshome.net (unknown [194.230.155.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 16CD620FC3; Tue, 1 Sep 2020 15:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974125; bh=/XJaGl06CsjTQv2yh1KyHC+7ktek0ZuAsx836iRegvw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n2mdRPDrNq2pVxukr4c3iPl+YkyyHJaWmRW5Jvz8KNAR0gjpv3Svn6cs3odcRB3wg aRgXXOz0vV5ybQhyPw+p1EPa2Mq2mUsHfU3DKmGbzsjwiSC4oNC4xZ4tUsD30dQyNo IIgfBbfOVuEEqmw46QROFHdgplBU7IGDhhHrHy7I= From: Krzysztof Kozlowski To: Tudor Ambarus , Mark Brown , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Nicolas Saenz Julienne , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Andy Gross , Bjorn Andersson , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , Masahisa Kojima , Jassi Brar , Laxman Dewangan , Thierry Reding , Jonathan Hunter , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 11/11] spi: tegra20: Simplify with dev_err_probe() Date: Tue, 1 Sep 2020 17:27:13 +0200 Message-Id: <20200901152713.18629-11-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200901152713.18629-1-krzk@kernel.org> References: <20200901152713.18629-1-krzk@kernel.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski --- drivers/spi/spi-tegra20-slink.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c index a07b72e9c344..a0810765d4e5 100644 --- a/drivers/spi/spi-tegra20-slink.c +++ b/drivers/spi/spi-tegra20-slink.c @@ -600,13 +600,9 @@ static int tegra_slink_init_dma_param(struct tegra_slink_data *tspi, struct dma_slave_config dma_sconfig; dma_chan = dma_request_chan(tspi->dev, dma_to_memory ? "rx" : "tx"); - if (IS_ERR(dma_chan)) { - ret = PTR_ERR(dma_chan); - if (ret != -EPROBE_DEFER) - dev_err(tspi->dev, - "Dma channel is not available: %d\n", ret); - return ret; - } + if (IS_ERR(dma_chan)) + return dev_err_probe(tspi->dev, PTR_ERR(dma_chan), + "Dma channel is not available\n"); dma_buf = dma_alloc_coherent(tspi->dev, tspi->dma_buf_size, &dma_phys, GFP_KERNEL);