Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2224314pxb; Fri, 17 Sep 2021 05:16:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6g9Sj1wvcpU8tpQFVp7jiZaX61YFnJZ6f//qE8yHK9uzI6C5DUSbz2mdMH/GugmRHvjZ+ X-Received: by 2002:a5d:9488:: with SMTP id v8mr8331387ioj.195.1631880990676; Fri, 17 Sep 2021 05:16:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631880990; cv=none; d=google.com; s=arc-20160816; b=gIQnoZYO14lSCK+ILNMZs+ZkjJr4nEqsVp+I00eHaXfn3330WliUPat834VPswgeQw Q4bzn7TKxoLpqJBzYBP1yk6TSJM4mBWRrZQYvrXvIdmRLzlgVdmy2Y/oNhUE18aWIwrg gUgZrytRmNg4tZOniDes6h5GfGQ841/0MmmqFpWgV9tgyas6v5NfY11XnXkURD1SyAXG DUj+jzgE13TUPALmlf1weFEp2cU74i0OIAsnnSnj+qPQ/ydeL/eRa9+ayWRxUEisj8Fr 9h+o5jgf2B3aDxylIXpe0Xb/+YJcSK2oLl9UiVETk8oQYcNfRhrw+qIJjsbv0ZZnmJbG /FSw== 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=e6puTvOhkmrqqFu5NiNf9iraDHSJh1GAVnem4pIdtyg=; b=A+CbAcdN21ijRq2a7uwtS36SAMiFG+Z1vrIcUj5+YU+G4Sx2Z7EcMlftAAzMfJ6/iX 01tXRO9VMoG/0O+/VvSREUEN/hfY5awTz1C4uhLO0QQPZHzq889v/e+J6ZhnGjiw3HaP 8j9janPNDtqOXjmC0ZDm/d4GClU3CjkPFMw0aGIOYbyVoMGyWiLnN63VDat2eyb2Ls7L Oeu7nnuDCsegSi9BcwqliV6EI0PS0Ez5+PsLPPNsstq8745JBLSPnwcqtZITTXEt4Pgs CmDeMaKwtRDNUhlh8b4uFpH3t9siSOZrc0imAhy2nkCb2wCU2RKhQDMBblunKVJ3usL7 kzFg== 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 g23si5150196jad.40.2021.09.17.05.16.16; Fri, 17 Sep 2021 05:16:30 -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 S244528AbhIQEYR (ORCPT + 99 others); Fri, 17 Sep 2021 00:24:17 -0400 Received: from mx22.baidu.com ([220.181.50.185]:52778 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S244399AbhIQEXx (ORCPT ); Fri, 17 Sep 2021 00:23:53 -0400 Received: from BJHW-MAIL-EX04.internal.baidu.com (unknown [10.127.64.14]) by Forcepoint Email with ESMTPS id 78C4A4A5BDB8D0256D64; Fri, 17 Sep 2021 12:22:30 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-MAIL-EX04.internal.baidu.com (10.127.64.14) 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:30 +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:29 +0800 From: Cai Huoqing To: CC: Jingoo Han , , , Subject: [PATCH 5/6] fbdev: s3c-fb: Make use of the helper function dev_err_probe() Date: Fri, 17 Sep 2021 12:22:11 +0800 Message-ID: <20210917042213.17689-5-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/s3c-fb.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c index 3b134e1bbc38..459d159879a3 100644 --- a/drivers/video/fbdev/s3c-fb.c +++ b/drivers/video/fbdev/s3c-fb.c @@ -1392,18 +1392,17 @@ static int s3c_fb_probe(struct platform_device *pdev) spin_lock_init(&sfb->slock); sfb->bus_clk = devm_clk_get(dev, "lcd"); - if (IS_ERR(sfb->bus_clk)) { - dev_err(dev, "failed to get bus clock\n"); - return PTR_ERR(sfb->bus_clk); - } + if (IS_ERR(sfb->bus_clk)) + return dev_err_probe(dev, PTR_ERR(sfb->bus_clk), + "failed to get bus clock\n"); clk_prepare_enable(sfb->bus_clk); if (!sfb->variant.has_clksel) { sfb->lcd_clk = devm_clk_get(dev, "sclk_fimd"); if (IS_ERR(sfb->lcd_clk)) { - dev_err(dev, "failed to get lcd clock\n"); - ret = PTR_ERR(sfb->lcd_clk); + ret = dev_err_probe(dev, PTR_ERR(sfb->lcd_clk), + "failed to get lcd clock\n"); goto err_bus_clk; } -- 2.25.1