Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753974AbdCOLcL (ORCPT ); Wed, 15 Mar 2017 07:32:11 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:46297 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753912AbdCOLcH (ORCPT ); Wed, 15 Mar 2017 07:32:07 -0400 From: Philipp Zabel To: linux-usb@vger.kernel.org Cc: Patrice Chotard , Alan Stern , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Philipp Zabel Subject: [PATCH v2 13/14] usb: host: ehci-st: simplify optional reset handling Date: Wed, 15 Mar 2017 12:31:55 +0100 Message-Id: <20170315113155.10242-1-p.zabel@pengutronix.de> X-Mailer: git-send-email 2.11.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1173 Lines: 39 As of commit bb475230b8e5 ("reset: make optional functions really optional"), the reset framework API calls use NULL pointers to describe optional, non-present reset controls. This allows to return errors from devm_reset_control_get_optional_shared unconditionally. Signed-off-by: Philipp Zabel --- drivers/usb/host/ehci-st.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/ehci-st.c b/drivers/usb/host/ehci-st.c index be4a2788fc582..12e803d2c98df 100644 --- a/drivers/usb/host/ehci-st.c +++ b/drivers/usb/host/ehci-st.c @@ -210,18 +210,14 @@ static int st_ehci_platform_probe(struct platform_device *dev) devm_reset_control_get_optional_shared(&dev->dev, "power"); if (IS_ERR(priv->pwr)) { err = PTR_ERR(priv->pwr); - if (err == -EPROBE_DEFER) - goto err_put_clks; - priv->pwr = NULL; + goto err_put_clks; } priv->rst = devm_reset_control_get_optional_shared(&dev->dev, "softreset"); if (IS_ERR(priv->rst)) { err = PTR_ERR(priv->rst); - if (err == -EPROBE_DEFER) - goto err_put_clks; - priv->rst = NULL; + goto err_put_clks; } if (pdata->power_on) { -- 2.11.0