[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2806018.GHhm6tEuKR@wuerfel>
Date: Thu, 28 Apr 2016 16:23:56 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Russell King - ARM Linux <linux@....linux.org.uk>
Cc: Felipe Balbi <balbi@...nel.org>,
linux-arm-kernel@...ts.infradead.org,
Grygorii Strashko <grygorii.strashko@...com>,
Catalin Marinas <catalin.marinas@....com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
linux-usb@...r.kernel.org, Sekhar Nori <nsekhar@...com>,
linux-kernel@...r.kernel.org,
David Fisher <david.fisher1@...opsys.com>,
"Thang Q. Nguyen" <tqnguyen@....com>,
Alan Stern <stern@...land.harvard.edu>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] usb: dwc3: host: inherit dma configuration from parent dev
On Thursday 28 April 2016 15:16:12 Russell King - ARM Linux wrote:
> On Thu, Apr 28, 2016 at 09:37:08AM +0300, Felipe Balbi wrote:
> >
> > Hi,
> >
> > Arnd Bergmann <arnd@...db.de> writes:
> > > pointer and pass that in platform_data. This is really easy, it's
> >
> > Sorry but passing a struct device pointer in platform_data is
> > ridiculous. Not to mention that, as I said before, we can't assume which
> > device to pass to xhci_plat in the first place. It might be dwc->dev and
> > it might be dwc->dev->parent.
>
> +1. Passing an unref-counted struct device through platform data is
> totally mad, Arnd you're off your rocker if you think that's a good
> idea. What's more is that there's no way to properly refcount the
> thing.
It's the parent device (or NULL), there is no way it can ever go away as
it's already refcounted through the device subsystem by the creation
of the child device.
I do realize that it's a hack, but the idea is to get rid of that
as soon as possibly by fixing the way the xhci device is probe so
we no longer need to fake a platform_device as the child here and
can just use the device itself.
Arnd
Powered by blists - more mailing lists