svn commit: r360241 - head/sys/dev/ichiic

John Baldwin jhb at FreeBSD.org
Fri Apr 24 21:58:47 UTC 2020


On 4/24/20 11:48 AM, Andriy Gapon wrote:
> On 24/04/2020 19:23, Justin Hibbits wrote:
>> Can you look at how ofw_iicbus does this?  Everything works just fine
>> with that, and it's compiled into the iicbus module as well.  Perhaps
>> you can pick some ideas from there.
>>
>> One thing I remember doing on the fsl_i2c driver was to just name the
>> driver iichb and everything worked beautifully.  Yes, it was sort of a
>> cop-out vs adding another attachment, but it solved the problem, and
>> does make sense.
> 
> Justin,
> 
> yes, "iichb" is the only name that has special properties because of
> DRIVER_MODULE(iicbus, iichb, ...) in icbus.c.
> That's essentially the same approach that is used for gpio.
> Maybe it's the way.
> But there was something that spooked me about many drivers having the same name,
> but can't recall what.

Drivers can have the same name if they are prepared to handle the same
child devices.  For example, various Host-PCI and PCI-PCI bridge drivers
all use the "pcib" name as they all support having "pci" child devices
and provide the pcib_if methods "pci" bus devices expect their parent
to have, etc.  I suspect in the case of "iichb" the same is true and
that would be fine having all these drivers use the same name and rely
on the description string to differentiate different vendors, etc.

-- 
John Baldwin


More information about the svn-src-head mailing list