From mboxrd@z Thu Jan 1 00:00:00 1970 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 989F3C001DF for ; Wed, 2 Aug 2023 07:03:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232518AbjHBHDi (ORCPT ); Wed, 2 Aug 2023 03:03:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232249AbjHBHDh (ORCPT ); Wed, 2 Aug 2023 03:03:37 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45A6C11A; Wed, 2 Aug 2023 00:03:36 -0700 (PDT) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RG2vx10HbzVj6t; Wed, 2 Aug 2023 15:01:49 +0800 (CST) Received: from [10.67.110.108] (10.67.110.108) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 2 Aug 2023 15:03:31 +0800 Message-ID: <25fe08ab-fb72-0b35-283a-ba86970ffd00@huawei.com> Date: Wed, 2 Aug 2023 15:03:31 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH 9/9] i2c: synquacer: Use dev_err_probe in probe function To: Andi Shyti CC: , , , , , , , , , , , , , , , , , , , , References: <20230728013148.1720978-1-liaochang1@huawei.com> <20230728013148.1720978-10-liaochang1@huawei.com> <20230801214417.hivhbfhnmmgyxkes@intel.intel> From: "Liao, Chang" In-Reply-To: <20230801214417.hivhbfhnmmgyxkes@intel.intel> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.110.108] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 在 2023/8/2 5:44, Andi Shyti 写道: > Hi Liao, > > On Fri, Jul 28, 2023 at 09:31:48AM +0800, Liao Chang wrote: >> Use the dev_err_probe function instead of dev_err in the probe function >> so that the printed messge includes the return value and also handles >> -EPROBE_DEFER nicely. >> >> Signed-off-by: Liao Chang >> --- >> drivers/i2c/busses/i2c-synquacer.c | 7 ++----- >> 1 file changed, 2 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/i2c/busses/i2c-synquacer.c b/drivers/i2c/busses/i2c-synquacer.c >> index 4cc196ca8f6d..cc2af638bfdd 100644 >> --- a/drivers/i2c/busses/i2c-synquacer.c >> +++ b/drivers/i2c/busses/i2c-synquacer.c >> @@ -557,11 +557,8 @@ static int synquacer_i2c_probe(struct platform_device *pdev) >> dev_dbg(&pdev->dev, "clock source %p\n", i2c->pclk); >> >> ret = clk_prepare_enable(i2c->pclk); >> - if (ret) { >> - dev_err(&pdev->dev, "failed to enable clock (%d)\n", >> - ret); >> - return ret; >> - } >> + if (ret) >> + return dev_err_probe(&pdev->dev, ret, "failed to enable clock\n"); >> i2c->pclkrate = clk_get_rate(i2c->pclk); >> } > > here you forgot a few, as well. Thanks for your feedback, i will improve these patches in next revision. > > Andi -- BR Liao, Chang