Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1267514pxb; Thu, 16 Sep 2021 03:51:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmIRD/htakkYeHKgyXJfDl2ihug/rO4VJ6tC1FeAYOF+pr1NR0rrDo1mnN+2ennVlkZq7o X-Received: by 2002:a17:906:ca1:: with SMTP id k1mr5590757ejh.369.1631789477202; Thu, 16 Sep 2021 03:51:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631789477; cv=none; d=google.com; s=arc-20160816; b=kOecSNg9OzsH/40SPCWbGzTPT56UcA7YBpQpP9YC2pmHTBaoVYAdF5EXWHbD7S1wxl jT2fNF+78UK8GJU0m6LDPynbhMpMZuCHW1z4/VGFBtGojQ4eJyYAtt29hBuZmeRVLuE9 Pqb0qq3L1c+ketFhYv9GyUG5RRHhyKHTex3THOqWjMz8qhhZKk19B0NdNh8CpBrbIeJo y7eIj/MZP2peEi6S8eFXKvU22Xgqs0Bn9BQRlFmHa0bEg8yOrGk23OYF7bAi4TxC5gkp GgCTotYdRBGdFwrPrV6r2Sr/f0hbgk1BS7nqxymXnpGI06lT9W7JaJDO3OgoJOWXKzhT AQKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=zDgl2DsAAG+u3mrCWvmWyA40IkSxzxXwCfrccExjMBI=; b=BtdFGh+fejxneEPenFU2iAxAq3SejHGOQyGj9fDBfgrPYB8ZCICJPaO2dFoJ4mCanI Xwyi+SNEHZgp7y0OrWv0Xc0npIrwMZQcG3E/Cr6VKfJiwdSnv/taloTvnC26mPf4Rsoa eSXJuG36iIRh5qPAnrFtwJHPCI5kFL0vjUwcu8w+pN7wEfIAVJISvuAXxoGl4teZUbcd S6OfpbIh2J33THVOjC1JCPdIVmnUCYguRhLjXha87O65pfHgAm4xzrYOzhromyaW5xTj 7xwV9aggyONqRwvZk/2ppdQ8Rn8XBBaZsF2lmRdCzTjuNyckUUO29EO/fAGJZfueDBKe sAHQ== 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 dd3si3066405edb.123.2021.09.16.03.50.54; Thu, 16 Sep 2021 03:51:17 -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 S237193AbhIPKs0 (ORCPT + 99 others); Thu, 16 Sep 2021 06:48:26 -0400 Received: from mx22.baidu.com ([220.181.50.185]:55102 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237141AbhIPKsZ (ORCPT ); Thu, 16 Sep 2021 06:48:25 -0400 Received: from BJHW-Mail-Ex11.internal.baidu.com (unknown [10.127.64.34]) by Forcepoint Email with ESMTPS id BF908A1FBCF7ACA26036; Thu, 16 Sep 2021 18:47:03 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex11.internal.baidu.com (10.127.64.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 16 Sep 2021 18:47:03 +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; Thu, 16 Sep 2021 18:47:02 +0800 From: Cai Huoqing To: CC: Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , , Subject: [PATCH] drm/panel: y030xx067a: Make use of the helper function dev_err_probe() Date: Thu, 16 Sep 2021 18:46:57 +0800 Message-ID: <20210916104658.11834-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex31.internal.baidu.com (172.31.51.25) 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. And using dev_err_probe() can reduce code size, the error value gets printed. Signed-off-by: Cai Huoqing --- drivers/gpu/drm/panel/panel-abt-y030xx067a.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c index 2d8794d495d0..1b5d8f755b12 100644 --- a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c +++ b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c @@ -272,16 +272,14 @@ static int y030xx067a_probe(struct spi_device *spi) return -EINVAL; priv->supply = devm_regulator_get(dev, "power"); - if (IS_ERR(priv->supply)) { - dev_err(dev, "Failed to get power supply\n"); - return PTR_ERR(priv->supply); - } + if (IS_ERR(priv->supply)) + return dev_err_probe(dev, PTR_ERR(priv->supply), + "Failed to get power supply\n"); priv->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); - if (IS_ERR(priv->reset_gpio)) { - dev_err(dev, "Failed to get reset GPIO\n"); - return PTR_ERR(priv->reset_gpio); - } + if (IS_ERR(priv->reset_gpio)) + return dev_err_probe(dev, PTR_ERR(priv->reset_gpio), + "Failed to get reset GPIO\n"); drm_panel_init(&priv->panel, dev, &y030xx067a_funcs, DRM_MODE_CONNECTOR_DPI); -- 2.25.1