From patchwork Wed Apr 21 16:31:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12216503 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DECC2C433B4 for ; Wed, 21 Apr 2021 16:32:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 80E7B6140F for ; Wed, 21 Apr 2021 16:32:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80E7B6140F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A07B26E9D2; Wed, 21 Apr 2021 16:31:59 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id F2C606E9BD for ; Wed, 21 Apr 2021 16:31:56 +0000 (UTC) IronPort-SDR: Zd78nyeFt7sdRixKwRpAtoCBcqkOezhLD8RChjC2/oXRG2usieY4x0gr07ccHYJ6g3Ai+JOSfa pkeDFnR4Kugw== X-IronPort-AV: E=McAfee;i="6200,9189,9961"; a="195755661" X-IronPort-AV: E=Sophos;i="5.82,240,1613462400"; d="scan'208";a="195755661" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2021 09:31:54 -0700 IronPort-SDR: egJVzti0po9XsNmWI6Ek9lQZfrx+P59DVCjFK8P3PktHZQFjGBvqZbki3SoWSOAlG+GXxyUhlJ aJC/kvrmCObg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,240,1613462400"; d="scan'208";a="423606001" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 21 Apr 2021 09:31:52 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id B353516A; Wed, 21 Apr 2021 19:32:09 +0300 (EEST) From: Andy Shevchenko To: Sam Ravnborg , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 1/7] drm/st7735r: Avoid spamming logs if probe is deferred Date: Wed, 21 Apr 2021 19:31:51 +0300 Message-Id: <20210421163157.50949-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andy Shevchenko , David Lechner , David Airlie , Kamlesh Gurudasani Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The GPIO request can fail and probe may be deferred. Thus, the error message may be printed again and again. Avoid this by replacing DRM_DEV_ERROR() by dev_err_probe(). Signed-off-by: Andy Shevchenko --- drivers/gpu/drm/tiny/st7735r.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/tiny/st7735r.c b/drivers/gpu/drm/tiny/st7735r.c index faaba0a033ea..e3cbaa846e2b 100644 --- a/drivers/gpu/drm/tiny/st7735r.c +++ b/drivers/gpu/drm/tiny/st7735r.c @@ -207,16 +207,12 @@ static int st7735r_probe(struct spi_device *spi) drm = &dbidev->drm; dbi->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); - if (IS_ERR(dbi->reset)) { - DRM_DEV_ERROR(dev, "Failed to get gpio 'reset'\n"); - return PTR_ERR(dbi->reset); - } + if (IS_ERR(dbi->reset)) + return dev_err_probe(dev, PTR_ERR(dbi->reset), "Failed to get GPIO 'reset'\n"); dc = devm_gpiod_get(dev, "dc", GPIOD_OUT_LOW); - if (IS_ERR(dc)) { - DRM_DEV_ERROR(dev, "Failed to get gpio 'dc'\n"); - return PTR_ERR(dc); - } + if (IS_ERR(dc)) + return dev_err_probe(dev, PTR_ERR(dc), "Failed to get GPIO 'dc'\n"); dbidev->backlight = devm_of_find_backlight(dev); if (IS_ERR(dbidev->backlight))