Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2223651pxb; Fri, 17 Sep 2021 05:15:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu2iV4XamyVZu28HX9AcCnRaRO+X1+1zuHgX50wOU2PPW4SFzHUOz6A2GMsZpOX1mbH8O3 X-Received: by 2002:a02:2402:: with SMTP id f2mr8472383jaa.28.1631880943634; Fri, 17 Sep 2021 05:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631880943; cv=none; d=google.com; s=arc-20160816; b=VcpzRUmXe/8BBCAVhfZOJaO9Rbv+5udjop9l4wVg995FCQjlavknFAjX6BpAgKf0Ap kZem3ERSEjDaTlA+fYDXjihy/0BlgwwdA+2LOnvvyvYka6QUMAAeDYGzOep4EIWZQmVE 5pzmwWDX5MEomM8aTRUG1YvGdvO0PK9+7Hv3ilqTtkHuldeHoD9J1yiEG3y6lTUPnAU6 flpaTrA5DHJQ7anbTAiMYLK7WX4Kwng80DA9LvBoDJ9e1zG3Vn7mSrR8kmvVQJBMgsPI ztzMJLOyT6TEBRmvKvgYjPshSEB7dH3BPBuZUEiy7dS/aEhM46UYwken51CUeNbsByeA AFmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=+4FygvWKgHGW9h7AGT75/LQqCSNPrOEzugXegq97hrc=; b=IRSZkhB6C8jyRp0b3jGRiI8iFjD6cuw0rRYtcVt72BUhozkuIwUgJIMdpTyQ5TE3gd umUoQy+ga3Ij2fw5H+clzI3GiERROP9D9kne4H9sl3cc/c3RVCFEgGbQdyDK+2NoCKqs RaODKaFiAQYIwSTmXZgN8fRWtH2bL5BCoi1eA1NwlHuzzDf18uNuRwoQ9dWXRYPoyJkI 168iwE3z7fqCtZ61HaIAhU0Q5LNZyf3Ax8HweRR+1XUwa9hkgZiFJw9SC57lriiG0e9q 2r3YXvvkX1lQy895iWcOReGXCJL9/G5SljWBTqtIiXj4MxtibYCaqJnweQ4mkg2d51xb IDFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si5586157ion.66.2021.09.17.05.15.29; Fri, 17 Sep 2021 05:15:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244489AbhIQEYP (ORCPT + 99 others); Fri, 17 Sep 2021 00:24:15 -0400 Received: from mx22.baidu.com ([220.181.50.185]:52850 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S244382AbhIQEXw (ORCPT ); Fri, 17 Sep 2021 00:23:52 -0400 Received: from BC-Mail-EX04.internal.baidu.com (unknown [172.31.51.44]) by Forcepoint Email with ESMTPS id 68C8343F6DF5E86072FD; Fri, 17 Sep 2021 12:22:28 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-EX04.internal.baidu.com (172.31.51.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Fri, 17 Sep 2021 12:22:28 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Fri, 17 Sep 2021 12:22:27 +0800 From: Cai Huoqing To: CC: Jingoo Han , , , Subject: [PATCH 4/6] fbdev: ssd1307fb: Make use of the helper function dev_err_probe() Date: Fri, 17 Sep 2021 12:22:10 +0800 Message-ID: <20210917042213.17689-4-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210917042213.17689-1-caihuoqing@baidu.com> References: <20210917042213.17689-1-caihuoqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BJHW-Mail-Ex05.internal.baidu.com (10.127.64.15) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: Cai Huoqing --- drivers/video/fbdev/ssd1307fb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index 1e2f71c2f8a8..c6d5df31111d 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -658,9 +658,8 @@ static int ssd1307fb_probe(struct i2c_client *client) par->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(par->reset)) { - dev_err(dev, "failed to get reset gpio: %ld\n", - PTR_ERR(par->reset)); - ret = PTR_ERR(par->reset); + ret = dev_err_probe(dev, PTR_ERR(par->reset), + "failed to get reset gpio\n"); goto fb_alloc_error; } @@ -670,7 +669,7 @@ static int ssd1307fb_probe(struct i2c_client *client) if (ret == -ENODEV) { par->vbat_reg = NULL; } else { - dev_err(dev, "failed to get VBAT regulator: %d\n", ret); + dev_err_probe(dev, ret, "failed to get VBAT regulator\n"); goto fb_alloc_error; } } -- 2.25.1