From 6238bbb8cf09444f374e54e2b16b08aa11b12d5a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 15 May 2008 13:44:08 -0700 Subject: [PATCH] --- yaml --- r: 97047 b: refs/heads/master c: 8882b39421bae317e3ee864edd845e994307ce16 h: refs/heads/master i: 97045: 25a56287ef8e5a772e3cb4d6193cae3d79046f9c 97043: 8a8fe2ea88aa6b5c01f120ed5bb742131666cea5 97039: 34ed7988858a05923e1f98ec69655584c42233cc v: v3 --- [refs] | 2 +- trunk/MAINTAINERS | 8 ++-- trunk/arch/x86/pci/common.c | 8 ++-- trunk/drivers/base/core.c | 85 +++++++++++++++++++++++++++++++++--- trunk/drivers/dma/iop-adma.c | 6 ++- trunk/include/linux/device.h | 12 +++++ 6 files changed, 103 insertions(+), 18 deletions(-) diff --git a/[refs] b/[refs] index 3f0b608928ab..7ebfb06d7408 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1b5e2a7e23439c13f73cacab1cf227f30cb9ae9f +refs/heads/master: 8882b39421bae317e3ee864edd845e994307ce16 diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index b42dcfcbee44..dc94fc5cb25b 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -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 @@ -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 diff --git a/trunk/arch/x86/pci/common.c b/trunk/arch/x86/pci/common.c index 6e64aaf00d1d..8545c8a9d107 100644 --- a/trunk/arch/x86/pci/common.c +++ b/trunk/arch/x86/pci/common.c @@ -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__ diff --git a/trunk/drivers/base/core.c b/trunk/drivers/base/core.c index be288b5e4180..f861c2b1dcff 100644 --- a/trunk/drivers/base/core.c +++ b/trunk/drivers/base/core.c @@ -1084,11 +1084,13 @@ static void device_create_release(struct device *dev) } /** - * device_create - creates a device and registers it with sysfs + * device_create_vargs - 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. @@ -1104,10 +1106,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(struct class *class, struct device *parent, - dev_t devt, const char *fmt, ...) +struct device *device_create_vargs(struct class *class, struct device *parent, + dev_t devt, void *drvdata, const char *fmt, + va_list args) { - va_list args; struct device *dev = NULL; int retval = -ENODEV; @@ -1124,10 +1126,9 @@ struct device *device_create(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; @@ -1138,6 +1139,78 @@ struct device *device_create(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) diff --git a/trunk/drivers/dma/iop-adma.c b/trunk/drivers/dma/iop-adma.c index 0ec0f431e6a1..762b729672e0 100644 --- a/trunk/drivers/dma/iop-adma.c +++ b/trunk/drivers/dma/iop-adma.c @@ -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; @@ -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, diff --git a/trunk/include/linux/device.h b/trunk/include/linux/device.h index 15e9fa3ad3af..14616e80213c 100644 --- a/trunk/include/linux/device.h +++ b/trunk/include/linux/device.h @@ -449,9 +449,21 @@ extern int __must_check device_reprobe(struct device *dev); /* * Easy functions for dynamically creating devices on the fly */ +extern struct device *device_create_vargs(struct class *cls, + struct device *parent, + dev_t devt, + void *drvdata, + const char *fmt, + va_list vargs); extern struct device *device_create(struct class *cls, struct device *parent, dev_t devt, const char *fmt, ...) __attribute__((format(printf, 4, 5))); +extern struct device *device_create_drvdata(struct class *cls, + struct device *parent, + dev_t devt, + void *drvdata, + const char *fmt, ...) + __attribute__((format(printf, 5, 6))); extern void device_destroy(struct class *cls, dev_t devt); /*