From patchwork Wed Jun 24 11:41:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 11622991 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 F115114B7 for ; Wed, 24 Jun 2020 11:43:43 +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 CAB0520706 for ; Wed, 24 Jun 2020 11:43:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3lJcrA9b"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Gz061wWw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CAB0520706 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=HRNBLm0uj2rRXHm/y5Q8nH1Hi9fY7Ocq4LOxHrt9rMg=; b=3lJcrA9bZeiinrCPUde/kxMtSn J6iXXlD6qiuedLeuAJLO09g8EER/e/DjEwyIgdxsvRNufw4et1JLHEaUtRRw9yZ52boP4/RFoUL6V QQ2qRos/ixKGc458j5WE6F4Km2ybF5Y2/0sL8nW3KGDgKepryoLAz8c3LC6x7qL+6c9+Dmo9EB7HZ lTDLVbPCZiZcfskFKsY7eVqbAahXPGPRqwzaLxrY5JkoP5o2HP6SLyLgaerKhTNLq+8/BdcayL45A 4sZaRLQY11Gq6Iogxbtde09PsvB3AG4GrM+NjO8T2SxUZLKZg74Z3XFqMGlZncPhrt1DDWAvT+rCy 3mobbKKg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo3mw-0006bv-5A; Wed, 24 Jun 2020 11:41:58 +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 1jo3md-0006S3-NR for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 11:41:42 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200624114138euoutp02f5dd2238d5c036eb9c03e7c99d1b6fca~beA7YLh8J1734317343euoutp02S for ; Wed, 24 Jun 2020 11:41:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200624114138euoutp02f5dd2238d5c036eb9c03e7c99d1b6fca~beA7YLh8J1734317343euoutp02S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1592998898; bh=PLcfbVbE8i4C8d+Nje5jm1KODRXZ6RkpBF4pFp7dgN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gz061wWwnckgFshr7IHV/S56brednP/fCQN2DoCvt+lOLedpHvoWuBZeA3A9KsT3g YoA4EdOZ3Kab191G9YTSBCBfdMshslJW5od/RbI36r4UDd0Iz6ivjUmvsvNkR8UjIB sBtr/mLupNn0hGQfZWMj8+FCaH4cd42c3YYFkHGU= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200624114137eucas1p23e078ad0759d9748c9282f41addeff25~beA7CGXw43078130781eucas1p2-; Wed, 24 Jun 2020 11:41:37 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 08.5A.06318.1FB33FE5; Wed, 24 Jun 2020 12:41:37 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200624114137eucas1p13599d33a0c4a9abf7708bf8c8e77264b~beA6t-j1g1213312133eucas1p1o; Wed, 24 Jun 2020 11:41:37 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200624114137eusmtrp10d73154fb2485ece760b250727d8f1fe~beA6tUGSX0702007020eusmtrp1Q; Wed, 24 Jun 2020 11:41:37 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-3c-5ef33bf187fe Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 74.74.06314.1FB33FE5; Wed, 24 Jun 2020 12:41:37 +0100 (BST) Received: from AMDC3748.digital.local (unknown [106.120.51.74]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200624114136eusmtip2e30c14611d99889046fee0d88d874173~beA6ExH1q1775617756eusmtip2L; Wed, 24 Jun 2020 11:41:36 +0000 (GMT) From: Andrzej Hajda To: Greg Kroah-Hartman Subject: [RESEND PATCH v5 4/5] drm/bridge/sii8620: fix resource acquisition error handling Date: Wed, 24 Jun 2020 13:41:26 +0200 Message-Id: <20200624114127.3016-5-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200624114127.3016-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSWUxTQRiFM70r1e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WpSXmKPExsVy+t/xe7ofrT/HGdx4rmpxa905VouXEw4z WmycsZ7VYurDJ2wW/7dNZLa48vU9m0Xz4vVsFle/v2S2OPnmKotF58Ql7BabHl9jtbi8aw6b xaGpexkt1h65y25xqC/aYu6XqcwOAh6Xr11k9nh/o5XdY++3BSweO2fdZfeY3TGT1WPTqk42 jxMTLjF57J+7ht3jfvdxJo/NS+o9+rasYvQ40DuZxePzJrkA3ig9m6L80pJUhYz84hJbpWhD CyM9Q0sLPSMTSz1DY/NYKyNTJX07m5TUnMyy1CJ9uwS9jKOXX7IVLOOrOPd6D3sD4zvuLkZO DgkBE4k9t5pYuhi5OIQEljJK7Lp7mxUiIS6xe/5bZghbWOLPtS42iKJPjBLz2reCJdgENCX+ br7JBmKLCBhL9J+dxQ5SxCzQxiox9/wTdpCEsECUxPU5D8GmsgioShx+8gcozsHBK2Au8fd8 FMQCeYnVGw6AzeQUsJCY1HKREcQWAio5dH0x6wRGvgWMDKsYRVJLi3PTc4sN9YoTc4tL89L1 kvNzNzECY2vbsZ+bdzBe2hh8iFGAg1GJh3fDg49xQqyJZcWVuYcYJTiYlUR4nc6ejhPiTUms rEotyo8vKs1JLT7EaAp000RmKdHkfGDc55XEG5oamltYGpobmxubWSiJ83YIHIwREkhPLEnN Tk0tSC2C6WPi4JRqYEzZe8Q4eu8nrqd1WpEmE1N8z54Wa39usfpn6/nT6wW/V7K5dzj/NErb Knlu5ZRPh9q72suuf7Jzmz3D/7hy5eOdDScOXfHbVJjYt91ku3Hi9lsrp35OsWH/NK1LwfeN 23a7LzlMUbFRSVzHj0yS2zbviVSAeOf5KY45rTv3Sf/Z57zIsumZ0QElluKMREMt5qLiRAAc CbrgwwIAAA== X-CMS-MailID: 20200624114137eucas1p13599d33a0c4a9abf7708bf8c8e77264b X-Msg-Generator: CA X-RootMTR: 20200624114137eucas1p13599d33a0c4a9abf7708bf8c8e77264b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200624114137eucas1p13599d33a0c4a9abf7708bf8c8e77264b References: <20200624114127.3016-1-a.hajda@samsung.com> X-Spam-Note: CRM114 invocation failed 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_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 probe_err helper solves the issue. Moreover it records defer probe reason for debugging. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/bridge/sil-sii8620.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c index 92acd336aa89..2f825b2d0098 100644 --- a/drivers/gpu/drm/bridge/sil-sii8620.c +++ b/drivers/gpu/drm/bridge/sil-sii8620.c @@ -2299,10 +2299,8 @@ 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 probe_err(dev, ctx->clk_xtal, "failed to get xtal clock from DT\n"); if (!client->irq) { dev_err(dev, "no irq provided\n"); @@ -2313,16 +2311,12 @@ 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 probe_err(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 probe_err(dev, ctx->gpio_reset, "failed to get reset gpio from DT\n"); ctx->supplies[0].supply = "cvcc10"; ctx->supplies[1].supply = "iovcc18";