lkml.org 
[lkml]   [2004]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Platform device matching
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.101 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site