From patchwork Mon Jun 29 11:22:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 11630753 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 EA333739 for ; Mon, 29 Jun 2020 11:24:48 +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 C26A023A51 for ; Mon, 29 Jun 2020 11:24:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bwAEy1ie"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="CvYNjDi7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C26A023A51 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=bwAEy1ieTi62mQnEP6Vp4S9p/e +VmVs2cXxcOL+JHtLSuZzTVVa6MHBLW/orkDW10YFyz1BYZ70o0DAUjg9P5JrISTDIy296WxOExPD w94rm8s7w5BKD/s4pP+1A/KX8j30JTKzxOvKfJFsem/NT8pxbQqga/Kl4zhnmjShR5wjbyqnUyF2m erGQRQs8FOK/nBf54Eby+llmE+ncmbFIihriRVBdqZEf9OoA+/0ccN8AZ9ruUIsy0hBx3fq+QwznP kIc42FK46Rz50Vr70voS9TVjxI/Ta5V2+M3hFfUTTvJ6pd0xVdllKBj949IcuRnEoMqIquGMs/sex CdCHWaJg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jprsS-0007Sp-5Y; Mon, 29 Jun 2020 11:23:08 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jprsB-0007NJ-HV for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2020 11:22:54 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200629112250euoutp01e07f6fe4ae20aa4d7ec2125d7cd70831~c-_8kJhoD2846828468euoutp01M for ; Mon, 29 Jun 2020 11:22:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200629112250euoutp01e07f6fe4ae20aa4d7ec2125d7cd70831~c-_8kJhoD2846828468euoutp01M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1593429770; bh=ldZknbF9TPUSQxdpO3ouuzcL7PaF+JDqisngEE3mM30=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CvYNjDi7vD5kVixtnoYzJ5QHtkc5b0JLF38t3tzPF5vMfbZ+XPjnc2pNFcgqmO3yN F9qwv2bSLt0xS8tfzQjD38ikhJxnqBoCOHjlSe4c9Pmj1XfaLE1161KFR1d6SQgctp qvdXaHDv6pUkxrjwiDyFMSp9XCn/KBd9paM9tIdg= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200629112250eucas1p207dd9dd07c8d2b62bce2b9d6ec01e958~c-_8MJKeT2471224712eucas1p2X; Mon, 29 Jun 2020 11:22:50 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id AF.A7.06456.A0FC9FE5; Mon, 29 Jun 2020 12:22:50 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200629112249eucas1p12fc95f88729c12c78b1a5bfe32afad8f~c-_7wyhDZ0555905559eucas1p1Q; Mon, 29 Jun 2020 11:22:49 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200629112249eusmtrp24df70e7112ccbe125aeb79667a9e74b2~c-_7wDt6k1939019390eusmtrp2f; Mon, 29 Jun 2020 11:22:49 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-c7-5ef9cf0aab3b Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 4E.0F.06314.90FC9FE5; Mon, 29 Jun 2020 12:22:49 +0100 (BST) Received: from AMDC3748.digital.local (unknown [106.120.51.74]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200629112249eusmtip169921d0a84a53bece075ad7bc3dcd372~c-_69HRf-2279622796eusmtip1I; Mon, 29 Jun 2020 11:22:48 +0000 (GMT) From: Andrzej Hajda To: Greg Kroah-Hartman Subject: [PATCH v7 3/4] drm/bridge/sii8620: fix resource acquisition error handling Date: Mon, 29 Jun 2020 13:22:41 +0200 Message-Id: <20200629112242.18380-4-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200629112242.18380-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0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y+t/xu7qc53/GGSzYqGdxa905VouXEw4z WmycsZ7VYurDJ2wW/7dNZLa48vU9m0Xz4vVsFle/v2S2OPnmKotF58Ql7BabHl9jtbi8aw6b xaGpexkt1h65y25xqC/aYu6XqcwOAh6Xr11k9nh/o5XdY++3BSweO2fdZfeY3TGT1WPTqk42 jxMTLjF57J+7ht3jfvdxJo/NS+o9+rasYvQ40DuZxePzJrkA3ig9m6L80pJUhYz84hJbpWhD CyM9Q0sLPSMTSz1DY/NYKyNTJX07m5TUnMyy1CJ9uwS9jFXHjjEVLOavmLXxOFMD4wmeLkZO DgkBE4mNN34xdTFycQgJLGWU+LqohRUiIS6xe/5bZghbWOLPtS42iKJPjBIr181nAUmwCWhK /N18kw3EFhEwlug/O4sdpIhZoI1VYu75J+wgCWGBYInrC+eATWIRUJXYfG0SWAOvgIXEsY5T bBAb5CVWbzgAVsMpYClx+cJMRhBbCKjmwtFO9gmMfAsYGVYxiqSWFuem5xYb6hUn5haX5qXr JefnbmIERte2Yz8372C8tDH4EKMAB6MSD2/CuZ9xQqyJZcWVuYcYJTiYlUR4nc6ejhPiTUms rEotyo8vKs1JLT7EaAp01ERmKdHkfGDk55XEG5oamltYGpobmxubWSiJ83YIHIwREkhPLEnN Tk0tSC2C6WPi4JRqYAy04etaYaPrdlN87dtPq5qOhnF5MDNVvpsrve1H54Pfgb//y5YUZ9qU VfFIurEoul78MOdx8B+jONdTfFVGsuUfdlkvWTO56fibquy9ny1KtxzT3uLIFXvkTo6k1Nvw STc3nmiLOnexx7vn9re+81uMM34+PFNR3dDzqO5lr3eZ+9W1VQ2hgUosxRmJhlrMRcWJAPqX CKDEAgAA X-CMS-MailID: 20200629112249eucas1p12fc95f88729c12c78b1a5bfe32afad8f X-Msg-Generator: CA X-RootMTR: 20200629112249eucas1p12fc95f88729c12c78b1a5bfe32afad8f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200629112249eucas1p12fc95f88729c12c78b1a5bfe32afad8f References: <20200629112242.18380-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.11 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [210.118.77.11 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_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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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";