mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Himangi Saraogi <himangi774@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: host: ohci-tmio: Use managed interfaces for resource allocation
Date: Mon, 30 Jun 2014 17:37:29 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1406301737020.3511@hadrien> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1406301105530.1550-100000@iolanthe.rowland.org>



On Mon, 30 Jun 2014, Alan Stern wrote:

> On Sun, 29 Jun 2014, Himangi Saraogi wrote:
>
> > This patch moves resources allocated using ioremap or
> > dma_declare_coherent_memory to the corresponding managed interface. The
> > function calls to free the allocated resources are removed in the probe
> > and remove functions as they are no longer required. Also, some labels
> > are done away with and a new label err added to make it less specific to
> > the context.
> >
> > Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
> > Acked-by: Julia Lawall <julia.lawall@lip6.fr>
> > ---
> >  drivers/usb/host/ohci-tmio.c | 36 ++++++++++++------------------------
> >  1 file changed, 12 insertions(+), 24 deletions(-)
> >
> > diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c
> > index bb40958..1a6034f 100644
> > --- a/drivers/usb/host/ohci-tmio.c
> > +++ b/drivers/usb/host/ohci-tmio.c
> > @@ -203,10 +203,8 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev)
> >  		return -EINVAL;
> >
> >  	hcd = usb_create_hcd(&ohci_tmio_hc_driver, &dev->dev, dev_name(&dev->dev));
> > -	if (!hcd) {
> > -		ret = -ENOMEM;
> > -		goto err_usb_create_hcd;
> > -	}
> > +	if (!hcd)
> > +		return -ENOMEM;
> >
> >  	hcd->rsrc_start = regs->start;
> >  	hcd->rsrc_len = resource_size(regs);
> > @@ -215,30 +213,31 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev)
> >
> >  	spin_lock_init(&tmio->lock);
> >
> > -	tmio->ccr = ioremap(config->start, resource_size(config));
> > +	tmio->ccr = devm_ioremap(&dev->dev, config->start,
> > +				 resource_size(config));
>
> You should use devm_ioremap_resource() rather than devm_ioremap().

Even if there was no request_mem_region in the original code?

julia

>
> ...
>
> > @@ -259,16 +258,8 @@ err_add_hcd:
> >  	tmio_stop_hc(dev);
> >  	if (cell->disable)
> >  		cell->disable(dev);
> > -err_enable:
> > -	dma_release_declared_memory(&dev->dev);
> > -err_dma_declare:
> > -	iounmap(hcd->regs);
> > -err_ioremap_regs:
> > -	iounmap(tmio->ccr);
> > -err_ioremap_ccr:
> > -	usb_put_hcd(hcd);
> > -err_usb_create_hcd:
> > -
> > +err:
> > +	usb_put_hcr(hcd);
>
> There is no function named "usb_put_hcr()".  Did you try to compile
> this patch?
>
> Alan Stern
>
>

  reply	other threads:[~2014-06-30 15:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-29  6:43 Himangi Saraogi
2014-06-30 15:08 ` Alan Stern
2014-06-30 15:37   ` Julia Lawall [this message]
2014-06-30 16:33     ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1406301737020.3511@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=himangi774@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome