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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B233C0015E for ; Tue, 1 Aug 2023 13:12:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:CC:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=hSVQlXgMYPbEl319WZXeIYBAGvPfjWRXLEapTWXvmsk=; b=MFXF3AD06xGpFByr+1Q50nzGd8 LfIifRszG6LjJi0wJ0UjiPGAURcgI77DgdjqByls4gf6+nVe9MoGPRR1Dp0ReDVh9cGDCz61+PO4Q A4hg5kGeKV6doa8ULPNZPeI+dLnyBmjzBwrrXnCRojCh1iuukprnuGHCngCK/yAhGJOTZGUrcvUn7 JfkWIidszKFrfmhhEi6PNFDsprTVWpKtzZ/bO5upubkiT88jq2sD/pJz0qs0iKWDAw+jeARvi/kF/ jDMSp3TarLZCdjMWkoxugJCiTD+fzANPFj8OEcRBRtCNy/L5Xe1heasRJh6JbaL7pXtEmOOZtWe45 g6+NREwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQp9w-002QTn-1a; Tue, 01 Aug 2023 13:11:32 +0000 Received: from szxga08-in.huawei.com ([45.249.212.255]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQp9s-002QSe-37; Tue, 01 Aug 2023 13:11:30 +0000 Received: from canpemm500009.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4RFb7X1Jb8z1GDNr; Tue, 1 Aug 2023 21:10:16 +0800 (CST) Received: from [10.67.102.169] (10.67.102.169) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 1 Aug 2023 21:11:16 +0800 CC: , , , Subject: Re: [PATCH 4/9] i2c: hisi: Use dev_err_probe in probe function To: Liao Chang , , , , , , , , , , , , , , , , , , References: <20230728013148.1720978-1-liaochang1@huawei.com> <20230728013148.1720978-5-liaochang1@huawei.com> From: Yicong Yang Message-ID: <7495980c-0a8e-8485-764a-78d960d19ff8@huawei.com> Date: Tue, 1 Aug 2023 21:11:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20230728013148.1720978-5-liaochang1@huawei.com> X-Originating-IP: [10.67.102.169] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_061129_227666_FB98FA29 X-CRM114-Status: GOOD ( 14.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2023/7/28 9:31, 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 Reviewed-by: Yicong Yang > --- > drivers/i2c/busses/i2c-hisi.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-hisi.c b/drivers/i2c/busses/i2c-hisi.c > index e067671b3ce2..6fc8d6fa43b6 100644 > --- a/drivers/i2c/busses/i2c-hisi.c > +++ b/drivers/i2c/busses/i2c-hisi.c > @@ -462,18 +462,14 @@ static int hisi_i2c_probe(struct platform_device *pdev) > hisi_i2c_disable_int(ctlr, HISI_I2C_INT_ALL); > > ret = devm_request_irq(dev, ctlr->irq, hisi_i2c_irq, 0, "hisi-i2c", ctlr); > - if (ret) { > - dev_err(dev, "failed to request irq handler, ret = %d\n", ret); > - return ret; > - } > + if (ret) > + return dev_err_probe(dev, ret, "failed to request irq handler\n"); > > ctlr->clk = devm_clk_get_optional_enabled(&pdev->dev, NULL); > if (IS_ERR_OR_NULL(ctlr->clk)) { > ret = device_property_read_u64(dev, "clk_rate", &clk_rate_hz); > - if (ret) { > - dev_err(dev, "failed to get clock frequency, ret = %d\n", ret); > - return ret; > - } > + if (ret) > + return dev_err_probe(dev, ret, "failed to get clock frequency\n"); > } else { > clk_rate_hz = clk_get_rate(ctlr->clk); > } > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel