From patchwork Mon Jul 13 14:43:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 11659979 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 60FD5138C for ; Mon, 13 Jul 2020 14:45:26 +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 37F9E20738 for ; Mon, 13 Jul 2020 14:45:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Yo06PoeZ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="UvmIywVy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37F9E20738 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=Yo06PoeZEPPtB6I/+U5UV59asV pSA0Y+d+yYLQ9BaUR8Ay5ORXx/1Ecze54UcQG7GaJrwRS0hnT6wdJwbQicMxqTQZV4lAOEeQ107iB krj2HuirQ+5zGshzm14x/oWr9lKQqlQP5winvkZRCG0LwircqcWjZ/DEa/CmQ7j0BeR11YVyopEXi 9TLuVsepq1D4ouAoqTphxiyC+VM6ksURypBERUMlOOx8XXtt8gv//fqwbFdDWZsovkKdnArCy8WYZ CZaJmDrmzi9idrYEVHyvm1/zz0twZQ+beGRM88pB+nIwwD3T1RXK4G0TX55jEGphdyTne86dJ1cKi pGQv+8yw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1juzgM-0005E9-Dj; Mon, 13 Jul 2020 14:43:51 +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 1juzg7-00058U-66 for linux-arm-kernel@lists.infradead.org; Mon, 13 Jul 2020 14:43:37 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200713144333euoutp0173183a427238e0dd16d91b92172f7a30~hVwMYOJmF3242832428euoutp01i for ; Mon, 13 Jul 2020 14:43:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200713144333euoutp0173183a427238e0dd16d91b92172f7a30~hVwMYOJmF3242832428euoutp01i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594651413; bh=ldZknbF9TPUSQxdpO3ouuzcL7PaF+JDqisngEE3mM30=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UvmIywVy7PH0VtWUpGVHrrsKV0jPUT2V7MtpgEDbsSwYg/m4EzvQtWNmUx1/7z20U A3rCcHoacTOJWZJhMzU5YZEVcAnwrDK+/GEXKfRoP6IKdu0gsdD/+XuHK/GCaLfgSd 8iscvrxs39vD0uNs12ExMvq1jgcFMhcCQKcwPRps= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200713144333eucas1p2554697096c3ff0d9fa576d0bf15c4fb6~hVwMAqfWU0720407204eucas1p2v; Mon, 13 Jul 2020 14:43:33 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 1D.E5.06456.5137C0F5; Mon, 13 Jul 2020 15:43:33 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200713144333eucas1p127c600faa8a7416d89f0d84681c73ab9~hVwLrh6O21041510415eucas1p1x; Mon, 13 Jul 2020 14:43:33 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200713144333eusmtrp1ebd47862f33d49c25a5e985aa2fd0160~hVwLqzCMj0993509935eusmtrp1Z; Mon, 13 Jul 2020 14:43:33 +0000 (GMT) X-AuditID: cbfec7f2-809ff70000001938-b7-5f0c7315974e Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 45.5A.06017.4137C0F5; Mon, 13 Jul 2020 15:43:32 +0100 (BST) Received: from AMDC3748.digital.local (unknown [106.120.51.74]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200713144332eusmtip17eed23fae87263527c6711746e549ad4~hVwK82OmS2060420604eusmtip1I; Mon, 13 Jul 2020 14:43:32 +0000 (GMT) From: Andrzej Hajda To: Greg Kroah-Hartman Subject: [PATCH v9 3/4] drm/bridge/sii8620: fix resource acquisition error handling Date: Mon, 13 Jul 2020 16:43:23 +0200 Message-Id: <20200713144324.23654-4-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200713144324.23654-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSaUhUURjtzlsdnLxNll+2SANRRml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7qixTzxBn94LW6tO8dq8XLCYUaL jTPWs1pMffiEzeL/tonMFle+vmezaF68ns3i6veXzBYn31xlseicuITdYtPja6wWl3fNYbM4 NHUvo8XaI3fZLQ71RVvM/TKV2UHA4/K1i8we72+0snvs/baAxWPnrLvsHrM7ZrJ6bFrVyeZx YsIlJo/9c9ewe9zvPs7ksXlJvUffllWMHgd6J7N4fN4kF8AbpWdTlF9akqqQkV9cYqsUbWhh pGdoaaFnZGKpZ2hsHmtlZKqkb2eTkpqTWZZapG+XoJex6tgxpoLF/BWzNh5namA8wdPFyMkh IWAi0XF9FVMXIxeHkMBSRonp95+wQyTEJXbPf8sMYQtL/LnWxQZR9IlRYvGXhSwgCTYBTYm/ m2+ygdgiAsYS/WdnsYMUMQu0sUrMPQ8xSVggWGLXkgZGEJtFQFXi/eVdYFN5BSwk3lz9zwKx QV5i9YYDQHEODk4BS4n5feEgphBQyYm3nhMY+RYwMqxiFEktLc5Nzy020itOzC0uzUvXS87P 3cQIjKttx35u2cHY9S74EKMAB6MSD6+EP0+8EGtiWXFl7iFGCQ5mJRFep7On44R4UxIrq1KL 8uOLSnNSiw8xmgKdNJFZSjQ5HxjzeSXxhqaG5haWhubG5sZmFkrivB0CB2OEBNITS1KzU1ML Uotg+pg4OKUaGNeUqyzks5wz6/3K+z2WfZ1Vl7okLtjlOgcxzbZwShF40OF72+OJU+G1ugWy Mzst27793ij1aGWUZaBLIQtH+Qw5Vq34e5O/1vgwyv283eoy0fXd7g7+0GMrohnm/C3eP3fa 0kDp9DNW/EU7599blSmguFpss4T+3Nr3LZUNkn7vPLdZnxA/rsRSnJFoqMVcVJwIAJkG1LzB AgAA X-CMS-MailID: 20200713144333eucas1p127c600faa8a7416d89f0d84681c73ab9 X-Msg-Generator: CA X-RootMTR: 20200713144333eucas1p127c600faa8a7416d89f0d84681c73ab9 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200713144333eucas1p127c600faa8a7416d89f0d84681c73ab9 References: <20200713144324.23654-1-a.hajda@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200713_104335_347540_9D30F286 X-CRM114-Status: GOOD ( 15.34 ) 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_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.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.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";