Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp662353rdb; Sat, 19 Aug 2023 19:11:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGCGun+hQpt/kq7S0pxbPdIrlLg5tcM/bXP9EdE7Zzmbg1xb7ldwmOO1UnWnqGPWfvwuZ7A X-Received: by 2002:a6b:c90d:0:b0:790:f2c3:2fd with SMTP id z13-20020a6bc90d000000b00790f2c302fdmr4935733iof.0.1692497517278; Sat, 19 Aug 2023 19:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692497517; cv=none; d=google.com; s=arc-20160816; b=E+77t7Q3imgjs5+nBlO8l6sLZdZ1VOg4IOoRayC7BUEuNzxtlJD6q2nAutPoVMk9oJ RAbOwrHznuc7KianSxlwip8agErsfLAEEGn5QH2sZhhj3DuDob4uQHATJA1tpcqiR7Ol dxtzrQtYxSMsWHFjzx66dR6tU1hOB+ONYlXuS/eXk1dyZBcM6wlIQbxLs3JTEeZSLXwv oddSMr/pDcNJaDYRZWCgdCu594t2Q2JmfZKwg0IbUF1UPhzuz+4ZqeAN1QhwIuG9YRr0 QxeC5Yz/MVuX4CxfmEnpN5gEySh0WRenhAWHxesMGTYBlMiy0/gruhutGyNgX4uD/8HO /W+A== 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=rvx6M5VwWC20phFxhYAEM5TYqR1HcPaNaKzQkcZHGrA=; fh=OmmZDJEp3pl7jaFV8O2/yN66VkuJIFqajAiD2ZUHFno=; b=gI5I2/m2OOx8Sm7UqhR1Npkwpl+fm8C9AGiFhlCcMk97qBksKjJ+V4awoRsgXp2Cps YSoBXp+jJsca/zqeb2JXmAyaf8vY7NjreO7XRmFnwSji3QtDjHMyzhIKD4Btbmwfd7qv Q7bVIn4t1IKwLw4IEhci7wHay864QRGjet8qJRUbx4fnvgqZvGsN1HTIOYtmyiMB0eKD FoF1yQaQfVNLJkb/x5+i3K8QmF3JZ1vvACVETs9u6ylGews/NqfI8OHCmxJvalwIVn7/ Lb82Ot3nzT6bZu8jot/eQ704NH5cYy+EwU0WTp+rdTx2+D6vEXpulUOCV92lJad4EdDi d96A== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id ie9-20020a17090b400900b0026b56ee767esi6001198pjb.106.2023.08.19.19.11.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 19:11:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C3981214043; Sat, 19 Aug 2023 11:30:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244243AbjHPKpz (ORCPT + 99 others); Wed, 16 Aug 2023 06:45:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244041AbjHPKpM (ORCPT ); Wed, 16 Aug 2023 06:45:12 -0400 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D797273D for ; Wed, 16 Aug 2023 03:44:51 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:5d0c:f209:12a7:4ce5]) by michel.telenet-ops.be with bizsmtp id aAkh2A00m45ualL06Akh1t; Wed, 16 Aug 2023 12:44:42 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qWE0x-000osR-09; Wed, 16 Aug 2023 12:44:41 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qWDAw-00675N-MC; Wed, 16 Aug 2023 11:50:50 +0200 From: Geert Uytterhoeven To: Laurent Pinchart , Kieran Bingham , David Airlie , Daniel Vetter , Thomas Zimmermann , Magnus Damm Cc: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Laurent Pinchart Subject: [PATCH v3 16/41] drm: renesas: shmobile: Improve error handling Date: Wed, 16 Aug 2023 11:50:23 +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=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_NONE autolearn=no 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 --- v3: - No changes, 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