scx200_acb: Use PCI I/O resource when appropriate

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

 



Hi Rudolf, Jordan,

> Well we had the problem with i2c-viapro and vi686a. Best solution was
> to fail from the probe function - like this:
> 
>          /* Always return failure here.  This is to allow other drivers to bind
>           * to this pci device.  We don't really want to have control over the
>           * pci device, we only wanted to read as few register values from it.
>           */
>          return -ENODEV;
> 
> release_region:
>          release_region(vt596_smba, 8);
>          return error;
> }

True, but we were lucky. You can only do that if you don't need to
access the PCI configuration space during run-time (after the
initialization step) in either driver "sharing" the PCI device. The
i2c-viapro driver qualified, but for example we couldn't do that for
the i2c-i801 driver (block transactions in I2C mode require PCI
configuration register access.)

So depending on the exact hardware context, Jordan may or may not be
able to use the same trick. The other (cleaner) solution is to have an
additional module which registers the PCI device and exports some kind
of interface for the other modules to access the parts they need - but
this requires extra code and makes things much more complex too.

-- 
Jean Delvare




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux