Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp532945pxk; Wed, 2 Sep 2020 08:09:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwso+lezh/h7NVZP26IZYhSoCdkE7mISw8CsrcXEluv3ZjDJTu7d8gHUh51BuuuIZiISuon X-Received: by 2002:a17:906:71c7:: with SMTP id i7mr420981ejk.245.1599059340262; Wed, 02 Sep 2020 08:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599059340; cv=none; d=google.com; s=arc-20160816; b=fw94yUPwhxyaAvThYiD1QDerVJkTgRutccocD2CdmTOkBSBwvxi+ec7RiVLWQUatih wXuCYiA709T1GZnIYDZ0LOiJ2mhh8HPL7Hu/KsNtD5BGMFpnXtEmbRhTHXUW7zFP4Zov WxEh+Zho4kWnHxOqF1b6PiiPyUBTiEQMuzvEJOWVNF/FGpB80kd9pRKDU9R9U36Ygh1M veRiZnBZNovhC1rs7pipumklJUXqiWTtiYpwSlbN+im2u1WJud8Fgz2ejjUm8T8Pz1Nb bI3gOQXz2OkaU5tGs8Xy0U1y1YGA6XIoli1UcEzgbx+nf77bg3dzKI47R3tlYxUsL4MS WhvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=bs9Gk6dI9P+BgMaKzu9SF6ifAVC0TZS7TeE1V4GYTXs=; b=eTOjbWAG0MOE4e4vX1IBTvAnBtFNbRL2n7C8XzIfj3zeZiQod/78/wC1mz7+67tuyR NtOXrFm30DA9fE4nlmYTWG7JRrstZaitlZfjLuUn+2EG1KN4eJc2lDv1KTX83M7X4iDC 8PasstmFuvtPdkzPvtXn18KHKtxnlv8XFxTQNYuC1owkmH9iiogRlJKG2+SjjPEkYy+q oCO+gIK000NrgRSG4Gf3ZPC95on+bT0rhqYkQUG7gi+vyikBgUdvgyTy8iZ7YqFpLg2y kFA9D4Oe9VwhwmUYKvq0/qLscGBxnwmbLz5tXLBRbqwRVqawrq+aR2RXZvhOuSdRqqjQ Jb3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HbkL8XGj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k4si699705edx.303.2020.09.02.08.08.35; Wed, 02 Sep 2020 08:09:00 -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; dkim=pass header.i=@kernel.org header.s=default header.b=HbkL8XGj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727075AbgIBPIF (ORCPT + 99 others); Wed, 2 Sep 2020 11:08:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:44088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727897AbgIBPHO (ORCPT ); Wed, 2 Sep 2020 11:07:14 -0400 Received: from kozik-lap.mshome.net (unknown [194.230.155.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 63A872098B; Wed, 2 Sep 2020 15:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599059232; bh=cSQFmywcXooFcP8VNV2UCrqNvF5ouq7dUikOFo9zEuE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HbkL8XGjlZRIsnFjTWTb8qGh7g6TA7XNjmlnpLsW6jen2ejlREFL339vj7TAxnvIE Wm0UUO3He96/92GV1im9eWcxkprkOuAb+PHY8CHUpgOq1DEhLH0ya0vRS/Q632PTR+ 3K+ywjp4pqrqiWIsSqKLLtjF27yD5l/9OL2ccxik= From: Krzysztof Kozlowski To: Nicolas Saenz Julienne , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Michal Simek , Sekhar Nori , Bartosz Golaszewski , Oleksij Rempel , Pengutronix Kernel Team , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , Heiko Stuebner , Pierre-Yves MORDRET , Maxime Coquelin , Alexandre Torgue , Peter Rosin , Wolfram Sang , linux-i2c@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Cc: Krzysztof Kozlowski Subject: [PATCH 4/9] i2c: cadence: Simplify with dev_err_probe() Date: Wed, 2 Sep 2020 17:06:38 +0200 Message-Id: <20200902150643.14839-4-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200902150643.14839-1-krzk@kernel.org> References: <20200902150643.14839-1-krzk@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski --- drivers/i2c/busses/i2c-cadence.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c index e4b7f2a951ad..eefde554c50c 100644 --- a/drivers/i2c/busses/i2c-cadence.c +++ b/drivers/i2c/busses/i2c-cadence.c @@ -1214,11 +1214,10 @@ static int cdns_i2c_probe(struct platform_device *pdev) "Cadence I2C at %08lx", (unsigned long)r_mem->start); id->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(id->clk)) { - if (PTR_ERR(id->clk) != -EPROBE_DEFER) - dev_err(&pdev->dev, "input clock not found.\n"); - return PTR_ERR(id->clk); - } + if (IS_ERR(id->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(id->clk), + "input clock not found.\n"); + ret = clk_prepare_enable(id->clk); if (ret) dev_err(&pdev->dev, "Unable to enable clock.\n"); -- 2.17.1