From mboxrd@z Thu Jan 1 00:00:00 1970 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 62EAECD1284 for ; Thu, 4 Apr 2024 13:01:17 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=d1SySEJCmz0wEfrg/PUbkM+kMgjSF6DGfCm+29LDcmc=; b=xsjK4iDuJ0bB84 3sU6bBACHgsPta7mNhTVzha5MST9XlPhjehDvokaIp8QZIpZq/QIfrUiTA82WdtX3OPW3Ef5+LHFG fSSIItTjz88wEAOnxO8rFd9tuG296rB9wLSDc3TvK2v20gcuBkdaAMDXf4Y68gcqdE1Zv5q85plFZ zTURKql+bZMZYqKXTsoRhRkcwXza/ZxOJVb6njq1s+Xt/4znjyroFPCsXW26X8deieqghNay4fRpS dRUxqa78z+kO05VPMurV/z7XCrKKL7x7Zh8IHvgcvmOgK1UE+0JP0UFpdvMN3qZt3jOl3kqURuse6 s4aXVLeGEaImSI/0GtMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsMi8-00000002kDK-41Ib; Thu, 04 Apr 2024 13:00:56 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsMi5-00000002kBe-1L1T for linux-arm-kernel@lists.infradead.org; Thu, 04 Apr 2024 13:00:54 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 06EC1612EC; Thu, 4 Apr 2024 13:00:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3FFBC433C7; Thu, 4 Apr 2024 13:00:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712235651; bh=U2Ze18IaiYym3G5T8VVewUxICdwroUYzwMPTeS27ubw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Butq47HZgP90PPp4KiQbstGLkbFYIyE5/PGSSFRZ1C7CCtxMZPaqR05OVLQgQ607c yAPV8smmjPwbElzG7ZLm1voSWiiKPc+cV7kWm1ttZdynepinTrhvqOTbkJcr45aE5n vL1GqqFHU4RWQdOTPlefn2brPMh/HN2gElLhggeE= Date: Thu, 4 Apr 2024 15:00:48 +0200 From: Greg Kroah-Hartman To: Anand Moon Cc: Alan Stern , Krzysztof Kozlowski , Alim Akhtar , Christophe JAILLET , Johan Hovold , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/6] usb: ehci-exynos: Use devm_clk_get_enabled() helpers Message-ID: <2024040442-subscript-detective-8d12@gregkh> References: <20240404071350.4242-1-linux.amoon@gmail.com> <20240404071350.4242-2-linux.amoon@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240404071350.4242-2-linux.amoon@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240404_060053_502022_D1AB5EE5 X-CRM114-Status: GOOD ( 21.21 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Apr 04, 2024 at 12:43:17PM +0530, Anand Moon wrote: > The devm_clk_get_enabled() helpers: > - call devm_clk_get() > - call clk_prepare_enable() and register what is needed in order to > call clk_disable_unprepare() when needed, as a managed resource. > > This simplifies the code and avoids the calls to clk_disable_unprepare(). > > While at it, use dev_err_probe consistently, and use its return value > to return the error code. > > Signed-off-by: Anand Moon > --- > V2: drop the clk_disable_unprepare in suspend/resume functions > fix the usb_put_hcd return before the devm_clk_get_enabled > --- > drivers/usb/host/ehci-exynos.c | 19 +++++-------------- > 1 file changed, 5 insertions(+), 14 deletions(-) > > diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c > index f644b131cc0b..f00bfd0b13dc 100644 > --- a/drivers/usb/host/ehci-exynos.c > +++ b/drivers/usb/host/ehci-exynos.c > @@ -159,20 +159,15 @@ static int exynos_ehci_probe(struct platform_device *pdev) > > err = exynos_ehci_get_phy(&pdev->dev, exynos_ehci); > if (err) > - goto fail_clk; > - > - exynos_ehci->clk = devm_clk_get(&pdev->dev, "usbhost"); > + goto fail_io; > > + exynos_ehci->clk = devm_clk_get_enabled(&pdev->dev, "usbhost"); > if (IS_ERR(exynos_ehci->clk)) { > - dev_err(&pdev->dev, "Failed to get usbhost clock\n"); > - err = PTR_ERR(exynos_ehci->clk); > - goto fail_clk; > + usb_put_hcd(hcd); > + return dev_err_probe(&pdev->dev, PTR_ERR(exynos_ehci->clk), > + "Failed to get usbhost clock\n"); Why is this logic changed? If you want to call dev_err_probe(), that's great, but do NOT mix it up with a commit that does something totally different. When you say something like "while at it" in a changelog text, that is a HUGE hint that it needs to be a separate commit. Because of that reason alone, I can't take these, you know better :( thanks, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel