Re: Query regarding pci_register_driver vs platform_driver_register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




--- On Mon, 12/13/10, Greg KH <greg@xxxxxxxxx> wrote:

> From: Greg KH <greg@xxxxxxxxx>

> +0530, Meena Jain wrote:
> > Can I use
> platform_driver_register/platform_driver_probe instead of
> > pci_register_driver for registering the same device?
> If yes, then how?
> 
> Nope, you can't.
> 
> Nor would you want to, it's a PCI device, not a
>  platform > device.

Right ... "instead" is significant..."

The only time you'd do nything like that
is if the PCI bus interface is nothing more
than a bridge to some native bus, and so the
driver only uses PCI for enumeration and power
management.

Then you might have two drivers, and make
 e.g. a PCI registration *IN ADDITION* to one
for the platform bus -- for different drivers.
The PCI device would embed a platform device; and
each would have its own driver.

See for example sl811-hcd, which is a platform
driver, but also supports a PCMCIA-bridged config
(I forget the name of that bridged driver.)

In such a case the "real" driver might be the
platform driver (used where-ever that chip is
found), but when hooked up to a PCMCIA or PCI
bus, it'd have to use other bus glue to talk
to the rest of the system; different wiring.

Such configurations aren't common ones,
but when the device is bridged like that, it's
easier to split the "real" and "bus glue" drivers
than to integrate the bridging with an instance of
the real driver (which must also run without PCI
or whatever the bridging bus happens to be.

- Dave
> 

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux