Re: [linux-usb-devel] [PATCH] limit power budget on spitz

From: Richard Purdie
Date: Thu Jun 08 2006 - 17:22:26 EST


On Thu, 2006-06-08 at 13:38 -0700, David Brownell wrote:
> > http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=3547/1
>
> OK, I see now. Simple enough, better than the original. Go for it.
>
> There was a PXA issue I was alluding to that's still open, though.
> It's the way there's no selectivity about what platform devices are
> registered ... even kernels running on boards where OHCI isn't hooked
> up to anything will be registering an OHCI controller, as one of many
> examples. Won't affect this particular case, but in general that'd
> be nice to see fixed.

As I understood the code, if you don't have platform_data set, it will
abort in the probe function so it depends what you mean by register. An
OHCI controller never gets created without platform_data.

You're right that the PXA platform device is always registered. FWIW,
there is no platform in mainline that doesn't have OHCI present so this
isn't a major problem at the moment.

The easiest solution might be to move the ohci device registration into
pxa_set_ohci_info (in pxa27x.c). I gave in and appended a patch (compile
tested only so far).

Cheers,

Richard


Only register the PXA OHCI platform device on platforms which provide
the platform data.

Signed-off-by: Richard Purdie <rpurdie@xxxxxxxxx>

Index: git/arch/arm/mach-pxa/pxa27x.c
===================================================================
--- git.orig/arch/arm/mach-pxa/pxa27x.c 2006-06-08 20:50:15.000000000 +0100
+++ git/arch/arm/mach-pxa/pxa27x.c 2006-06-08 22:08:49.000000000 +0100
@@ -200,15 +200,5 @@
void __init pxa_set_ohci_info(struct pxaohci_platform_data *info)
{
ohci_device.dev.platform_data = info;
+ platform_device_register(&ohci_device);
}
-
-static struct platform_device *devices[] __initdata = {
- &ohci_device,
-};
-
-static int __init pxa27x_init(void)
-{
- return platform_add_devices(devices, ARRAY_SIZE(devices));
-}
-
-subsys_initcall(pxa27x_init);


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/