From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756426AbcILRUm (ORCPT ); Mon, 12 Sep 2016 13:20:42 -0400 Received: from arroyo.ext.ti.com ([198.47.19.12]:42683 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755628AbcILRUf (ORCPT ); Mon, 12 Sep 2016 13:20:35 -0400 Date: Mon, 12 Sep 2016 12:19:43 -0500 From: Bin Liu To: David Lechner , Alan Stern , Greg Kroah-Hartman , , , , , Kishon Vijay Abraham I , Sergei Shtylyov Subject: Re: [PATCH v6 2/3] usb: musb: da8xx: Use devm in probe Message-ID: <20160912171943.GG18340@uda0271908> Mail-Followup-To: Bin Liu , David Lechner , Alan Stern , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, khilman@kernel.org, nsekhar@ti.com, Kishon Vijay Abraham I , Sergei Shtylyov References: <1473105633-21653-1-git-send-email-david@lechnology.com> <1473105633-21653-3-git-send-email-david@lechnology.com> <20160906191703.GD22318@uda0271908> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20160906191703.GD22318@uda0271908> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Sep 06, 2016 at 02:17:03PM -0500, Bin Liu wrote: > Hi, > > On Mon, Sep 05, 2016 at 03:00:32PM -0500, David Lechner wrote: > > Simplify things a bit by using devm functions where possible. > > > > Signed-off-by: David Lechner > > --- > > drivers/usb/musb/da8xx.c | 19 +++++-------------- > > 1 file changed, 5 insertions(+), 14 deletions(-) > > > > diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c > > index b03d3b8..0c1997c 100644 > > --- a/drivers/usb/musb/da8xx.c > > +++ b/drivers/usb/musb/da8xx.c > > @@ -490,20 +490,18 @@ static int da8xx_probe(struct platform_device *pdev) > > struct da8xx_glue *glue; > > struct platform_device_info pinfo; > > struct clk *clk; > > + int ret; > > > > - int ret = -ENOMEM; > > - > > - glue = kzalloc(sizeof(*glue), GFP_KERNEL); > > + glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL); > > if (!glue) { > > dev_err(&pdev->dev, "failed to allocate glue context\n"); > > Greg's usb-next already has a patch which drops this line. You might > have to rebase this patch, so that it can go to v4.9-rc1. I fixed the merge conflict locally. Regards, -Bin.