From patchwork Fri Mar 5 09:16:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 1447705 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4DsMZZ5KKbz9sVS for ; Fri, 5 Mar 2021 20:17:26 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229660AbhCEJQx (ORCPT ); Fri, 5 Mar 2021 04:16:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbhCEJQY (ORCPT ); Fri, 5 Mar 2021 04:16:24 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2F6FC061760 for ; Fri, 5 Mar 2021 01:16:22 -0800 (PST) Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.pengutronix.de.) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1lI6ZJ-0004zS-7b; Fri, 05 Mar 2021 10:16:21 +0100 From: Philipp Zabel To: linux-ide@vger.kernel.org Cc: Jens Axboe , Matthias Brugger Subject: [PATCH] ata: mediatek: fix optional reset handling Date: Fri, 5 Mar 2021 10:16:14 +0100 Message-Id: <20210305091614.11390-1-p.zabel@pengutronix.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 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-ide@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org 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 unconditionally return errors from devm_reset_control_get_optional_exclusive. Signed-off-by: Philipp Zabel --- drivers/ata/ahci_mtk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ata/ahci_mtk.c b/drivers/ata/ahci_mtk.c index d9b08ae7c3b2..7b705302308e 100644 --- a/drivers/ata/ahci_mtk.c +++ b/drivers/ata/ahci_mtk.c @@ -49,15 +49,15 @@ static int mtk_ahci_platform_resets(struct ahci_host_priv *hpriv, /* reset AXI bus and PHY part */ plat->axi_rst = devm_reset_control_get_optional_exclusive(dev, "axi"); - if (PTR_ERR(plat->axi_rst) == -EPROBE_DEFER) + if (IS_ERR(plat->axi_rst)) return PTR_ERR(plat->axi_rst); plat->sw_rst = devm_reset_control_get_optional_exclusive(dev, "sw"); - if (PTR_ERR(plat->sw_rst) == -EPROBE_DEFER) + if (IS_ERR(plat->sw_rst)) return PTR_ERR(plat->sw_rst); plat->reg_rst = devm_reset_control_get_optional_exclusive(dev, "reg"); - if (PTR_ERR(plat->reg_rst) == -EPROBE_DEFER) + if (IS_ERR(plat->reg_rst)) return PTR_ERR(plat->reg_rst); err = reset_control_assert(plat->axi_rst);