From patchwork Thu Feb 4 12:42:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 12067267 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 40187C433DB for ; Thu, 4 Feb 2021 12:44:14 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EAC8964F53 for ; Thu, 4 Feb 2021 12:44:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAC8964F53 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=IvVc0t/7v8Nbrj0tW/ZzaD1VZjoVpCnCskeA5eQDF4s=; b=2XQ227VHLktLN1jeZMjiRnMRw6 HKJQ4fq9o9YmOPjoLhyLIZtcatzku6Xcq63cAX2P6FDqV9B652HY7nwTjoe6nT+OGGGBL5VOSW5bY kynU7Lbk1rjk817yxZd/jzJpYJXVXp82mvIdzhvMtySF22DRQpWVswJAL03+MYMWb0KVb9w+YL5OA BeuiHL0i5YiVlwKa/1SE2SeTr9jYRRy1SoRS1LmC7+brwDC0R/bQKZMYv92pUrg9b08Wd1W1tjwQi TxkvtQUq04QCp3jb9phLCJVXOvgtxl4Wyy8HWcqf2YqnClA94S5JFxc6AKyBdubx817U8qj/yMN2T zNp9CZkA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7dyM-0001Rj-6d; Thu, 04 Feb 2021 12:42:58 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7dyJ-0001RO-1b for linux-arm-kernel@lists.infradead.org; Thu, 04 Feb 2021 12:42:56 +0000 Received: by mail-wr1-x42e.google.com with SMTP id b3so3333007wrj.5 for ; Thu, 04 Feb 2021 04:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Sf0cEHgoBjUUrSmCunlnTaOhu9gA+20DyV3BPL25Fks=; b=CL6P0Yz49baJM/ZPXSPCSKTQ0dQoM9DUs/ZLFFBLST1y3bly48kVvNhc1Vodu6yVuN dokdIZYyDV1Zlx2rTlzw7kbDt7ewU5+NZfN82391SzjhSh+Ko+2nql0fQKYS0H9oPV88 bUBJuGgDU2AOMVKQcXAwmDk+q8NcMRdOXZFXW5YJ3hrolxcm6BtrH9WX3ikrxCku0lPp W7csdecqx3qZjQBDv7sJauhIhhWBsGTYUzY/xxh7Bon5GlvWsBUsJe3L4aUsZMu6Vh24 I1XEOePCh7jfdb/tgimGwrl4CTVus+bnDIGWZ/ROozjC0YS5hYff2AlKhVrqOhxopbwr L+QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=Sf0cEHgoBjUUrSmCunlnTaOhu9gA+20DyV3BPL25Fks=; b=j18YUSXA244pQA5XlFavT8wv/0Dy2nOhBswwZ6ASNvCNFv+cMlSiuGKHRCSdsLW+v5 xz18xwzvRia6+0el6XCAkM8Dpk7eki0Nm/AYuiyNQd8nZm2nQ+j5Fo4rdLr3ShH49Iv4 kRRheXZ/+sk06NZAvJsGHRN66qbJ3p6J1yTyiI13xUy8BipzFkl1kw6Do1SjcZ5+DDkM gRNXM0YCqybyvMcMbaAV15pKjD66yF1TNjUWEF8JpnRqYomhuql9v/7usoU3OMTSQoT9 vhCQFSEvhIEqgUWoWzZMhSIF9O/HrIwotdYhPq3JofnZ+kxLL6uxvSWLZL+YhlGLMLHD EWZg== X-Gm-Message-State: AOAM5329ibtgrhdswX9KBr79r1JWdnHCLJZC6zcUNkPadIMwmeVnk79O nuP4SO+wXWOrdm7V/XP0FK9EEEji+LoA/R2N X-Google-Smtp-Source: ABdhPJwWFBGTfCzIYxIPWUtexWvAA0VI/2/svkzdxTyaMfgZnW0iMb8TFf7+LLz9Xunn4f+HSOji/g== X-Received: by 2002:a5d:6510:: with SMTP id x16mr8884764wru.175.1612442572651; Thu, 04 Feb 2021 04:42:52 -0800 (PST) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id r25sm8546181wrr.64.2021.02.04.04.42.51 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Feb 2021 04:42:52 -0800 (PST) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, git@xilinx.com Subject: [PATCH] can: xilinx_can: Simplify code by using dev_err_probe() Date: Thu, 4 Feb 2021 13:42:48 +0100 Message-Id: <91af0945ed7397b08f1af0c829450620bd92b804.1612442564.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210204_074255_238307_C30AF77C X-CRM114-Status: GOOD ( 12.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Naga Sureshkumar Relli , netdev@vger.kernel.org, linux-can@vger.kernel.org, Marc Kleine-Budde , linux-arm-kernel@lists.infradead.org, Appana Durga Kedareswara rao , Jakub Kicinski , "David S. Miller" , Wolfgang Grandegger Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use already prepared dev_err_probe() introduced by commit a787e5400a1c ("driver core: add device probe log helper"). It simplifies EPROBE_DEFER handling. Also unify message format for similar error cases. Signed-off-by: Michal Simek --- drivers/net/can/xilinx_can.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c index 37fa19c62d73..3b883e607d8b 100644 --- a/drivers/net/can/xilinx_can.c +++ b/drivers/net/can/xilinx_can.c @@ -1772,17 +1772,15 @@ static int xcan_probe(struct platform_device *pdev) /* Getting the CAN can_clk info */ priv->can_clk = devm_clk_get(&pdev->dev, "can_clk"); if (IS_ERR(priv->can_clk)) { - if (PTR_ERR(priv->can_clk) != -EPROBE_DEFER) - dev_err(&pdev->dev, "Device clock not found.\n"); - ret = PTR_ERR(priv->can_clk); + ret = dev_err_probe(&pdev->dev, PTR_ERR(priv->can_clk), + "device clock not found\n"); goto err_free; } priv->bus_clk = devm_clk_get(&pdev->dev, devtype->bus_clk_name); if (IS_ERR(priv->bus_clk)) { - if (PTR_ERR(priv->bus_clk) != -EPROBE_DEFER) - dev_err(&pdev->dev, "bus clock not found\n"); - ret = PTR_ERR(priv->bus_clk); + ret = dev_err_probe(&pdev->dev, PTR_ERR(priv->bus_clk), + "bus clock not found\n"); goto err_free; }