Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75832
b: refs/heads/master
c: 2b93730
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Jan 25, 2008
1 parent afc29db commit 6a74abc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 46 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03d43b19b9f56c1d18bc8f2f7890534fbe6a285d
refs/heads/master: 2b937303188807b498d1a3163f60305f0941538e
50 changes: 5 additions & 45 deletions trunk/drivers/pci/pci-driver.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/*
* drivers/pci/pci-driver.c
*
* (C) Copyright 2002-2004, 2007 Greg Kroah-Hartman <greg@kroah.com>
* (C) Copyright 2007 Novell Inc.
*
* Released under the GPL v2 only.
*
*/

#include <linux/pci.h>
Expand Down Expand Up @@ -356,50 +361,6 @@ static void pci_device_shutdown(struct device *dev)
drv->shutdown(pci_dev);
}

#define kobj_to_pci_driver(obj) container_of(obj, struct device_driver, kobj)
#define attr_to_driver_attribute(obj) container_of(obj, struct driver_attribute, attr)

static ssize_t
pci_driver_attr_show(struct kobject * kobj, struct attribute *attr, char *buf)
{
struct device_driver *driver = kobj_to_pci_driver(kobj);
struct driver_attribute *dattr = attr_to_driver_attribute(attr);
ssize_t ret;

if (!get_driver(driver))
return -ENODEV;

ret = dattr->show ? dattr->show(driver, buf) : -EIO;

put_driver(driver);
return ret;
}

static ssize_t
pci_driver_attr_store(struct kobject * kobj, struct attribute *attr,
const char *buf, size_t count)
{
struct device_driver *driver = kobj_to_pci_driver(kobj);
struct driver_attribute *dattr = attr_to_driver_attribute(attr);
ssize_t ret;

if (!get_driver(driver))
return -ENODEV;

ret = dattr->store ? dattr->store(driver, buf, count) : -EIO;

put_driver(driver);
return ret;
}

static struct sysfs_ops pci_driver_sysfs_ops = {
.show = pci_driver_attr_show,
.store = pci_driver_attr_store,
};
static struct kobj_type pci_driver_kobj_type = {
.sysfs_ops = &pci_driver_sysfs_ops,
};

/**
* __pci_register_driver - register a new pci driver
* @drv: the driver structure to register
Expand All @@ -421,7 +382,6 @@ int __pci_register_driver(struct pci_driver *drv, struct module *owner,
drv->driver.bus = &pci_bus_type;
drv->driver.owner = owner;
drv->driver.mod_name = mod_name;
drv->driver.kobj.ktype = &pci_driver_kobj_type;

spin_lock_init(&drv->dynids.lock);
INIT_LIST_HEAD(&drv->dynids.list);
Expand Down

0 comments on commit 6a74abc

Please sign in to comment.