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 X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B8D9C10F12 for ; Wed, 17 Apr 2019 05:54:21 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3D6BB20693 for ; Wed, 17 Apr 2019 05:54:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UK5HcEh1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D6BB20693 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fgVrsRFSpU9pUu9vma89utPx71Xuh7JGvsk3GpcAy1g=; b=UK5HcEh1FJ1a8Q 8mjJtfWCysxlCke9ZxVP0uAOcw7cXpm21jt5YA5VmlPo5sAggk1FPvE9ZCp1WI7J/erJwJAw2/Rw0 4hQR+hDnATsfwQZpNhdCNq9pcWBqASDsO2MmQH4ggGQE9nYtAEq2IPpuk5OxnPVhA8QWhQl6GjmAD G79Wpng0IzjNozpgtzju0+SBVAtBvy6mrSlXf2KWTWXvPdXQnJ5HsaoD1vKbZsPO+VhAESDydpak9 VnAsOnEsACQpo0w5bMxJ1j4dqGUXV7P/pV0zxLcztofAb2cqs2paN6XPeiqvPd7RZ4BGFKYdy2808 gakrXcFR1aAwZW4d9g1g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGdWP-0006B0-ME; Wed, 17 Apr 2019 05:54:13 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGdWM-00069n-CC; Wed, 17 Apr 2019 05:54:11 +0000 X-UUID: a07e1d378c0044138fecb11f35910a10-20190416 X-UUID: a07e1d378c0044138fecb11f35910a10-20190416 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 786285955; Tue, 16 Apr 2019 21:54:02 -0800 Received: from MTKMBS32N2.mediatek.inc (172.27.4.72) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 16 Apr 2019 22:54:00 -0700 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS32N2.mediatek.inc (172.27.4.72) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 17 Apr 2019 13:53:57 +0800 Received: from [10.17.3.153] (172.27.4.253) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 17 Apr 2019 13:53:57 +0800 Message-ID: <1555480437.10179.203.camel@mhfsdcap03> Subject: Re: [v2 PATCH 1/6] usb: xhci-mtk: get optional clock by devm_clk_get_optional() From: Chunfeng Yun To: Greg Kroah-Hartman Date: Wed, 17 Apr 2019 13:53:57 +0800 In-Reply-To: <20190416101506.GB26091@kroah.com> References: <20190416101506.GB26091@kroah.com> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-TM-SNTS-SMTP: 30ACA87CC6A87449EE64A2B4B4442C0660D238C9375587A7B268C78591AF87FE2000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190416_225410_418528_62D8FECD X-CRM114-Status: GOOD ( 18.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mathias Nyman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org, Marek Szyprowski Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 2019-04-16 at 12:15 +0200, Greg Kroah-Hartman wrote: > On Wed, Apr 10, 2019 at 02:47:24PM +0800, Chunfeng Yun wrote: > > Use devm_clk_get_optional() to get optional clock > > > > Signed-off-by: Chunfeng Yun > > --- > > v2: no changes > > --- > > drivers/usb/host/xhci-mtk.c | 19 +++---------------- > > 1 file changed, 3 insertions(+), 16 deletions(-) > > > > diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c > > index 60987c787e44..026fe18972d3 100644 > > --- a/drivers/usb/host/xhci-mtk.c > > +++ b/drivers/usb/host/xhci-mtk.c > > @@ -206,19 +206,6 @@ static int xhci_mtk_ssusb_config(struct xhci_hcd_mtk *mtk) > > return xhci_mtk_host_enable(mtk); > > } > > > > -/* ignore the error if the clock does not exist */ > > -static struct clk *optional_clk_get(struct device *dev, const char *id) > > -{ > > - struct clk *opt_clk; > > - > > - opt_clk = devm_clk_get(dev, id); > > - /* ignore error number except EPROBE_DEFER */ > > - if (IS_ERR(opt_clk) && (PTR_ERR(opt_clk) != -EPROBE_DEFER)) > > - opt_clk = NULL; > > - > > - return opt_clk; > > -} > > - > > static int xhci_mtk_clks_get(struct xhci_hcd_mtk *mtk) > > { > > struct device *dev = mtk->dev; > > @@ -229,15 +216,15 @@ static int xhci_mtk_clks_get(struct xhci_hcd_mtk *mtk) > > return PTR_ERR(mtk->sys_clk); > > } > > > > - mtk->ref_clk = optional_clk_get(dev, "ref_ck"); > > + mtk->ref_clk = devm_clk_get_optional(dev, "ref_ck"); > > if (IS_ERR(mtk->ref_clk)) > > return PTR_ERR(mtk->ref_clk); > > > > - mtk->mcu_clk = optional_clk_get(dev, "mcu_ck"); > > + mtk->mcu_clk = devm_clk_get_optional(dev, "mcu_ck"); > > if (IS_ERR(mtk->mcu_clk)) > > return PTR_ERR(mtk->mcu_clk); > > > > - mtk->dma_clk = optional_clk_get(dev, "dma_ck"); > > + mtk->dma_clk = devm_clk_get_optional(dev, "dma_ck"); > > Also, now that this clock (and the others here) are controlled by the > devm infrastructure, do you have to change when you were cleaning up and > stopping the clock? No need, optional_clk_get() uses devm_clk_get() to get clock Thanks > That logic seems to be the same here, which does > not seem to be correct to me. > > Please also document that in your changelog comments when resending this > series, as all of these patches have this issue as well. > > thanks, > > greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel