From patchwork Sun Oct 10 07:18:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 12548303 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9612CC433EF for ; Sun, 10 Oct 2021 07:20:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 676EE60F46 for ; Sun, 10 Oct 2021 07:20:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 676EE60F46 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=XH9F+FrsBbU6mp/NWQUBl/UpS3JDuQ+wWrHZURzfhIo=; b=J4b+GsTUk2W12I FgsdNWoMSJYxzk9W+Jnml7LitFDUXIq5tIdEwCI9kSlnRZvDWNPKp5OsUFtvwZodGrdF1rai7d/2z wo/NYt+MrGZPckeLODjrvfE9dhBGAT1cfAPTzSFzW/j+hva6mwKkna/JL8TQdKhQi5AKj5ARcWhJy /98fDPJBFg2Z3+kuuhHk86+2QQ7f5kqnksVfuWmihB63ulaEFjlL4Ipn6o6Dla3fBIiTfL/Hnv3qG UDRoSWqYGe46SfMnoTsDd7gEpak2+zbKBV5NlAF3DRsRHpBPGqeqNWn3Ii98oIoSgAXlm3XZWpWkb AE1ilyaqKmOUtTDzB0mw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZT6L-006SmK-OA; Sun, 10 Oct 2021 07:18:29 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZT6I-006Sla-Cq for linux-arm-kernel@lists.infradead.org; Sun, 10 Oct 2021 07:18:27 +0000 Received: by mail-wr1-x435.google.com with SMTP id r18so44447924wrg.6 for ; Sun, 10 Oct 2021 00:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ircsRGiSRRDI5vvTT/PYNTjvV8p5MX9cyk5yss2d11M=; b=mRV1EPIDOcWgi0ZDOfVMxd+VAqx5nw6cxQgaAoXTRBd0FIGA9mnt+5SIYAhejtfZCr pfspAqx9qtIXRQTXHm01Pndlv3O9OXvtwktCVMMaYIouFz6eL902LeYzGz5VBUNig4kZ PFbs58PpaUYjrTZPYaCTuE/G0kQD2aCj6q2xgL/zuNobHASXYY0NiG4hOEUXSW2x2H6H aGhIpWJFfEJ2fhYwA1kGm6e8pEbRpW9NwO6HNKrVkAhzRXUGWmUR0fecsiMcwJG8pVId eeulCiEQquGk3JRwnzcTANMzOk/zwuJnQ69/qDFurk9O31OoWHFAMcUv0yN9W2TSQ/rK wRxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ircsRGiSRRDI5vvTT/PYNTjvV8p5MX9cyk5yss2d11M=; b=qlbImSepNWhuP9F4n3md5zznUX+83EawGiLS68FKZjfLJGsN2ssNQmyReSk308hEJy 7YJ2SHVn8SaOiwE9tbPw/m7+lKoZn2KENzheE1/MK6RRrtX6x82m+43qCaH+L9h5L+1j n2RGEUHLKBQ2GAo094MmSar6UwnEpGuZSnQCyMTt32uESsfifF6XYJtTBS2oTDzLJCWf R2RVx31V5h65EOnX+DhPGcaAJZRnRIxFrGrpTFTfVK3sWkkGnB5zpSB1r5GejFdEKYRt Ttau7gOhKi9uGsHNAWKvZEpK6SeSz3jVvi+m9km7qomyCGL0RazUmwQuP5SQPnqDwrFe 8Ysw== X-Gm-Message-State: AOAM530HoM/EW1o5PwetJBe3pITi6NUmrP7HJHWWoWufWmZPucJYn1qy fGPuXVOSrSi4+sp68oOFt/U= X-Google-Smtp-Source: ABdhPJweOswcCJDMYDuEl0xsle+Ew2RuPx8ZRdW1YZ8M6RpUDbLmdzUmpEsY2CiRm/5fQXWfxpHHPw== X-Received: by 2002:a05:6000:1042:: with SMTP id c2mr9783493wrx.272.1633850301699; Sun, 10 Oct 2021 00:18:21 -0700 (PDT) Received: from kista.localdomain (cpe-86-58-29-253.static.triera.net. [86.58.29.253]) by smtp.gmail.com with ESMTPSA id m4sm17473305wml.28.2021.10.10.00.18.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Oct 2021 00:18:21 -0700 (PDT) From: Jernej Skrabec To: mripard@kernel.org, wens@csie.org Cc: linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Jernej Skrabec Subject: [PATCH] bus: sun50i-de2: Adjust printing error message Date: Sun, 10 Oct 2021 09:18:12 +0200 Message-Id: <20211010071812.145178-1-jernej.skrabec@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211010_001826_481399_A14EAF8A X-CRM114-Status: GOOD ( 11.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org SRAM driver often returns -EPROBE_DEFER and thus this bus driver often prints error message, even if it probes successfully later. This is confusing for users and they often think that something is wrong. Use dev_err_probe() helper for printing error message. It handles -EPROBE_DEFER automatically. Signed-off-by: Jernej Skrabec Reviewed-by: Andre Przywara --- drivers/bus/sun50i-de2.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/bus/sun50i-de2.c b/drivers/bus/sun50i-de2.c index 672518741f86..414f29cdedf0 100644 --- a/drivers/bus/sun50i-de2.c +++ b/drivers/bus/sun50i-de2.c @@ -15,10 +15,9 @@ static int sun50i_de2_bus_probe(struct platform_device *pdev) int ret; ret = sunxi_sram_claim(&pdev->dev); - if (ret) { - dev_err(&pdev->dev, "Error couldn't map SRAM to device\n"); - return ret; - } + if (ret) + return dev_err_probe(&pdev->dev, ret, + "Couldn't map SRAM to device\n"); of_platform_populate(np, NULL, NULL, &pdev->dev);