Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97061
b: refs/heads/master
c: 26ab705
h: refs/heads/master
i:
  97059: fc15d92
v: v3
  • Loading branch information
Atsushi Nemoto authored and Greg Kroah-Hartman committed May 20, 2008
1 parent 73b9e6f commit 46f7646
Show file tree
Hide file tree
Showing 28 changed files with 105 additions and 171 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: 57312b75aa06b09c28acd9c5a9c70827da3696d2
refs/heads/master: 26ab705396b65a469233a8327ecb51b8aebb6be0
8 changes: 3 additions & 5 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1646,10 +1646,8 @@ W: http://linux-fbdev.sourceforge.net/
S: Maintained

FREESCALE DMA DRIVER
P: Li Yang
M: leoli@freescale.com
P: Zhang Wei
M: zw@zh-kernel.org
P; Zhang Wei
M: wei.zhang@freescale.com
L: linuxppc-embedded@ozlabs.org
L: linux-kernel@vger.kernel.org
S: Maintained
Expand Down Expand Up @@ -3145,7 +3143,7 @@ PCI ERROR RECOVERY
P: Linas Vepstas
M: linas@austin.ibm.com
L: linux-kernel@vger.kernel.org
L: linux-pci@vger.kernel.org
L: linux-pci@atrey.karlin.mff.cuni.cz
S: Supported

PCI SUBSYSTEM
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/x86/pci/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,18 +302,18 @@ static struct dmi_system_id __devinitdata pciprobe_dmi_table[] = {
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant DL360",
.ident = "HP ProLiant DL385 G2",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL360"),
DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL385 G2"),
},
},
{
.callback = set_bf_sort,
.ident = "HP ProLiant DL380",
.ident = "HP ProLiant DL585 G2",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL380"),
DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant DL585 G2"),
},
},
#ifdef __i386__
Expand Down
85 changes: 6 additions & 79 deletions trunk/drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,13 +1084,11 @@ static void device_create_release(struct device *dev)
}

