[U-Boot] [PATCH 1/9] ioport.h: Remove struct resource & co
Marek Vasut
marex at denx.de
Fri Jan 29 21:50:37 CET 2016
On Friday, January 29, 2016 at 04:58:40 PM, Paul Burton wrote:
> On Fri, Jan 29, 2016 at 03:06:33PM +0100, Marek Vasut wrote:
> > On Friday, January 29, 2016 at 02:54:47 PM, Paul Burton wrote:
> > > We only use struct resource in a single place (drivers/usb/dwc3/core.h)
> > > for a field (xhci_resources) which is never used. Only ARM currently
> > > defines resource_size_t which means linux/ioport.h only compiles there.
> > > In preparation for making use of the IORESOURCE_ flags, remove struct
> > > resource & the various declarations of functions which we don't
> > > implement.
> > >
> > > Signed-off-by: Paul Burton <paul.burton at imgtec.com>
> > > ---
> > >
> > > drivers/usb/dwc3/core.h | 1 -
> > > include/linux/ioport.h | 104
> > >
> > > ------------------------------------------------ 2 files changed, 105
> > > deletions(-)
> >
> > I believe the driver is imported from Linux kernel, so it'd be much
> > better to sync the driver with mainline Linux instead of starting to
> > diverge.
> >
> > Best regards,
> > Marek Vasut
>
> Hi Marek,
Hi,
> The problem is that the driver can't use struct resource because U-Boot
> has none of the infrastructure around it. The driver model doesn't use
> struct resource, there's basically nothing in U-Boot to fill out the
> struct. So unless that changes this dwc3 driver will always have to
> handle resources differently to on Linux.
>
> I therefore don't see any good reason to keep around an unused struct
> which will only currently compile for one architecture, for a driver
> which can't use it in U-Boot anyway.
>
> The alternative to this patch would be to define resource_size_t for
> other architectures, but then we're just left with dead code.
But the downside is, if we start collecting u-boot specific patches on
top of the driver, syncing with Linux will become painful.
I have to admit I am not decided which way to take with this driver. One
option might be to add simple #ifdef __linux__ around the code you want
to disable, this would be least intrusive way to keep the code around and
make it kinda easy to sync with Linux.
Best regards,
Marek Vasut
More information about the U-Boot
mailing list