From patchwork Wed Mar 22 08:40:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye.xingchen@zte.com.cn X-Patchwork-Id: 665975 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0F96C6FD1C for ; Wed, 22 Mar 2023 08:41:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229966AbjCVIlO (ORCPT ); Wed, 22 Mar 2023 04:41:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229911AbjCVIlN (ORCPT ); Wed, 22 Mar 2023 04:41:13 -0400 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 667FE3BC48; Wed, 22 Mar 2023 01:41:12 -0700 (PDT) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4PhMPy6zKdz6FK2Z; Wed, 22 Mar 2023 16:41:10 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.99.176]) by mse-fl2.zte.com.cn with SMTP id 32M8ervp023285; Wed, 22 Mar 2023 16:40:53 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp02[null]) by mapi (Zmail) with MAPI id mid31; Wed, 22 Mar 2023 16:40:55 +0800 (CST) Date: Wed, 22 Mar 2023 16:40:55 +0800 (CST) X-Zmail-TransId: 2afa641abf175e5-cc285 X-Mailer: Zmail v1.0 Message-ID: <202303221640559786295@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , Subject: =?utf-8?b?W1BBVENIXSBpMmM6IGdwaW86IFVzZSBkZXZfZXJyX3Byb2JlKCk=?= X-MAIL: mse-fl2.zte.com.cn 32M8ervp023285 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 641ABF26.000/4PhMPy6zKdz6FK2Z Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Ye Xingchen Replace the open-code with dev_err_probe() to simplify the code. Signed-off-by: Ye Xingchen --- drivers/i2c/busses/i2c-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c index 1794c0399f22..a83f241d7b62 100644 --- a/drivers/i2c/busses/i2c-gpio.c +++ b/drivers/i2c/busses/i2c-gpio.c @@ -355,8 +355,8 @@ static struct gpio_desc *i2c_gpio_get_desc(struct device *dev, if (ret == -ENOENT) retdesc = ERR_PTR(-EPROBE_DEFER); - if (PTR_ERR(retdesc) != -EPROBE_DEFER) - dev_err(dev, "error trying to get descriptor: %d\n", ret); + dev_err_probe(dev, PTR_ERR(retdesc), + "error trying to get descriptor: %d\n"); return retdesc; }