/**
* device_create_vargs - creates a device and registers it with sysfs
* device_create - creates a device and registers it with sysfs
* @class: pointer to the struct class that this device should be registered to
* @parent: pointer to the parent struct device of this new device, if any
* @devt: the dev_t for the char device to be added
* @drvdata: the data to be added to the device for callbacks
* @fmt: string for the device's name
* @args: va_list for the device's name
*
* This function can be used by char device classes. A struct device
* will be created in sysfs, registered to the specified class.
Expand All @@ -1106,10 +1104,10 @@ static void device_create_release(struct device *dev)
* Note: the struct class passed to this function must have previously
* been created with a call to class_create().
*/
struct device *device_create_vargs(struct class *class, struct device *parent,
dev_t devt, void *drvdata, const char *fmt,
va_list args)
struct device *device_create(struct class *class, struct device *parent,
dev_t devt, const char *fmt, ...)
{
va_list args;
struct device *dev = NULL;
int retval = -ENODEV;

Expand All @@ -1126,9 +1124,10 @@ struct device *device_create_vargs(struct class *class, struct device *parent,
dev->class = class;
dev->parent = parent;
dev->release = device_create_release;
dev_set_drvdata(dev, drvdata);

va_start(args, fmt);
vsnprintf(dev->bus_id, BUS_ID_SIZE, fmt, args);
va_end(args);
retval = device_register(dev);
if (retval)
goto error;
Expand All @@ -1139,78 +1138,6 @@ struct device *device_create_vargs(struct class *class, struct device *parent,
kfree(dev);
return ERR_PTR(retval);
}
EXPORT_SYMBOL_GPL(device_create_vargs);

/**
* device_create_drvdata - creates a device and registers it with sysfs
* @class: pointer to the struct class that this device should be registered to
* @parent: pointer to the parent struct device of this new device, if any
* @devt: the dev_t for the char device to be added
* @drvdata: the data to be added to the device for callbacks
* @fmt: string for the device's name
*
* This function can be used by char device classes. A struct device
* will be created in sysfs, registered to the specified class.
*
* A "dev" file will be created, showing the dev_t for the device, if
* the dev_t is not 0,0.
* If a pointer to a parent struct device is passed in, the newly created
* struct device will be a child of that device in sysfs.
* The pointer to the struct device will be returned from the call.
* Any further sysfs files that might be required can be created using this
* pointer.
*
* Note: the struct class passed to this function must have previously
* been created with a call to class_create().
*/
struct device *device_create_drvdata(struct class *class,
struct device *parent,
dev_t devt,
void *drvdata,
const char *fmt, ...)
{
va_list vargs;
struct device *dev;

va_start(vargs, fmt);
dev = device_create_vargs(class, parent, devt, drvdata, fmt, vargs);
va_end(vargs);
return dev;
}
EXPORT_SYMBOL_GPL(device_create_drvdata);

/**
* device_create - creates a device and registers it with sysfs
* @class: pointer to the struct class that this device should be registered to
* @parent: pointer to the parent struct device of this new device, if any
* @devt: the dev_t for the char device to be added
* @fmt: string for the device's name
*
* This function can be used by char device classes. A struct device
* will be created in sysfs, registered to the specified class.
*
* A "dev" file will be created, showing the dev_t for the device, if
* the dev_t is not 0,0.
* If a pointer to a parent struct device is passed in, the newly created
* struct device will be a child of that device in sysfs.
* The pointer to the struct device will be returned from the call.
* Any further sysfs files that might be required can be created using this
* pointer.
*
* Note: the struct class passed to this function must have previously
* been created with a call to class_create().
*/
struct device *device_create(struct class *class, struct device *parent,
dev_t devt, const char *fmt, ...)
{
va_list vargs;
struct device *dev;

va_start(vargs, fmt);
dev = device_create_vargs(class, parent, devt, NULL, fmt, vargs);
va_end(vargs);
return dev;
}
EXPORT_SYMBOL_GPL(device_create);

static int __match_devt(struct device *dev, void *data)
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/dma/iop-adma.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,10 +821,10 @@ static int __devinit iop_adma_memcpy_self_test(struct iop_adma_device *device)

dev_dbg(device->common.dev, "%s\n", __func__);

src = kmalloc(IOP_ADMA_TEST_SIZE, GFP_KERNEL);
src = kzalloc(sizeof(u8) * IOP_ADMA_TEST_SIZE, GFP_KERNEL);
if (!src)
return -ENOMEM;
dest = kzalloc(IOP_ADMA_TEST_SIZE, GFP_KERNEL);
dest = kzalloc(sizeof(u8) * IOP_ADMA_TEST_SIZE, GFP_KERNEL);
if (!dest) {
kfree(src);
return -ENOMEM;
Expand All @@ -834,6 +834,8 @@ static int __devinit iop_adma_memcpy_self_test(struct iop_adma_device *device)
for (i = 0; i < IOP_ADMA_TEST_SIZE; i++)
((u8 *) src)[i] = (u8)i;

memset(dest, 0, IOP_ADMA_TEST_SIZE);

/* Start copy, using first DMA channel */
dma_chan = container_of(device->common.channels.next,
struct dma_chan,
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,12 +648,13 @@ static int ide_register_port(ide_hwif_t *hwif)

get_device(&hwif->gendev);

hwif->portdev = device_create_drvdata(ide_port_class, &hwif->gendev,
MKDEV(0, 0), hwif, hwif->name);
hwif->portdev = device_create(ide_port_class, &hwif->gendev,
MKDEV(0, 0), hwif->name);
if (IS_ERR(hwif->portdev)) {
ret = PTR_ERR(hwif->portdev);
device_unregister(&hwif->gendev);
}
dev_set_drvdata(hwif->portdev, hwif);
out:
return ret;
}
Expand Down
14 changes: 8 additions & 6 deletions trunk/drivers/infiniband/core/user_mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,9 +1005,8 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
if (cdev_add(port->cdev, base_dev + port->dev_num, 1))
goto err_cdev;

port->dev = device_create_drvdata(umad_class, device->dma_device,
port->cdev->dev, port,
"umad%d", port->dev_num);
port->dev = device_create(umad_class, device->dma_device,
port->cdev->dev, "umad%d", port->dev_num);
if (IS_ERR(port->dev))
goto err_cdev;

Expand All @@ -1025,12 +1024,15 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
if (cdev_add(port->sm_cdev, base_dev + port->dev_num + IB_UMAD_MAX_PORTS, 1))
goto err_sm_cdev;

port->sm_dev = device_create_drvdata(umad_class, device->dma_device,
port->sm_cdev->dev, port,
"issm%d", port->dev_num);
port->sm_dev = device_create(umad_class, device->dma_device,
port->sm_cdev->dev,
"issm%d", port->dev_num);
if (IS_ERR(port->sm_dev))
goto err_sm_cdev;

dev_set_drvdata(port->dev, port);
dev_set_drvdata(port->sm_dev, port);

if (device_create_file(port->sm_dev, &dev_attr_ibdev))
goto err_sm_dev;
if (device_create_file(port->sm_dev, &dev_attr_port))
Expand Down
11 changes: 5 additions & 6 deletions trunk/drivers/infiniband/core/uverbs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,15 +755,14 @@ static void ib_uverbs_add_one(struct ib_device *device)
if (cdev_add(uverbs_dev->cdev, IB_UVERBS_BASE_DEV + uverbs_dev->devnum, 1))
goto err_cdev;

uverbs_dev->dev = device_create_drvdata(uverbs_class,
device->dma_device,
uverbs_dev->cdev->dev,
uverbs_dev,
"uverbs%d",
uverbs_dev->devnum);
uverbs_dev->dev = device_create(uverbs_class, device->dma_device,
uverbs_dev->cdev->dev,
"uverbs%d", uverbs_dev->devnum);
if (IS_ERR(uverbs_dev->dev))
goto err_cdev;

dev_set_drvdata(uverbs_dev->dev, uverbs_dev);

if (device_create_file(uverbs_dev->dev, &dev_attr_ibdev))
goto err_class;
if (device_create_file(uverbs_dev->dev, &dev_attr_abi_version))
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/leds/led-class.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
{
int rc;

led_cdev->dev = device_create_drvdata(leds_class, parent, 0, led_cdev,
"%s", led_cdev->name);
led_cdev->dev = device_create(leds_class, parent, 0, "%s",
led_cdev->name);
if (IS_ERR(led_cdev->dev))
return PTR_ERR(led_cdev->dev);

dev_set_drvdata(led_cdev->dev, led_cdev);

/* register the attributes */
rc = device_create_file(led_cdev->dev, &dev_attr_brightness);
if (rc)
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/power/power_supply_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,15 @@ int power_supply_register(struct device *parent, struct power_supply *psy)
{
int rc = 0;

psy->dev = device_create_drvdata(power_supply_class, parent, 0,
psy, "%s", psy->name);
psy->dev = device_create(power_supply_class, parent, 0,
"%s", psy->name);
if (IS_ERR(psy->dev)) {
rc = PTR_ERR(psy->dev);
goto dev_create_failed;
}

dev_set_drvdata(psy->dev, psy);

INIT_WORK(&psy->changed_work, power_supply_changed_work);

rc = power_supply_create_attrs(psy);
Expand Down
9 changes: 5 additions & 4 deletions trunk/drivers/s390/char/vmlogrdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,17 +762,18 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv)
device_unregister(dev);
return ret;
}
priv->class_device = device_create_drvdata(vmlogrdr_class, dev,
MKDEV(vmlogrdr_major,
priv->minor_num),
priv, "%s", dev->bus_id);
priv->class_device = device_create(vmlogrdr_class, dev,
MKDEV(vmlogrdr_major,
priv->minor_num),
"%s", dev->bus_id);
if (IS_ERR(priv->class_device)) {
ret = PTR_ERR(priv->class_device);
priv->class_device=NULL;
sysfs_remove_group(&dev->kobj, &vmlogrdr_attr_group);
device_unregister(dev);
return ret;
}
dev->driver_data = priv;
priv->device = dev;
return 0;
}
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/scsi/ch.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,9 +910,9 @@ static int ch_probe(struct device *dev)
ch->minor = minor;
sprintf(ch->name,"ch%d",ch->minor);

class_dev = device_create_drvdata(ch_sysfs_class, dev,
MKDEV(SCSI_CHANGER_MAJOR, ch->minor),
ch, "s%s", ch->name);
class_dev = device_create(ch_sysfs_class, dev,
MKDEV(SCSI_CHANGER_MAJOR,ch->minor),
"s%s", ch->name);
if (IS_ERR(class_dev)) {
printk(KERN_WARNING "ch%d: device_create failed\n",
ch->minor);
Expand All @@ -926,6 +926,7 @@ static int ch_probe(struct device *dev)
if (init)
ch_init_elem(ch);

dev_set_drvdata(dev, ch);
sdev_printk(KERN_INFO, sd, "Attached scsi changer %s\n", ch->name);

return 0;
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/scsi/osst.c
Original file line number Diff line number Diff line change
Expand Up @@ -5695,12 +5695,13 @@ static int osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape * S
struct device *osst_member;
int err;

osst_member = device_create_drvdata(osst_sysfs_class, device, dev, STp, "%s", name);
osst_member = device_create(osst_sysfs_class, device, dev, "%s", name);
if (IS_ERR(osst_member)) {
printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name);
return PTR_ERR(osst_member);
}

dev_set_drvdata(osst_member, STp);
err = device_create_file(osst_member, &dev_attr_ADR_rev);
if (err)
goto err_out;
Expand Down
11 changes: 5 additions & 6 deletions trunk/drivers/scsi/sg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1441,18 +1441,17 @@ sg_add(struct device *cl_dev, struct class_interface *cl_intf)
if (sg_sysfs_valid) {
struct device *sg_class_member;

sg_class_member = device_create_drvdata(sg_sysfs_class,
cl_dev->parent,
MKDEV(SCSI_GENERIC_MAJOR,
sdp->index),
sdp,
"%s", disk->disk_name);
sg_class_member = device_create(sg_sysfs_class, cl_dev->parent,
MKDEV(SCSI_GENERIC_MAJOR,
sdp->index),
"%s", disk->disk_name);
if (IS_ERR(sg_class_member)) {
printk(KERN_ERR "sg_add: "
"device_create failed\n");
error = PTR_ERR(sg_class_member);
goto cdev_add_err;
}
dev_set_drvdata(sg_class_member, sdp);
error = sysfs_create_link(&scsidp->sdev_gendev.kobj,
&sg_class_member->kobj, "generic");
if (error)
Expand Down
Loading

0 comments on commit 46f7646

Please sign in to comment.