Commit edbc25ca authored by Milton Miller's avatar Milton Miller Committed by Jesse Barnes

PCI: remove dynids.use_driver_data

The driver flag dynids.use_driver_data is almost consistently not set,
and causes more problems than it solves.  It was initially intended as a
flag to indicate whether a driver's usage of driver_data had been
carefully inspected and was ready for values from userspace.  That audit
was never done, so most drivers just get a 0 for driver_data when new
IDs are added from userspace via sysfs.  So remove the flag, allowing
drivers to see the data directly (a followon patch validates the passed
driver_data value against what the drivers expect).
Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Acked-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarMilton Miller <miltonm@bga.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 7d67474e
...@@ -412,7 +412,6 @@ static struct pci_driver amd756_driver = { ...@@ -412,7 +412,6 @@ static struct pci_driver amd756_driver = {
.id_table = amd756_ids, .id_table = amd756_ids,
.probe = amd756_probe, .probe = amd756_probe,
.remove = __devexit_p(amd756_remove), .remove = __devexit_p(amd756_remove),
.dynids.use_driver_data = 1,
}; };
static int __init amd756_init(void) static int __init amd756_init(void)
......
...@@ -483,7 +483,6 @@ static struct pci_driver vt596_driver = { ...@@ -483,7 +483,6 @@ static struct pci_driver vt596_driver = {
.name = "vt596_smbus", .name = "vt596_smbus",
.id_table = vt596_ids, .id_table = vt596_ids,
.probe = vt596_probe, .probe = vt596_probe,
.dynids.use_driver_data = 1,
}; };
static int __init i2c_vt596_init(void) static int __init i2c_vt596_init(void)
......
...@@ -65,8 +65,7 @@ store_new_id(struct device_driver *driver, const char *buf, size_t count) ...@@ -65,8 +65,7 @@ store_new_id(struct device_driver *driver, const char *buf, size_t count)
dynid->id.subdevice = subdevice; dynid->id.subdevice = subdevice;
dynid->id.class = class; dynid->id.class = class;
dynid->id.class_mask = class_mask; dynid->id.class_mask = class_mask;
dynid->id.driver_data = pdrv->dynids.use_driver_data ? dynid->id.driver_data = driver_data;
driver_data : 0UL;
spin_lock(&pdrv->dynids.lock); spin_lock(&pdrv->dynids.lock);
list_add_tail(&dynid->node, &pdrv->dynids.list); list_add_tail(&dynid->node, &pdrv->dynids.list);
......
...@@ -7859,7 +7859,6 @@ static struct pci_driver ipr_driver = { ...@@ -7859,7 +7859,6 @@ static struct pci_driver ipr_driver = {
.remove = ipr_remove, .remove = ipr_remove,
.shutdown = ipr_shutdown, .shutdown = ipr_shutdown,
.err_handler = &ipr_err_handler, .err_handler = &ipr_err_handler,
.dynids.use_driver_data = 1
}; };
/** /**
......
...@@ -347,7 +347,6 @@ struct pci_bus_region { ...@@ -347,7 +347,6 @@ struct pci_bus_region {
struct pci_dynids { struct pci_dynids {
spinlock_t lock; /* protects list, index */ spinlock_t lock; /* protects list, index */
struct list_head list; /* for IDs added at runtime */ struct list_head list; /* for IDs added at runtime */
unsigned int use_driver_data:1; /* pci_device_id->driver_data is used */
}; };
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
......
Markdown is supported
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