Re: Platform device matching

From: Kenn Humborg
Date: Sun Apr 25 2004 - 18:17:57 EST


On Mon, Apr 26, 2004 at 12:00:50AM +0100, Russell King wrote:
> On Sun, Apr 25, 2004 at 11:05:11PM +0100, Kenn Humborg wrote:
> > I'm looking at the code for binding platform devices with drivers.
> > However, platform_match() doesn't seem to agree with its kerneldoc
> > comment:
>
> The code is correct as stands. The documentation is behind times. All
> platform devices are "<name><instance-number>" so it's correct that the
> "floppy" driver matches "floppy0" and "floppy1" etc.

Forgive me if I am being dense, but I still don't see how that works.

The current code:

return (strncmp(pdev->name, drv->name, BUS_ID_SIZE) == 0);

will only return 1 if pdev->name and drv->name are _identical_ for the
first 20 bytes. Which "floppy" and "floppy0" are not.

Could it be that all current platform devices are initially named
as "<name>" and the instance number is only appended after matching
has been done?

Later,
Kenn


-
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/