From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965176AbcIFTSB (ORCPT ); Tue, 6 Sep 2016 15:18:01 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:60664 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933347AbcIFTR5 (ORCPT ); Tue, 6 Sep 2016 15:17:57 -0400 Date: Tue, 6 Sep 2016 14:17:03 -0500 From: Bin Liu To: David Lechner CC: 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: <20160906191703.GD22318@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> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1473105633-21653-3-git-send-email-david@lechnology.com> 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 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. Thanks, -Bin.