Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2294914pxb; Fri, 5 Feb 2021 14:09:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrwYZnqgA6BP6RERhOM+zcIyTCSYFPeRlN5/30IyiJb2P7YTs1jgYIbFI81I7YINtlkCgl X-Received: by 2002:a17:907:170d:: with SMTP id le13mr5968648ejc.220.1612562947519; Fri, 05 Feb 2021 14:09:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612562947; cv=none; d=google.com; s=arc-20160816; b=hnUF6hINyqUbaq20CnWT9xxV07tJv5k0Thwr8Ma03+q5Dfqm3f3FjKS/ET+NsSG1Jh yHRo/U8Z2MJaUkNp0WdkMPT/3uiGH84Esmp2sExFrWBp8d/8n0pjAMPLiulT2BNk94NY uZE3ss4uvwEKhxsSBY+K3qILyQejNmXGgT5JmzZ7DWjC1D2zyKTbY1VWDKZv1L6plLGS kwSz0fUo8bRrelkKJuyUDiVc5wDuMAHC5nMJkz+pDvdWgNoGABTyyKZqczxNVNO7A7S6 zVpUw5XS3kR3ifJ1dwDjDjBpVn6w+qnsiFnzy1ret0XCbSaQFAfWKI7ivHkrpC+mZ/a6 ZYaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SR8oxk/3o6bNq9vGbENAowb/LQ5JILtImroQ/q6aJqo=; b=VFlVJf361tEzg7tgE1DqtAHKrzvJjAM7Cm3H1nDshKHehUDOs7DeRqBoqxkl3IdKYL I7kZPciVlIpgdXPq5NCBF6Ul1PuU0CJEbFq1DmGBGJeWZLAeNxHk9h03aloBdxa4fV63 vArrU4MzKctiZKmpORMaRPK/r1dzyOS7q1EgPj3n+pADONP91YuAdiiI+ABl/2APEdyh 7eUCKfFOgIFePc1ixGIzwRmL6CX5/haBjct/J2Ly3Gb/Nd8K9pOJE866DYmnbzfLWObY PHKJo3L/60yhdoErmHTr2GrqFjStPGNF4hbHz7Izb+VWAvU3gmTwEs16yU2aPaHDGvtA Ft7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GFR4nIGo; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c70si5957390edf.551.2021.02.05.14.08.42; Fri, 05 Feb 2021 14:09:07 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=GFR4nIGo; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229731AbhBEWH4 (ORCPT + 99 others); Fri, 5 Feb 2021 17:07:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:45262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232950AbhBEO5b (ORCPT ); Fri, 5 Feb 2021 09:57:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 999F86504F; Fri, 5 Feb 2021 14:12:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612534333; bh=qr/yoZLausju5Sx+LBJnDBabV2P0SvQK/CaAIESv2vk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GFR4nIGoIX/VlnJyGvn2ebGfeAOKc26qha42AR+Fm9Irmw+zrkcI1oUkesE3BGnpS kP0OU0FYruwnHfJAwBlERIIbAvjjuQVfieN2qEjQI8wq2DvqMTVunALmKXKPkb6GYS laVONta9jNTsLLKzYlLrPinQiLWq/p9y7B33dcdE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tony Lindgren , Vinod Koul , Sasha Levin Subject: [PATCH 5.4 14/32] phy: cpcap-usb: Fix warning for missing regulator_disable Date: Fri, 5 Feb 2021 15:07:29 +0100 Message-Id: <20210205140652.948803445@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205140652.348864025@linuxfoundation.org> References: <20210205140652.348864025@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tony Lindgren [ Upstream commit 764257d9069a9c19758b626cc1ba4ae079335d9e ] On deferred probe, we will get the following splat: cpcap-usb-phy cpcap-usb-phy.0: could not initialize VBUS or ID IIO: -517 WARNING: CPU: 0 PID: 21 at drivers/regulator/core.c:2123 regulator_put+0x68/0x78 ... (regulator_put) from [] (release_nodes+0x1b4/0x1fc) (release_nodes) from [] (really_probe+0x104/0x4a0) (really_probe) from [] (driver_probe_device+0x58/0xb4) Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20201230102105.11826-1-tony@atomide.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/motorola/phy-cpcap-usb.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/phy/motorola/phy-cpcap-usb.c b/drivers/phy/motorola/phy-cpcap-usb.c index 5baf64dfb24de..1bebad36bf2e5 100644 --- a/drivers/phy/motorola/phy-cpcap-usb.c +++ b/drivers/phy/motorola/phy-cpcap-usb.c @@ -625,35 +625,42 @@ static int cpcap_usb_phy_probe(struct platform_device *pdev) generic_phy = devm_phy_create(ddata->dev, NULL, &ops); if (IS_ERR(generic_phy)) { error = PTR_ERR(generic_phy); - return PTR_ERR(generic_phy); + goto out_reg_disable; } phy_set_drvdata(generic_phy, ddata); phy_provider = devm_of_phy_provider_register(ddata->dev, of_phy_simple_xlate); - if (IS_ERR(phy_provider)) - return PTR_ERR(phy_provider); + if (IS_ERR(phy_provider)) { + error = PTR_ERR(phy_provider); + goto out_reg_disable; + } error = cpcap_usb_init_optional_pins(ddata); if (error) - return error; + goto out_reg_disable; cpcap_usb_init_optional_gpios(ddata); error = cpcap_usb_init_iio(ddata); if (error) - return error; + goto out_reg_disable; error = cpcap_usb_init_interrupts(pdev, ddata); if (error) - return error; + goto out_reg_disable; usb_add_phy_dev(&ddata->phy); atomic_set(&ddata->active, 1); schedule_delayed_work(&ddata->detect_work, msecs_to_jiffies(1)); return 0; + +out_reg_disable: + regulator_disable(ddata->vusb); + + return error; } static int cpcap_usb_phy_remove(struct platform_device *pdev) -- 2.27.0