Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2316304pxb; Fri, 5 Feb 2021 14:53:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJyt8K3PxGPL1+KXGg5H3aA7GX8i+af3gUXPkJh6Wga9Iv6XjAKyjNo2qaw3Nmv8EEq5EGsy X-Received: by 2002:a17:906:2a1b:: with SMTP id j27mr258493eje.438.1612565631108; Fri, 05 Feb 2021 14:53:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612565631; cv=none; d=google.com; s=arc-20160816; b=NGnVu5Ha/yxzeBHhCk4K37I1PvGTIxSljq1hmQ1ooToAIK5lFTTVtOD0hFqmShOO7I 8O+g+8HMIb3u48jGjSmxfMs54hUcd8jEntWtK38jmRnqUlH8U5+NfZ/phUDajqplH1q5 nHU9GrQS06o/umiNoJR1L6L3aNn776G1/DDzpQleTeYUMRDJWH0r9peg1zuV3VUyV62k 3niJNbP3/HuBoQYHYkKvi+JAvFFQC/blRHzIOP2xOb9dAyz9SQsBsRm8IzXfCGaa33Kb ZmLD+lgOt1CMFQ1ljYb7CnJgpwj6JxdAakl97xYhET7MbRUL3oNJ5ep/CTPnZMG8FBmC JJhg== 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=I8Cn8Q1qTRpDxq/FRzvJwGuYIG/eJHlrb3wvIfrsIIk=; b=Hsy6MZnqOjxiKpG8DkBGJVWAZzVpQNNTYIZHHega/iXi6QwyO2jwdqkUVs82PBPQtI rMuNkkUxOk+oejdHKO2G6uNGAJsagZMsZTnEIBWMZxDqS3rn54CUgSXE84HqMyjDo5XU VMsVDCkBMJQjTIDETwda3ppB+fVyKYG7jRIhEWoP/tOLl7ERxJctilt2V23Y22wBQjE5 kqpi2KYLZwE0GXjnEFdzJEim8zIN5tQt3bjBQl4tOzUCuVtEYE0IQPngtCfJWZMRqaYm x6cL7fuq8XLOGA1WAOc5YMsbJ1lah8iQSBR8ngj315HLPrugqb2Asg5WyeSiLP4G2FF6 7iVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mEKwfE8m; 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 p3si852778eji.503.2021.02.05.14.53.26; Fri, 05 Feb 2021 14:53:51 -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=mEKwfE8m; 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 S229991AbhBEWty (ORCPT + 99 others); Fri, 5 Feb 2021 17:49:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:43564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232307AbhBEOqB (ORCPT ); Fri, 5 Feb 2021 09:46:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3F31864FC6; Fri, 5 Feb 2021 14:14:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612534498; bh=IPu/KnhQuYij1Yo+UXNFmK41pPvNUgBHdzHHXXO6HsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mEKwfE8mLy8M/nuTXRjQCvT435qcaFvX+ClkJgLsYkRnY8R+MXcLDfqtFIhqImNfl go0V9plGIpvAT5hAs8b9zNtZ5G/Gc/eEwceXmkU5b7wh4ZHHkcL5lOzepwul3pHI8p O8hvQsrPnEAP2LXABKIQPIfCVuLj+SG6rlnApltY= 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 4.14 08/15] phy: cpcap-usb: Fix warning for missing regulator_disable Date: Fri, 5 Feb 2021 15:08:53 +0100 Message-Id: <20210205140650.065860947@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205140649.733510103@linuxfoundation.org> References: <20210205140649.733510103@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 593c77dbde2eb..106f53f333242 100644 --- a/drivers/phy/motorola/phy-cpcap-usb.c +++ b/drivers/phy/motorola/phy-cpcap-usb.c @@ -623,35 +623,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