From patchwork Fri Jul 10 15:30:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 11656875 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 046F413B6 for ; Fri, 10 Jul 2020 15:32:20 +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 D019B2065D for ; Fri, 10 Jul 2020 15:32:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VEM3msG8"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="UbVqW0Z+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D019B2065D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.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:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To: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:List-Owner; bh=AYxE18rNGP+HENsxmLcINBn8WrFwLk3oYS2SMA3gXWA=; b=VEM3msG8A74HLVnclyFl/DeQdF 6dG4bwb9b73YPyZ9hVQfgI9zT4yVAUmG8OdTU6wNP5erbllgOUhDzaHJTX7r2/82+orRMA8vKPD9b vdqGVGPXn00cs0CqQ0/PLd7TuLltcZPiyw0HUtY/7vef5azv09/zgrFF4mscANkM6L1prZTwvq83I Pj367zLeukGECbSxMUMFix4wn6gVQDnwrCfb3zp5kXrbiFTKiLdn7cNc6n5DWc1Sa/le5JdrEMNyB jVn3MD8sqyUKGQPpW2uXSAT1DfJHUTpTOVg6TMDH1VB63vIbty0TKH/Ffv1GlBGt/LFdmaNIBO9UE QPSFM35A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtuz8-00011Q-LX; Fri, 10 Jul 2020 15:30:46 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jtuyp-0000uw-As for linux-arm-kernel@lists.infradead.org; Fri, 10 Jul 2020 15:30:28 +0000 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200710153026euoutp02a384ff7532547b3da213ad61792f374b~gbdRD_nwz1342513425euoutp02Z for ; Fri, 10 Jul 2020 15:30:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200710153026euoutp02a384ff7532547b3da213ad61792f374b~gbdRD_nwz1342513425euoutp02Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594395026; bh=ldZknbF9TPUSQxdpO3ouuzcL7PaF+JDqisngEE3mM30=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UbVqW0Z+DfvX7F4yzUW7F+pfK1zS7ZvvTBXGktbYbi0yDkqWqL8m69UwY0lcDzRxe Q689JeWOYkn9qjiQ+kEi2h9VVRha9G8F3NEl+Do8viPDQZ5Pj77v8ryK2xXQ4+qQPa R7nEmXoz+B3a3/qGAL2GJBwCV5gnjipsDW5E+iWc= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200710153026eucas1p2c477ee612f0115d6510dba2551bd36f0~gbdQumKX_2486024860eucas1p2Z; Fri, 10 Jul 2020 15:30:26 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 3F.16.06318.299880F5; Fri, 10 Jul 2020 16:30:26 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200710153025eucas1p141ae47938b5f41c835759e7345f0e625~gbdQLBvef2844728447eucas1p1l; Fri, 10 Jul 2020 15:30:25 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200710153025eusmtrp18c1927a42a089179b4e68f175bda4aa4~gbdQFKxpk2243522435eusmtrp1t; Fri, 10 Jul 2020 15:30:25 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-d4-5f0889920cc0 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id EE.38.06017.199880F5; Fri, 10 Jul 2020 16:30:25 +0100 (BST) Received: from AMDC3748.digital.local (unknown [106.120.51.74]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200710153024eusmtip15e7120f4c2f4cb71eb78a470c482f9c8~gbdPUZxoN1261412614eusmtip1X; Fri, 10 Jul 2020 15:30:24 +0000 (GMT) From: Andrzej Hajda To: Greg Kroah-Hartman Subject: [PATCH v8 3/5] drm/bridge/sii8620: fix resource acquisition error handling Date: Fri, 10 Jul 2020 17:30:16 +0200 Message-Id: <20200710153018.12226-4-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200710153018.12226-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSa0hTYRjm2zk75zhcHae4D5XEhZBW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sVy+t/xu7oTOzniDeY0SlncWneO1eLlhMOM FhtnrGe1mPrwCZvF/20TmS2ufH3PZtG8eD2bxdXvL5ktTr65ymLROXEJu8Wmx9dYLS7vmsNm cWjqXkaLtUfuslsc6ou2mPtlKrODgMflaxeZPd7faGX32PttAYvHzll32T1md8xk9di0qpPN 48SES0we++euYfe4332cyWPzknqPvi2rGD0O9E5m8fi8SS6AN0rPpii/tCRVISO/uMRWKdrQ wkjP0NJCz8jEUs/Q2DzWyshUSd/OJiU1J7MstUjfLkEvY9WxY0wFi/krZm08ztTAeIKni5GT Q0LARKJr5yXGLkYuDiGBpYwS836fYIFIiEvsnv+WGcIWlvhzrYsNougTo8SWz0fAEmwCmhJ/ N99kA7FFBIwl+s/OYgcpYhZoY5WYe/4JO0hCWCBY4v6CnUwgNouAqsT+zfPBmnkFLCQWLTnM BrFBXmL1hgNgcU4BS4l3U7vB4kJANbeXfWedwMi3gJFhFaNIamlxbnpusZFecWJucWleul5y fu4mRmB0bTv2c8sOxq53wYcYBTgYlXh4FyRyxAuxJpYVV+YeYpTgYFYS4XU6ezpOiDclsbIq tSg/vqg0J7X4EKMp0FETmaVEk/OBkZ9XEm9oamhuYWlobmxubGahJM7bIXAwRkggPbEkNTs1 tSC1CKaPiYNTqoHRWcN6m7q5/sKt5SbqZyXWs7/qC1GzuHB69YQao7OeYQy/Y4usjrt9udi5 YIdicGHSIne/GYL/OMpjrl64LKB9+bwv53p7Uxf/XzwG+9p3H1Wfb8n8YP0py3X3wzjZ1Ffv XL/s1jLDpd/WVnnZ3/FZ4cby9qd7yO6MlhPubK3tRzV2817+fG61EktxRqKhFnNRcSIAIDy9 T8QCAAA= X-CMS-MailID: 20200710153025eucas1p141ae47938b5f41c835759e7345f0e625 X-Msg-Generator: CA X-RootMTR: 20200710153025eucas1p141ae47938b5f41c835759e7345f0e625 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200710153025eucas1p141ae47938b5f41c835759e7345f0e625 References: <20200710153018.12226-1-a.hajda@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200710_113027_481050_CC32FF3D X-CRM114-Status: GOOD ( 15.37 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [210.118.77.12 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [210.118.77.12 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender 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: Jernej Skrabec , "Rafael J. Wysocki" , Jonas Karlman , Bartlomiej Zolnierkiewicz , linux-kernel@vger.kernel.org, "open list:DRM DRIVERS" , Russell King - ARM Linux , Neil Armstrong , Andrzej Hajda , andy.shevchenko@gmail.com, Mark Brown , Laurent Pinchart , Daniel Vetter , linux-arm-kernel@lists.infradead.org, Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In case of error during resource acquisition driver should print error message only in case it is not deferred probe, using dev_err_probe helper solves the issue. Moreover it records defer probe reason for debugging. Signed-off-by: Andrzej Hajda Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/sil-sii8620.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c index 92acd336aa89..389c1f029774 100644 --- a/drivers/gpu/drm/bridge/sil-sii8620.c +++ b/drivers/gpu/drm/bridge/sil-sii8620.c @@ -2299,10 +2299,9 @@ static int sii8620_probe(struct i2c_client *client, INIT_LIST_HEAD(&ctx->mt_queue); ctx->clk_xtal = devm_clk_get(dev, "xtal"); - if (IS_ERR(ctx->clk_xtal)) { - dev_err(dev, "failed to get xtal clock from DT\n"); - return PTR_ERR(ctx->clk_xtal); - } + if (IS_ERR(ctx->clk_xtal)) + return dev_err_probe(dev, PTR_ERR(ctx->clk_xtal), + "failed to get xtal clock from DT\n"); if (!client->irq) { dev_err(dev, "no irq provided\n"); @@ -2313,16 +2312,14 @@ static int sii8620_probe(struct i2c_client *client, sii8620_irq_thread, IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "sii8620", ctx); - if (ret < 0) { - dev_err(dev, "failed to install IRQ handler\n"); - return ret; - } + if (ret < 0) + return dev_err_probe(dev, ret, + "failed to install IRQ handler\n"); ctx->gpio_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); - if (IS_ERR(ctx->gpio_reset)) { - dev_err(dev, "failed to get reset gpio from DT\n"); - return PTR_ERR(ctx->gpio_reset); - } + if (IS_ERR(ctx->gpio_reset)) + return dev_err_probe(dev, PTR_ERR(ctx->gpio_reset), + "failed to get reset gpio from DT\n"); ctx->supplies[0].supply = "cvcc10"; ctx->supplies[1].supply = "iovcc18";