diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-11-28 15:23:18 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:34 -0500 |
commit | 2b937303188807b498d1a3163f60305f0941538e (patch) | |
tree | 5ee8fff7549a9f77ba6b6642095351ee814d459c /drivers/pci | |
parent | 03d43b19b9f56c1d18bc8f2f7890534fbe6a285d (diff) |
PCI: remove foolish code from pci-driver.c
The PCI bus should not be trying to declare its own attribute type.
Especially as this code could never ever be called because the driver
core overwrites the driver kobject type to be its own internal type.
Delete all of this code as it was never being used and is not correct.
Also update my copyright on the file while I'm touching things there.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pci-driver.c | 50 |
1 files changed, 5 insertions, 45 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 73e362992694..c4fa35d1dd77 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -1,6 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/pci/pci-driver.c | 2 | * drivers/pci/pci-driver.c |
3 | * | 3 | * |
4 | * (C) Copyright 2002-2004, 2007 Greg Kroah-Hartman <greg@kroah.com> | ||
5 | * (C) Copyright 2007 Novell Inc. | ||
6 | * | ||
7 | * Released under the GPL v2 only. | ||
8 | * | ||
4 | */ | 9 | */ |
5 | 10 | ||
6 | #include <linux/pci.h> | 11 | #include <linux/pci.h> |
@@ -356,50 +361,6 @@ static void pci_device_shutdown(struct device *dev) | |||
356 | drv->shutdown(pci_dev); | 361 | drv->shutdown(pci_dev); |
357 | } | 362 | } |
358 | 363 | ||
359 | #define kobj_to_pci_driver(obj) container_of(obj, struct device_driver, kobj) | ||
360 | #define attr_to_driver_attribute(obj) container_of(obj, struct driver_attribute, attr) | ||
361 | |||
362 | static ssize_t | ||
363 | pci_driver_attr_show(struct kobject * kobj, struct attribute *attr, char *buf) | ||
364 | { | ||
365 | struct device_driver *driver = kobj_to_pci_driver(kobj); | ||
366 | struct driver_attribute *dattr = attr_to_driver_attribute(attr); | ||
367 | ssize_t ret; | ||
368 | |||
369 | if (!get_driver(driver)) | ||
370 | return -ENODEV; | ||
371 | |||
372 | ret = dattr->show ? dattr->show(driver, buf) : -EIO; | ||
373 | |||
374 | put_driver(driver); | ||
375 | return ret; | ||
376 | } | ||
377 | |||
378 | static ssize_t | ||
379 | pci_driver_attr_store(struct kobject * kobj, struct attribute *attr, | ||
380 | const char *buf, size_t count) | ||
381 | { | ||
382 | struct device_driver *driver = kobj_to_pci_driver(kobj); | ||
383 | struct driver_attribute *dattr = attr_to_driver_attribute(attr); | ||
384 | ssize_t ret; | ||
385 | |||
386 | if (!get_driver(driver)) | ||
387 | return -ENODEV; | ||
388 | |||
389 | ret = dattr->store ? dattr->store(driver, buf, count) : -EIO; | ||
390 | |||
391 | put_driver(driver); | ||
392 | return ret; | ||
393 | } | ||
394 | |||
395 | static struct sysfs_ops pci_driver_sysfs_ops = { | ||
396 | .show = pci_driver_attr_show, | ||
397 | .store = pci_driver_attr_store, | ||
398 | }; | ||
399 | static struct kobj_type pci_driver_kobj_type = { | ||
400 | .sysfs_ops = &pci_driver_sysfs_ops, | ||
401 | }; | ||
402 | |||
403 | /** | 364 | /** |
404 | * __pci_register_driver - register a new pci driver | 365 | * __pci_register_driver - register a new pci driver |
405 | * @drv: the driver structure to register | 366 | * @drv: the driver structure to register |
@@ -421,7 +382,6 @@ int __pci_register_driver(struct pci_driver *drv, struct module *owner, | |||
421 | drv->driver.bus = &pci_bus_type; | 382 | drv->driver.bus = &pci_bus_type; |
422 | drv->driver.owner = owner; | 383 | drv->driver.owner = owner; |
423 | drv->driver.mod_name = mod_name; | 384 | drv->driver.mod_name = mod_name; |
424 | drv->driver.kobj.ktype = &pci_driver_kobj_type; | ||
425 | 385 | ||
426 | spin_lock_init(&drv->dynids.lock); | 386 | spin_lock_init(&drv->dynids.lock); |
427 | INIT_LIST_HEAD(&drv->dynids.list); | 387 | INIT_LIST_HEAD(&drv->dynids.list); |