From patchwork Tue Jun 14 12:05:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 12880974 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 CE87BC43334 for ; Tue, 14 Jun 2022 12:06:37 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=y/5OLWxHjsXWmJtPMzSzsibamRLdhDp2TpOLs50R2RQ=; b=jA+ATx/6yr7QxH eBitM+2kOswOzdIbtNWgFlu26+dmmKuI0czI9gnNN4TlXTViP1gQvm93m5qBkb3zqUX/OnzI8kXy4 riOmBIV15OnqImC5bNl2ZvI2jm9mWTyf2tSI4v9Q57khaUoNn3kA+dETkdeO4Zsq30LtrN82/ct7Y Hot0UBcuRqLLqLWBOqbuHHHA4+sEIi41oE3odUVwzqZ10uIFbAUEzaa6CVPRPkmrbZ6c4bLpf0ZgV TtsRw7DL/mllavzSLPmMEIcCpDoS18hZMS5OP9KRjdTQfYprQoA9y60Yo6BBixI5z/Oyx2idEY1ef ySP8lZRRhmVVthNlVVLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o15Id-009Nnl-HA; Tue, 14 Jun 2022 12:05:35 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o15IZ-009NmI-P4 for linux-arm-kernel@lists.infradead.org; Tue, 14 Jun 2022 12:05:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1655208331; x=1686744331; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=vKwqltHnwg2LTLPMw4J0G9/0s5ytO7cTrRUQXCNc7pk=; b=RqTMF3EHswtsROMG9hZIjsEUdO9VXj83vwpnMQuJBvYse9Icqo04tCkx BiPLao9BFH/5OhkMH5EscaclXjFA0G/uIxDSB4TtzTHAX/g4fAlyJDYKs QgNqr5KA0agky5Y3geyuc3gmydRH5aKJsizYcozUTCK83p5X7BkwWM7kO WAsh/hDabX+wOTOEMNOjpwO10im6cca9nU8Dxtj2FrWWQyCTX+YDxda1J 0JsqkN/FufacKb58IrCayHr2PfPebN4b6byCfBqJZCvqiIw97lN32EUGd qVA2GVf/1xdJMJnyQUyARToWllumm5yZEScXMLvWLdGXcElqKhsDRv9LQ A==; X-IronPort-AV: E=Sophos;i="5.91,300,1647298800"; d="scan'208";a="24448380" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 14 Jun 2022 14:05:26 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Tue, 14 Jun 2022 14:05:26 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Tue, 14 Jun 2022 14:05:26 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1655208326; x=1686744326; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=vKwqltHnwg2LTLPMw4J0G9/0s5ytO7cTrRUQXCNc7pk=; b=by1IwY+5UqrYvhVmaJCzjZaJn8w/VmgCWEgJodXnM2GIXeINj/b6bgdD +T8kyp0e2x2pn+Wnw0LZo3M+sXnJ+FrelGWvFO1FZLeMk5UKFNin2A23+ z6QCCaDJ3tqgo/5BgB0IWRXcWGiy46Z4K/JH1oMiU1+y0XmBhIGmfiFXk 3rUBWF9e755uE7waiIsxpCdHaTM0+hqfbMyZ7np0BINl5Tu0dp/TrZ2w5 M8FDlSfH9i5oMUAHyjvB61eVrs6fIQ1f6MvL1dTr24n/OZf9vlC268lag XJcwrNg8P0I2LHa5vG7Z3KH1PyXlehiHbtCFmwuUBQwoNH/2+16cwL2be g==; X-IronPort-AV: E=Sophos;i="5.91,300,1647298800"; d="scan'208";a="24448379" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 14 Jun 2022 14:05:26 +0200 Received: from steina-w.tq-net.de (unknown [10.123.49.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 97C95280056; Tue, 14 Jun 2022 14:05:26 +0200 (CEST) From: Alexander Stein To: Peter Chen , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Alexander Stein , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/1] usb: chipidea: ci_hdrc_imx: use dev_err_probe() Date: Tue, 14 Jun 2022 14:05:22 +0200 Message-Id: <20220614120522.1469957-1-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220614_050532_250563_91441AAA X-CRM114-Status: GOOD ( 14.11 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use dev_err_probe() to simplify handling errors in ci_hdrc_imx_probe() Signed-off-by: Alexander Stein Acked-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index 097142ffb184..9ffcecd3058c 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -348,25 +348,18 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) data->pinctrl = devm_pinctrl_get(dev); if (PTR_ERR(data->pinctrl) == -ENODEV) data->pinctrl = NULL; - else if (IS_ERR(data->pinctrl)) { - if (PTR_ERR(data->pinctrl) != -EPROBE_DEFER) - dev_err(dev, "pinctrl get failed, err=%ld\n", - PTR_ERR(data->pinctrl)); - return PTR_ERR(data->pinctrl); - } + else if (IS_ERR(data->pinctrl)) + return dev_err_probe(dev, PTR_ERR(data->pinctrl), + "pinctrl get failed\n"); data->hsic_pad_regulator = devm_regulator_get_optional(dev, "hsic"); if (PTR_ERR(data->hsic_pad_regulator) == -ENODEV) { /* no pad regualator is needed */ data->hsic_pad_regulator = NULL; - } else if (IS_ERR(data->hsic_pad_regulator)) { - if (PTR_ERR(data->hsic_pad_regulator) != -EPROBE_DEFER) - dev_err(dev, - "Get HSIC pad regulator error: %ld\n", - PTR_ERR(data->hsic_pad_regulator)); - return PTR_ERR(data->hsic_pad_regulator); - } + } else if (IS_ERR(data->hsic_pad_regulator)) + return dev_err_probe(dev, PTR_ERR(data->hsic_pad_regulator), + "Get HSIC pad regulator error\n"); if (data->hsic_pad_regulator) { ret = regulator_enable(data->hsic_pad_regulator); @@ -458,9 +451,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) &pdata); if (IS_ERR(data->ci_pdev)) { ret = PTR_ERR(data->ci_pdev); - if (ret != -EPROBE_DEFER) - dev_err(dev, "ci_hdrc_add_device failed, err=%d\n", - ret); + dev_err_probe(dev, ret, "ci_hdrc_add_device failed\n"); goto err_clk; }