Commit b8f4ac23 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: comedi_pci: change the comedi_pci_auto_config() 'context'



The comedi_pci_auto_config() function is used to allow the PCI driver
(*probe) function to automatically call the comedi driver (*auto_attach).
This allows the comedi driver to be part of the PnP process when the
PCI device is detected.

Currently the comedi_pci_auto_config() always passes a 'context' of '0'
to comedi_auto_config(). This makes the 'context' a bit useless.

Modify comedi_pci_auto_config() to allow the comedi pci drivers to pass
a 'context' from the PCI driver.

Make all the comedi pci drivers pass the pci_device_id 'driver_data' as
the 'context'. Since none of the comedi pci drivers currently set the
'driver_data' the 'context' will still be '0'.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 451fb766
......@@ -72,13 +72,15 @@ EXPORT_SYMBOL_GPL(comedi_pci_disable);
* comedi_pci_auto_config() - Configure/probe a comedi PCI driver.
* @pcidev: pci_dev struct
* @driver: comedi_driver struct
* @context: driver specific data, passed to comedi_auto_config()
*
* Typically called from the pci_driver (*probe) function.
*/
int comedi_pci_auto_config(struct pci_dev *pcidev,
struct comedi_driver *driver)
struct comedi_driver *driver,
unsigned long context)
{
return comedi_auto_config(&pcidev->dev, driver, 0);
return comedi_auto_config(&pcidev->dev, driver, context);
}
EXPORT_SYMBOL_GPL(comedi_pci_auto_config);
......
......@@ -387,7 +387,8 @@ struct pci_dev *comedi_to_pci_dev(struct comedi_device *);
int comedi_pci_enable(struct pci_dev *, const char *);
void comedi_pci_disable(struct pci_dev *);
int comedi_pci_auto_config(struct pci_dev *, struct comedi_driver *);
int comedi_pci_auto_config(struct pci_dev *, struct comedi_driver *,
unsigned long context);
void comedi_pci_auto_unconfig(struct pci_dev *);
int comedi_pci_driver_register(struct comedi_driver *, struct pci_driver *);
......
......@@ -311,9 +311,9 @@ static struct comedi_driver pci_8255_driver = {
};
static int pci_8255_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &pci_8255_driver);
return comedi_pci_auto_config(dev, &pci_8255_driver, id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(pci_8255_pci_table) = {
......
......@@ -50,9 +50,9 @@ static struct comedi_driver apci035_driver = {
};
static int apci035_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &apci035_driver);
return comedi_pci_auto_config(dev, &apci035_driver, id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(apci035_pci_table) = {
......
......@@ -373,9 +373,9 @@ static struct comedi_driver apci1032_driver = {
};
static int apci1032_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &apci1032_driver);
return comedi_pci_auto_config(dev, &apci1032_driver, id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(apci1032_pci_table) = {
......
......@@ -50,9 +50,9 @@ static struct comedi_driver apci1500_driver = {
};
static int apci1500_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &apci1500_driver);
return comedi_pci_auto_config(dev, &apci1500_driver, id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(apci1500_pci_table) = {
......
......@@ -235,9 +235,9 @@ static struct comedi_driver apci1516_driver = {
};
static int apci1516_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &apci1516_driver);
return comedi_pci_auto_config(dev, &apci1516_driver, id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(apci1516_pci_table) = {
......
......@@ -47,9 +47,9 @@ static struct comedi_driver apci1564_driver = {
};
static int apci1564_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &apci1564_driver);
return comedi_pci_auto_config(dev, &apci1564_driver, id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(apci1564_pci_table) = {
......
......@@ -225,9 +225,9 @@ static struct comedi_driver apci16xx_driver = {
};
static int apci16xx_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &apci16xx_driver);
return comedi_pci_auto_config(dev, &apci16xx_driver, id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(apci16xx_pci_table) = {
......
......@@ -125,9 +125,9 @@ static struct comedi_driver apci1710_driver = {
};
static int apci1710_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &apci1710_driver);
return comedi_pci_auto_config(dev, &apci1710_driver, id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(apci1710_pci_table) = {
......
......@@ -374,9 +374,9 @@ static struct comedi_driver apci2032_driver = {
};
static int apci2032_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &apci2032_driver);
return comedi_pci_auto_config(dev, &apci2032_driver, id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(apci2032_pci_table) = {
......
......@@ -150,9 +150,9 @@ static struct comedi_driver apci2200_driver = {
};
static int apci2200_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &apci2200_driver);
return comedi_pci_auto_config(dev, &apci2200_driver, id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(apci2200_pci_table) = {
......
......@@ -248,9 +248,9 @@ static struct comedi_driver apci3120_driver = {
};
static int apci3120_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &apci3120_driver);
return comedi_pci_auto_config(dev, &apci3120_driver, id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(apci3120_pci_table) = {
......
......@@ -103,9 +103,9 @@ static struct comedi_driver apci3200_driver = {
};
static int apci3200_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &apci3200_driver);
return comedi_pci_auto_config(dev, &apci3200_driver, id->driver_data);
}
static struct pci_driver apci3200_pci_driver = {
......
......@@ -443,9 +443,9 @@ static struct comedi_driver apci3501_driver = {
};
static int apci3501_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &apci3501_driver);
return comedi_pci_auto_config(dev, &apci3501_driver, id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(apci3501_pci_table) = {
......
......@@ -748,9 +748,9 @@ static struct comedi_driver apci3xxx_driver = {
};
static int apci3xxx_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &apci3xxx_driver);
return comedi_pci_auto_config(dev, &apci3xxx_driver, id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(apci3xxx_pci_table) = {
......
......@@ -267,9 +267,10 @@ static struct comedi_driver adl_pci6208_driver = {
};
static int adl_pci6208_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &adl_pci6208_driver);
return comedi_pci_auto_config(dev, &adl_pci6208_driver,
id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(adl_pci6208_pci_table) = {
......
......@@ -293,9 +293,10 @@ static struct comedi_driver adl_pci7x3x_driver = {
};
static int adl_pci7x3x_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &adl_pci7x3x_driver);
return comedi_pci_auto_config(dev, &adl_pci7x3x_driver,
id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(adl_pci7x3x_pci_table) = {
......
......@@ -295,9 +295,10 @@ static struct comedi_driver adl_pci8164_driver = {
};
static int adl_pci8164_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &adl_pci8164_driver);
return comedi_pci_auto_config(dev, &adl_pci8164_driver,
id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(adl_pci8164_pci_table) = {
......
......@@ -959,9 +959,10 @@ static struct comedi_driver adl_pci9111_driver = {
};
static int pci9111_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
const struct pci_device_id *id)
{
return comedi_pci_auto_config(dev, &adl_pci9111_driver);
return comedi_pci_auto_config(dev, &adl_pci9111_driver,
id->driver_data);
}
static DEFINE_PCI_DEVICE_TABLE(pci9111_pci_table) = {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment