Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7136131rwp; Tue, 18 Jul 2023 10:31:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlE36nJmOzSFjYE/DN5tkaUiFd0FDF80c0+YphemNuZQnv26rxmw0NTD8C9UhtrUOGJbOfV4 X-Received: by 2002:a17:907:7e9e:b0:992:74e0:6f76 with SMTP id qb30-20020a1709077e9e00b0099274e06f76mr832001ejc.4.1689701498003; Tue, 18 Jul 2023 10:31:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689701497; cv=none; d=google.com; s=arc-20160816; b=XYinYaZE9CCUf6wGbvK+VzEiInWK+CVEirxKBzdMcoVI0RgFFSgSid4Bw0qlgPfvAl 40y/qbv7MQFAQJC0HpljvTB6h+9D6BtREJXW3e//RjTQ2zR6IsvSZ7n+WMB0m2jEV0rF kNnSmm/f2Dk4gUn5F03J01vaFo+Nh2wGxG8pw36KNdHMZhJ2+nfYGEPGRmUxQQan6hTF //JvfmnmJVVqPs3UJ0S+N63Dv/pdz9/ED6Vg6iIDbya+o1coTb1ogQLVFi4vpEhI94FS BDqgtGfQQme7LJYL5rpHoBkl/4nH9ndqcKonT2Rmkg4zHCEwz2IRZ1nqnfjWWKI2K1HK ByVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=W5WkYdW5Gvy0HcFU9SzQRl7yqyslRGaS9rUSiP+g7Q8=; fh=Ople2ijcDVdvBJwvAg2RvyZp0qNZK7It46SN0LxlrVk=; b=EwHDAEq/IkLig0XS/Gr3Ke1XFdrkIL6cag4gJNHRkzVPNo7dTnFl2WouyXrmVBsKEh uizQJRAPdaJIR/mH6OXhvVsz3T/aMYdgbKJRU1xVNxZxrPl0JJ0Ki0TZmg9cO7+Utgaz WoLK9M99iLIOA/2t19VgLATfEXP3GiglO/d0LyKbxKyKQQS1zMX2XHyFbSUNApFIdTl8 bkjEKymfOo533TpcHpC/NLERHkDSf40DRmJuZCQ5tlPqLCMiLfsNrpxO6KKn6LkC+euP yiEPDHqtJeTwAMQQDHen2zlEOpVo/6jXGP4ONl112bP7eLFQHYOC4gl2jZyWBoTeDdQA HkCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m20-20020a1709066d1400b0098862882ee9si1498151ejr.308.2023.07.18.10.31.13; Tue, 18 Jul 2023 10:31:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233575AbjGRQzq (ORCPT + 99 others); Tue, 18 Jul 2023 12:55:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232544AbjGRQzA (ORCPT ); Tue, 18 Jul 2023 12:55:00 -0400 Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01F591711 for ; Tue, 18 Jul 2023 09:54:54 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:5803:2d6d:5bbc:e252]) by laurent.telenet-ops.be with bizsmtp id Ngur2A0070ucMBo01gurj7; Tue, 18 Jul 2023 18:54:53 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qLnyD-001nYU-Aw; Tue, 18 Jul 2023 18:54:51 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qLnyN-000gcO-C2; Tue, 18 Jul 2023 18:54:51 +0200 From: Geert Uytterhoeven To: Laurent Pinchart , Kieran Bingham , David Airlie , Daniel Vetter , Thomas Zimmermann , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Laurent Pinchart Subject: [PATCH v2 16/41] drm: renesas: shmobile: Improve error handling Date: Tue, 18 Jul 2023 18:54:21 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Prepare for DT conversion, where panel probe can be deferred, by streamlining error propagation and handling: - Use dev_err_probe() to avoid printing error messages in case of probe deferral, - Propagate errors where needed. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart --- v2: - Add Reviewed-by. --- drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c | 3 ++- drivers/gpu/drm/renesas/shmobile/shmob_drm_kms.c | 14 +++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c index 782767fc66d00c4f..91daab80b0ede058 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c @@ -255,7 +255,8 @@ static int shmob_drm_probe(struct platform_device *pdev) ret = shmob_drm_modeset_init(sdev); if (ret < 0) { - dev_err(&pdev->dev, "failed to initialize mode setting\n"); + dev_err_probe(&pdev->dev, ret, + "failed to initialize mode setting\n"); goto err_free_drm_dev; } diff --git a/drivers/gpu/drm/renesas/shmobile/shmob_drm_kms.c b/drivers/gpu/drm/renesas/shmobile/shmob_drm_kms.c index 3051318ddc7999bc..1a62e7f8a8a9e6df 100644 --- a/drivers/gpu/drm/renesas/shmobile/shmob_drm_kms.c +++ b/drivers/gpu/drm/renesas/shmobile/shmob_drm_kms.c @@ -157,9 +157,17 @@ int shmob_drm_modeset_init(struct shmob_drm_device *sdev) if (ret) return ret; - shmob_drm_crtc_create(sdev); - shmob_drm_encoder_create(sdev); - shmob_drm_connector_create(sdev, &sdev->encoder); + ret = shmob_drm_crtc_create(sdev); + if (ret < 0) + return ret; + + ret = shmob_drm_encoder_create(sdev); + if (ret < 0) + return ret; + + ret = shmob_drm_connector_create(sdev, &sdev->encoder); + if (ret < 0) + return ret; drm_kms_helper_poll_init(sdev->ddev); -- 2.34.1