From patchwork Mon May 3 17:21:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12236579 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.7 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 96E58C433ED for ; Mon, 3 May 2021 17:21:23 +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 4484D61026 for ; Mon, 3 May 2021 17:21:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4484D61026 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 822436E3F2; Mon, 3 May 2021 17:21:22 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id E60556E3F2 for ; Mon, 3 May 2021 17:21:20 +0000 (UTC) IronPort-SDR: miHZzAlM1qjGIqmOq+1CIfiVSP6WmsROINgMdO4Qp02pdXCiLXYxGTBqYOgQh/D9IwQwxjUtSw conDzy2HeeKg== X-IronPort-AV: E=McAfee;i="6200,9189,9973"; a="197407597" X-IronPort-AV: E=Sophos;i="5.82,270,1613462400"; d="scan'208";a="197407597" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2021 10:21:04 -0700 IronPort-SDR: 4TW0XYFU36o+hSO+aboCTFHM1Y3mAJNUgA2efHqh7aEzlfQBZS0KgEbDUhArKzt5KEaSk/mFuP tllYKeWpfBog== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,270,1613462400"; d="scan'208";a="468145196" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 03 May 2021 10:21:00 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id D30112A7; Mon, 3 May 2021 20:21:19 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Phil Reid , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v4 2/5] staging: fbtft: Don't spam logs when probe is deferred Date: Mon, 3 May 2021 20:21:11 +0300 Message-Id: <20210503172114.27891-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210503172114.27891-1-andriy.shevchenko@linux.intel.com> References: <20210503172114.27891-1-andriy.shevchenko@linux.intel.com> 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: Greg Kroah-Hartman , Nishad Kamdar Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" When requesting GPIO line the probe can be deferred. In such case don't spam logs with an error message. This can be achieved by switching to dev_err_probe(). Fixes: c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor interface") Cc: Nishad Kamdar Signed-off-by: Andy Shevchenko --- drivers/staging/fbtft/fbtft-core.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index 67c3b1975a4d..3723269890d5 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -75,20 +75,16 @@ static int fbtft_request_one_gpio(struct fbtft_par *par, struct gpio_desc **gpiop) { struct device *dev = par->info->device; - int ret = 0; *gpiop = devm_gpiod_get_index_optional(dev, name, index, GPIOD_OUT_LOW); - if (IS_ERR(*gpiop)) { - ret = PTR_ERR(*gpiop); - dev_err(dev, - "Failed to request %s GPIO: %d\n", name, ret); - return ret; - } + if (IS_ERR(*gpiop)) + return dev_err_probe(dev, PTR_ERR(*gpiop), "Failed to request %s GPIO\n", name); + fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' GPIO\n", __func__, name); - return ret; + return 0; } static int fbtft_request_gpios(struct fbtft_par *par)