Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp738201ybl; Wed, 28 Aug 2019 04:43:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyB7jyDwPO6Oia67uR+ies3NktRk9fh+67iXHdqc3E7UvZVWTAdxpILj0JsadkcolePxmwc X-Received: by 2002:aa7:8c57:: with SMTP id e23mr4298701pfd.48.1566992627002; Wed, 28 Aug 2019 04:43:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566992626; cv=none; d=google.com; s=arc-20160816; b=cDzfDlE7tkNQMxvAoo1Oh2yMQ/6B0DJdutBKnfeqtCTiuCCUFFRZ4bSP7DCF81qOSO 9BQtjj90bj0S7NlrUiocsmuxcyPw4G3MhqpA0D+zu20VlQH5AVwshRF+AqORvHGANhPU 3HzcXYXZCJh0bTSx/YSVrLi++Z/p4iJeLLcHd31BR0YQCLsKikiF2iZcKCWNHAHV/aex /P2mLEe8aDZlJ5SSN5zR9GQ50L6zDcQC9Sk9vcMeYBoSUJxK5M9Abjx06G0Fpa1hFgoo HkTmL3V/bTrmF4ul5ZBjxLcLWWhgXi/0triGOM0i8VdSPLFuch0dnXIllHzVY2L+p0nO 8vug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DHBfv5zjSEya+0Y/i6kKdeisc73VpG/vbKcbcAGWi3Q=; b=UdxGBuDI2yEMAdcVUuCTijJV6DxaxQ2RjOz5kriyPtDLF6p/gfG6NVOkH9fu49qcAL J2CnMEZZqR2mxaNVbGYvGyGNcs1ZLOg8Q1zS6u7vqebZwdNQJ4dnMGsTlY4LIm6KSSRd UTo8ng98VAOUCm+kXOz1ElKPGtvUxGWfe3kal/DZpWf61QhgWHYZxK9SJC649M/pXsUH rcIQKm8FfOwdjRsF0RV/ELoKGV3raQZzShFSp6+oUHF8p8gfM2DguCWthbbXkYI0WmXN jEMhzdpq0pIuNJeeaRjQnPbKG/LQx2PjH9ntmoTVaoL6A/WgJ/M/hpr0sym61oKGy/Dz zx1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Uv8oEDT3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si1794958pls.36.2019.08.28.04.43.31; Wed, 28 Aug 2019 04:43:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Uv8oEDT3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726441AbfH1Lmq (ORCPT + 99 others); Wed, 28 Aug 2019 07:42:46 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:40753 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726300AbfH1Lmp (ORCPT ); Wed, 28 Aug 2019 07:42:45 -0400 Received: by mail-ed1-f68.google.com with SMTP id h8so2642812edv.7; Wed, 28 Aug 2019 04:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DHBfv5zjSEya+0Y/i6kKdeisc73VpG/vbKcbcAGWi3Q=; b=Uv8oEDT3sDFgzoLnkO582psGXc3+5qq6bCYGdmUVGdSdIAUDsmmCrmbzOwwo0TxzRT plcS5x5XUH0BT+dgcpj2kGi040BP2D3x1kgIzrBQwfvbOgm5vs9iLqNDztaPpEWXBkmr SBbvFIz3p2m4UvFK4IsfVU4tIWiyHk+3SNDlwtjGUEfvNnlNlKDXQGAj4ZHFm8MeuxSi 6tIY+Gs6IqXzwIjG/3DhpxLmOR9Ptsa5O/FW6ObFGzXJwQwYGlQIaqjSWM6lp2+JLRgx KNx63qglS1qpV/sybXXcqLwD8LZ+Ck+QNiR/i7g+adLMCj8dpsNmicKKedcF643WZt9A L4wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DHBfv5zjSEya+0Y/i6kKdeisc73VpG/vbKcbcAGWi3Q=; b=hgJ4zRqDhSrIrs085cWu5pJvBL8YSH8qGqqoT95f5LCaSxo1XGa6Hb5vj2YggsVaRb QzoR8e4KxQ8USHuO54X4t98vOt0GpBksttfZX2dh3K6c/0QiwOpj5wXtsjT0ZBJbV5O3 ug8Kbdll28/smYGSWw9+7AXvWrnOyk+g/YHXWEY2CLDh1NfN6o1cWQPxAxz/19nfTcbo xiGn69iGKOb6qG0QM92i8ho4HR+Qz6Ufie8+v2PMIauDlzfaFl4eod6lLQXzrtwqPePN sm/9rklEPKNpj4Cx0i3ExpzPyg4f+h9W+W+H/kPYjWV+u++wDqPtqJExFlgeQMmTgXwz QyQg== X-Gm-Message-State: APjAAAUhZgJRTLbiAeDRrCguDBBk7apmDVK6WsjlC1Ad45oMuBapSjLq 76zA7/e0jVPuC56qZGkroR2Vehlb8W9IQjJoyA8= X-Received: by 2002:a17:906:5e50:: with SMTP id b16mr2770107eju.254.1566992564016; Wed, 28 Aug 2019 04:42:44 -0700 (PDT) MIME-Version: 1.0 References: <20190723030206.2919-1-hslester96@gmail.com> <20190828032118.GA2966@b29397-desktop> In-Reply-To: <20190828032118.GA2966@b29397-desktop> From: Chuhong Yuan Date: Wed, 28 Aug 2019 19:42:32 +0800 Message-ID: Subject: Re: [PATCH] usb: chipidea: msm: Use device-managed registration API To: Peter Chen Cc: Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 28, 2019 at 11:24 AM Peter Chen wrote: > > On 19-07-23 11:02:07, Chuhong Yuan wrote: > > Use devm_reset_controller_register to get rid > > of manual unregistration. > > > > Signed-off-by: Chuhong Yuan > > --- > > drivers/usb/chipidea/ci_hdrc_msm.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > > index bb4645a8ca46..067542e84aea 100644 > > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > > @@ -216,7 +216,7 @@ static int ci_hdrc_msm_probe(struct platform_device *pdev) > > ci->rcdev.ops = &ci_hdrc_msm_reset_ops; > > ci->rcdev.of_node = pdev->dev.of_node; > > ci->rcdev.nr_resets = 2; > > - ret = reset_controller_register(&ci->rcdev); > > + ret = devm_reset_controller_register(&pdev->dev, &ci->rcdev); > > if (ret) > > return ret; > > > > @@ -272,7 +272,6 @@ static int ci_hdrc_msm_probe(struct platform_device *pdev) > > err_iface: > > clk_disable_unprepare(ci->core_clk); > > err_fs: > > - reset_controller_unregister(&ci->rcdev); > > It is devm API, why the unregister needs to be called at > fail path? > I am not very clear about your problem... After using devm_reset_controller_register(), I have removed reset_controller_unregister() calls in this patch. > Peter > > > return ret; > > } > > > > @@ -284,7 +283,6 @@ static int ci_hdrc_msm_remove(struct platform_device *pdev) > > ci_hdrc_remove_device(ci->ci); > > clk_disable_unprepare(ci->iface_clk); > > clk_disable_unprepare(ci->core_clk); > > - reset_controller_unregister(&ci->rcdev); > > > > return 0; > > } > > -- > > 2.20.1 > >