diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-28 13:35:57 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-28 13:35:57 -0700 |
commit | 19abc1a27532f9ceca37e557deaee3150070ab5e (patch) | |
tree | 92e2090028bae02b95b31749a829ab3a2b1c0e67 | |
parent | 6e9a96a90847a764ed252d4ec1443f4df4a824bb (diff) | |
download | patches-19abc1a27532f9ceca37e557deaee3150070ab5e.tar.gz |
clean up the pending patches
Remove some that make no sense and clean up others
-rw-r--r-- | pending/bluetooth-class-fun.patch | 108 | ||||
-rw-r--r-- | pending/driver-core-add-dev_init_and_add.patch | 4 | ||||
-rw-r--r-- | pending/driver-core-device_initialize-can-return-a-value.patch | 18 | ||||
-rw-r--r-- | pending/driver-core-fixup-device_initialize-return-value-usages.patch | 295 | ||||
-rw-r--r-- | pending/driver-core-move-stuff-out-of-device-into-a-private-structure.patch | 346 | ||||
-rw-r--r-- | pending/driver-core-use-dev_get_drvdata-accessors.patch | 1992 | ||||
-rw-r--r-- | pending/ehea-remove-incorrect-sysfs-links.patch | 68 | ||||
-rw-r--r-- | pending/kobject-change-sys-kernel-uids-to-not-use-a-kset.patch | 49 | ||||
-rw-r--r-- | pending/panic-on-io-nmi.diff | 98 | ||||
-rw-r--r-- | pending/usb-fix-usage-count-in-usb-serial-generic-open-regarding-autoresume.patch | 60 | ||||
-rw-r--r-- | pending/usb-gotemp.patch | 54 | ||||
-rw-r--r-- | pending/x86-detect-running-on-a-hyperv-system.patch | 208 |
12 files changed, 87 insertions, 3213 deletions
diff --git a/pending/bluetooth-class-fun.patch b/pending/bluetooth-class-fun.patch deleted file mode 100644 index ebbc1c03d386b7..00000000000000 --- a/pending/bluetooth-class-fun.patch +++ /dev/null @@ -1,108 +0,0 @@ -Subject: bluetooth class fun - ---- - include/net/bluetooth/bluetooth.h | 2 ++ - net/bluetooth/hci_sysfs.c | 10 ++++++++++ - net/bluetooth/sco.c | 35 +++++++++++++++++++++++++++++++++++ - 3 files changed, 47 insertions(+) - ---- a/include/net/bluetooth/bluetooth.h -+++ b/include/net/bluetooth/bluetooth.h -@@ -177,4 +177,6 @@ extern void bt_sysfs_cleanup(void); - - extern struct class *bt_class; - -+extern struct dentry *bt_debug; -+ - #endif /* __BLUETOOTH_H */ ---- a/net/bluetooth/hci_sysfs.c -+++ b/net/bluetooth/hci_sysfs.c -@@ -2,6 +2,7 @@ - - #include <linux/kernel.h> - #include <linux/init.h> -+#include <linux/debugfs.h> - - #include <linux/platform_device.h> - -@@ -264,6 +265,9 @@ static struct device_attribute *conn_att - struct class *bt_class = NULL; - EXPORT_SYMBOL_GPL(bt_class); - -+struct dentry *bt_debug; -+EXPORT_SYMBOL_GPL(bt_debug); -+ - static struct bus_type bt_bus = { - .name = "bluetooth", - }; -@@ -423,6 +427,10 @@ int __init bt_sysfs_init(void) - if (err < 0) - goto out_bus; - -+ bt_debug = debugfs_create_dir("bluetooth", NULL); -+ if (!bt_debug) -+ goto out_class; -+ - bt_class = class_create(THIS_MODULE, "bluetooth"); - if (IS_ERR(bt_class)) { - err = PTR_ERR(bt_class); -@@ -451,6 +459,8 @@ void bt_sysfs_cleanup(void) - - class_destroy(bt_class); - -+ debugfs_remove(bt_debug); -+ - bus_unregister(&bt_bus); - - platform_device_unregister(bt_platform); ---- a/net/bluetooth/sco.c -+++ b/net/bluetooth/sco.c -@@ -909,6 +909,38 @@ static ssize_t sco_sysfs_show(struct cla - - static CLASS_ATTR(sco, S_IRUGO, sco_sysfs_show, NULL); - -+static int sco_open(struct inode *inode, struct file *file) -+{ -+ return 0; -+} -+ -+static int sco_release(struct inode *inode, struct file *file) -+{ -+ return 0; -+} -+ -+static ssize_t sco_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) -+{ -+ read_lock_bh(&sco_sk_list.lock); -+ -+ sk_for_each(sk, node, &sco_sk_list.head) { -+ str += sprintf(str, "%s %s %d\n", -+ batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst), -+ sk->sk_state); -+ } -+ -+ read_unlock_bh(&sco_sk_list.lock); -+} -+ -+static const struct file_operations sco_file_ops = { -+ .owner = THIS_MODULE, -+ .open = sco_open, -+ .llseek = no_llseek, -+ .read = sco_read, -+ .release = sco_close, -+}; -+ -+ - static const struct proto_ops sco_sock_ops = { - .family = PF_BLUETOOTH, - .owner = THIS_MODULE, -@@ -965,6 +997,9 @@ static int __init sco_init(void) - goto error; - } - -+ sco_debug = debugfs_create_file("sco", S_IRUGO, bt_debug, NULL, -+ &sco_fops); -+ - if (class_create_file(bt_class, &class_attr_sco) < 0) - BT_ERR("Failed to create SCO info file"); - diff --git a/pending/driver-core-add-dev_init_and_add.patch b/pending/driver-core-add-dev_init_and_add.patch index 71524c890b6e02..d373c6b3173be5 100644 --- a/pending/driver-core-add-dev_init_and_add.patch +++ b/pending/driver-core-add-dev_init_and_add.patch @@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- a/drivers/base/core.c +++ b/drivers/base/core.c -@@ -1315,6 +1315,36 @@ void root_device_unregister(struct devic +@@ -1370,6 +1370,36 @@ void root_device_unregister(struct devic } EXPORT_SYMBOL_GPL(root_device_unregister); @@ -58,7 +58,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> { --- a/include/linux/device.h +++ b/include/linux/device.h -@@ -472,6 +472,12 @@ extern int __must_check device_register( +@@ -547,6 +547,12 @@ extern int __must_check device_register( extern void device_unregister(struct device *dev); extern void device_initialize(struct device *dev); extern int __must_check device_add(struct device *dev); diff --git a/pending/driver-core-device_initialize-can-return-a-value.patch b/pending/driver-core-device_initialize-can-return-a-value.patch index 1a175c9f0c613a..da4f82a7a1d3c6 100644 --- a/pending/driver-core-device_initialize-can-return-a-value.patch +++ b/pending/driver-core-device_initialize-can-return-a-value.patch @@ -20,7 +20,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- a/drivers/base/core.c +++ b/drivers/base/core.c -@@ -538,7 +538,7 @@ static void klist_children_put(struct kl +@@ -547,7 +547,7 @@ static void klist_children_put(struct kl * NOTE: Use put_device() to give up your reference instead of freeing * @dev directly once you have called this function. */ @@ -29,15 +29,15 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> { dev->kobj.kset = devices_kset; kobject_init(&dev->kobj, &device_ktype); -@@ -549,6 +549,7 @@ void device_initialize(struct device *de - device_init_wakeup(dev, 0); +@@ -558,6 +558,7 @@ void device_initialize(struct device *de + INIT_LIST_HEAD(&dev->devres_head); device_pm_init(dev); set_dev_node(dev, -1); + return 0; } - #ifdef CONFIG_SYSFS_DEPRECATED -@@ -999,7 +1000,11 @@ done: + static struct kobject *virtual_device_parent(struct device *dev) +@@ -1005,7 +1006,11 @@ name_error: */ int device_register(struct device *dev) { @@ -50,7 +50,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> return device_add(dev); } -@@ -1334,7 +1339,9 @@ int device_init_and_add(struct device *d +@@ -1389,7 +1394,9 @@ int device_init_and_add(struct device *d dev->bus = bus; dev->release = release; @@ -63,7 +63,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> err = kobject_set_name_vargs(&dev->kobj, name, vargs); --- a/drivers/base/platform.c +++ b/drivers/base/platform.c -@@ -165,8 +165,11 @@ struct platform_device *platform_device_ +@@ -170,8 +170,11 @@ struct platform_device *platform_device_ strcpy(pa->name, name); pa->pdev.name = pa->name; pa->pdev.id = id; @@ -77,7 +77,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> } return pa ? &pa->pdev : NULL; -@@ -321,7 +324,11 @@ EXPORT_SYMBOL_GPL(platform_device_del); +@@ -332,7 +335,11 @@ EXPORT_SYMBOL_GPL(platform_device_del); */ int platform_device_register(struct platform_device *pdev) { @@ -92,7 +92,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> EXPORT_SYMBOL_GPL(platform_device_register); --- a/include/linux/device.h +++ b/include/linux/device.h -@@ -470,7 +470,7 @@ void driver_init(void); +@@ -545,7 +545,7 @@ void driver_init(void); */ extern int __must_check device_register(struct device *dev); extern void device_unregister(struct device *dev); diff --git a/pending/driver-core-fixup-device_initialize-return-value-usages.patch b/pending/driver-core-fixup-device_initialize-return-value-usages.patch index 2de77b295887d7..79b600266b1d54 100644 --- a/pending/driver-core-fixup-device_initialize-return-value-usages.patch +++ b/pending/driver-core-fixup-device_initialize-return-value-usages.patch @@ -6,21 +6,16 @@ all over the place... arch/mips/kernel/vpe.c | 6 +++++- block/genhd.c | 6 +++++- drivers/base/attribute_container.c | 6 +++++- - drivers/firewire/fw-device.c | 4 +++- drivers/hid/hid-core.c | 6 +++++- - drivers/scsi/hosts.c | 8 ++++++-- - drivers/scsi/libfc/fc_rport.c | 6 +++++- drivers/scsi/raid_class.c | 6 +++++- drivers/scsi/scsi_priv.h | 2 +- drivers/scsi/scsi_scan.c | 14 ++++++++++++-- - drivers/scsi/scsi_sysfs.c | 12 +++++++++--- + drivers/scsi/scsi_sysfs.c | 1 + drivers/scsi/scsi_transport_fc.c | 12 ++++++++++-- drivers/scsi/scsi_transport_iscsi.c | 5 ++++- drivers/scsi/scsi_transport_sas.c | 22 ++++++++++++++++++---- drivers/scsi/scsi_transport_srp.c | 6 +++++- - drivers/scsi/sd.c | 3 ++- drivers/spi/spi.c | 13 +++++++++++-- - drivers/usb/core/message.c | 8 +++++++- drivers/usb/core/usb.c | 7 ++++++- drivers/usb/gadget/atmel_usba_udc.c | 4 +++- drivers/usb/gadget/fsl_qe_udc.c | 4 +++- @@ -37,16 +32,12 @@ all over the place... fs/partitions/check.c | 4 +++- include/linux/uwb.h | 2 +- net/bluetooth/hci_sysfs.c | 3 ++- - net/core/dev.c | 4 +++- - net/core/net-sysfs.c | 4 ++-- - net/core/net-sysfs.h | 2 +- - net/rfkill/rfkill.c | 10 ++++++++-- - net/wireless/core.c | 9 ++++++++- - 39 files changed, 206 insertions(+), 54 deletions(-) + net/wireless/core.c | 1 + + 30 files changed, 154 insertions(+), 38 deletions(-) --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c -@@ -1451,7 +1451,11 @@ static int __init vpe_module_init(void) +@@ -1461,7 +1461,11 @@ static int __init vpe_module_init(void) goto out_chrdev; } @@ -61,7 +52,7 @@ all over the place... dev_set_name(&vpe_device, "vpe1"); --- a/block/genhd.c +++ b/block/genhd.c -@@ -1129,7 +1129,11 @@ struct gendisk *alloc_disk_node(int mino +@@ -1197,7 +1197,11 @@ struct gendisk *alloc_disk_node(int mino rand_initialize_disk(disk); disk_to_dev(disk)->class = &block_class; disk_to_dev(disk)->type = &disk_type; @@ -89,22 +80,9 @@ all over the place... ic->classdev.parent = get_device(dev); ic->classdev.class = cont->class; cont->class->dev_release = attribute_container_release; ---- a/drivers/firewire/fw-device.c -+++ b/drivers/firewire/fw-device.c -@@ -696,7 +696,9 @@ static void fw_device_init(struct work_s - return; - } - -- device_initialize(&device->device); -+ err = device_initialize(&device->device); -+ if (err) -+ goto error; - - fw_device_get(device); - down_write(&fw_device_rwsem); --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c -@@ -1732,7 +1732,11 @@ struct hid_device *hid_allocate_device(v +@@ -1843,7 +1843,11 @@ struct hid_device *hid_allocate_device(v if (hdev == NULL) return ERR_PTR(ret); @@ -117,47 +95,9 @@ all over the place... hdev->dev.release = hid_device_release; hdev->dev.bus = &hid_bus_type; ---- a/drivers/scsi/hosts.c -+++ b/drivers/scsi/hosts.c -@@ -387,14 +387,18 @@ struct Scsi_Host *scsi_host_alloc(struct - else - shost->dma_boundary = 0xffffffff; - -- device_initialize(&shost->shost_gendev); -+ rval = device_initialize(&shost->shost_gendev); -+ if (rval) -+ goto fail_kfree; - dev_set_name(&shost->shost_gendev, "host%d", shost->host_no); - #ifndef CONFIG_SYSFS_DEPRECATED - shost->shost_gendev.bus = &scsi_bus_type; - #endif - shost->shost_gendev.type = &scsi_host_type; - -- device_initialize(&shost->shost_dev); -+ rval = device_initialize(&shost->shost_dev); -+ if (rval) -+ goto fail_kfree; - shost->shost_dev.parent = &shost->shost_gendev; - shost->shost_dev.class = &shost_class; - dev_set_name(&shost->shost_dev, "host%d", shost->host_no); ---- a/drivers/scsi/libfc/fc_rport.c -+++ b/drivers/scsi/libfc/fc_rport.c -@@ -121,7 +121,11 @@ struct fc_rport *fc_rport_rogue_create(s - * Note: all this libfc rogue rport code will be removed for - * upstream so it fine that this is really ugly and hacky right now. - */ -- device_initialize(&rport->dev); -+ if (device_initialize(&rport->dev)) { -+ kfree(rport); -+ return NULL; -+ } -+ - rport->dev.release = fc_rport_rogue_destroy; - - mutex_init(&rdata->rp_mutex); --- a/drivers/scsi/raid_class.c +++ b/drivers/scsi/raid_class.c -@@ -232,7 +232,11 @@ int raid_component_add(struct raid_templ +@@ -235,7 +235,11 @@ int raid_component_add(struct raid_templ return -ENOMEM; INIT_LIST_HEAD(&rc->node); @@ -172,7 +112,7 @@ all over the place... rc->num = rd->component_count++; --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h -@@ -114,7 +114,7 @@ extern int scsi_sysfs_add_sdev(struct sc +@@ -127,7 +127,7 @@ extern int scsi_sysfs_add_sdev(struct sc extern int scsi_sysfs_add_host(struct Scsi_Host *); extern int scsi_sysfs_register(void); extern void scsi_sysfs_unregister(void); @@ -197,7 +137,7 @@ all over the place... if (shost->hostt->slave_alloc) { ret = shost->hostt->slave_alloc(sdev); -@@ -411,7 +416,12 @@ static struct scsi_target *scsi_alloc_ta +@@ -413,7 +418,12 @@ static struct scsi_target *scsi_alloc_ta return NULL; } dev = &starget->dev; @@ -213,35 +153,7 @@ all over the place... dev_set_name(dev, "target%d:%d:%d", shost->host_no, channel, id); --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c -@@ -1070,19 +1070,24 @@ static struct device_type scsi_dev_type - .groups = scsi_sdev_attr_groups, - }; - --void scsi_sysfs_device_initialize(struct scsi_device *sdev) -+int scsi_sysfs_device_initialize(struct scsi_device *sdev) - { - unsigned long flags; - struct Scsi_Host *shost = sdev->host; - struct scsi_target *starget = sdev->sdev_target; -+ int error; - -- device_initialize(&sdev->sdev_gendev); -+ error = device_initialize(&sdev->sdev_gendev); -+ if (error) -+ return error; - sdev->sdev_gendev.bus = &scsi_bus_type; - sdev->sdev_gendev.type = &scsi_dev_type; - dev_set_name(&sdev->sdev_gendev, "%d:%d:%d:%d", - sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); - -- device_initialize(&sdev->sdev_dev); -+ error = device_initialize(&sdev->sdev_dev); -+ if (error) -+ return error; - sdev->sdev_dev.parent = &sdev->sdev_gendev; - sdev->sdev_dev.class = &sdev_class; - dev_set_name(&sdev->sdev_dev, "%d:%d:%d:%d", -@@ -1093,6 +1098,7 @@ void scsi_sysfs_device_initialize(struct +@@ -1073,6 +1073,7 @@ void scsi_sysfs_device_initialize(struct list_add_tail(&sdev->same_target_siblings, &starget->devices); list_add_tail(&sdev->siblings, &shost->__devices); spin_unlock_irqrestore(shost->host_lock, flags); @@ -251,7 +163,7 @@ all over the place... int scsi_is_sdev_device(const struct device *dev) --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c -@@ -2487,7 +2487,11 @@ fc_rport_create(struct Scsi_Host *shost, +@@ -2611,7 +2611,11 @@ fc_rport_create(struct Scsi_Host *shost, spin_unlock_irqrestore(shost->host_lock, flags); dev = &rport->dev; @@ -264,7 +176,7 @@ all over the place... dev->parent = get_device(&shost->shost_gendev); /* parent reference */ dev->release = fc_rport_dev_release; dev_set_name(dev, "rport-%d:%d-%d", -@@ -3178,7 +3182,11 @@ fc_vport_setup(struct Scsi_Host *shost, +@@ -3350,7 +3354,11 @@ fc_vport_setup(struct Scsi_Host *shost, spin_unlock_irqrestore(shost->host_lock, flags); dev = &vport->dev; @@ -279,7 +191,7 @@ all over the place... dev_set_name(dev, "vport-%d:%d-%d", --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c -@@ -670,7 +670,10 @@ iscsi_alloc_session(struct Scsi_Host *sh +@@ -726,7 +726,10 @@ iscsi_alloc_session(struct Scsi_Host *sh scsi_host_get(shost); session->dev.parent = &shost->shost_gendev; session->dev.release = iscsi_session_release; @@ -290,10 +202,10 @@ all over the place... + } if (dd_size) session->dd_data = &session[1]; - return session; + --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c -@@ -623,7 +623,10 @@ struct sas_phy *sas_phy_alloc(struct dev +@@ -711,7 +711,10 @@ struct sas_phy *sas_phy_alloc(struct dev phy->number = number; phy->enabled = 1; @@ -305,7 +217,7 @@ all over the place... phy->dev.parent = get_device(parent); phy->dev.release = sas_phy_release; INIT_LIST_HEAD(&phy->port_siblings); -@@ -811,7 +814,10 @@ struct sas_port *sas_port_alloc(struct d +@@ -899,7 +902,10 @@ struct sas_port *sas_port_alloc(struct d port->port_identifier = port_id; @@ -317,7 +229,7 @@ all over the place... port->dev.parent = get_device(parent); port->dev.release = sas_port_release; -@@ -1363,7 +1369,11 @@ struct sas_rphy *sas_end_device_alloc(st +@@ -1450,7 +1456,11 @@ struct sas_rphy *sas_end_device_alloc(st return NULL; } @@ -330,7 +242,7 @@ all over the place... rdev->rphy.dev.parent = get_device(&parent->dev); rdev->rphy.dev.release = sas_end_device_release; if (scsi_is_sas_expander_device(parent->dev.parent)) { -@@ -1407,7 +1417,11 @@ struct sas_rphy *sas_expander_alloc(stru +@@ -1494,7 +1504,11 @@ struct sas_rphy *sas_expander_alloc(stru return NULL; } @@ -358,21 +270,9 @@ all over the place... rport->dev.parent = get_device(parent); rport->dev.release = srp_rport_release; ---- a/drivers/scsi/sd.c -+++ b/drivers/scsi/sd.c -@@ -1827,7 +1827,8 @@ static void sd_probe_async(void *data, a - SD_MOD_TIMEOUT); - } - -- device_initialize(&sdkp->dev); -+ if (device_initialize(&sdkp->dev)) -+ goto out_free_index; - sdkp->dev.parent = &sdp->sdev_gendev; - sdkp->dev.class = &sd_disk_class; - dev_set_name(&sdkp->dev, dev_name(&sdp->sdev_gendev)); --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c -@@ -199,6 +199,7 @@ struct spi_device *spi_alloc_device(stru +@@ -230,6 +230,7 @@ struct spi_device *spi_alloc_device(stru { struct spi_device *spi; struct device *dev = master->dev.parent; @@ -380,7 +280,7 @@ all over the place... if (!spi_master_get(master)) return NULL; -@@ -214,7 +215,12 @@ struct spi_device *spi_alloc_device(stru +@@ -245,7 +246,12 @@ struct spi_device *spi_alloc_device(stru spi->dev.parent = dev; spi->dev.bus = &spi_bus_type; spi->dev.release = spidev_release; @@ -394,7 +294,7 @@ all over the place... return spi; } EXPORT_SYMBOL_GPL(spi_alloc_device); -@@ -446,7 +452,10 @@ struct spi_master *spi_alloc_master(stru +@@ -479,7 +485,10 @@ struct spi_master *spi_alloc_master(stru if (!master) return NULL; @@ -406,26 +306,9 @@ all over the place... master->dev.class = &spi_master_class; master->dev.parent = get_device(dev); spi_master_set_devdata(master, &master[1]); ---- a/drivers/usb/core/message.c -+++ b/drivers/usb/core/message.c -@@ -1706,7 +1706,13 @@ free_interfaces: - intf->dev.groups = usb_interface_groups; - intf->dev.dma_mask = dev->dev.dma_mask; - INIT_WORK(&intf->reset_ws, __usb_queue_reset_device); -- device_initialize(&intf->dev); -+ ret = device_initialize(&intf->dev); -+ if (ret) { -+ printk(KERN_ERR -+ "USB: something bad happened in device_initialize(): %d\n", -+ ret); -+ goto free_interfaces; -+ } - mark_quiesced(intf); - dev_set_name(&intf->dev, "%d-%s:%d.%d", - dev->bus->busnum, dev->devpath, --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c -@@ -339,6 +339,7 @@ struct usb_device *usb_alloc_dev(struct +@@ -366,6 +366,7 @@ struct usb_device *usb_alloc_dev(struct struct usb_device *dev; struct usb_hcd *usb_hcd = container_of(bus, struct usb_hcd, self); unsigned root_hub = 0; @@ -433,7 +316,7 @@ all over the place... dev = kzalloc(sizeof(*dev), GFP_KERNEL); if (!dev) -@@ -349,7 +350,11 @@ struct usb_device *usb_alloc_dev(struct +@@ -383,7 +384,11 @@ struct usb_device *usb_alloc_dev(struct return NULL; } @@ -448,7 +331,7 @@ all over the place... dev->dev.groups = usb_device_groups; --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c -@@ -1928,7 +1928,9 @@ static int __init usba_udc_probe(struct +@@ -1930,7 +1930,9 @@ static int __init usba_udc_probe(struct dev_info(&pdev->dev, "FIFO at 0x%08lx mapped at %p\n", (unsigned long)fifo->start, udc->fifo); @@ -461,7 +344,7 @@ all over the place... --- a/drivers/usb/gadget/fsl_qe_udc.c +++ b/drivers/usb/gadget/fsl_qe_udc.c -@@ -2549,7 +2549,9 @@ static int __devinit qe_udc_probe(struct +@@ -2569,7 +2569,9 @@ static int __devinit qe_udc_probe(struct /* name: Identifies the controller hardware type. */ udc_controller->gadget.name = driver_name; @@ -474,7 +357,7 @@ all over the place... --- a/drivers/usb/gadget/imx_udc.c +++ b/drivers/usb/gadget/imx_udc.c -@@ -1472,7 +1472,9 @@ static int __init imx_udc_probe(struct p +@@ -1485,7 +1485,9 @@ static int __init imx_udc_probe(struct p imx_usb->clk = clk; imx_usb->dev = &pdev->dev; @@ -487,7 +370,7 @@ all over the place... imx_usb->gadget.dev.dma_mask = pdev->dev.dma_mask; --- a/drivers/usb/gadget/lh7a40x_udc.c +++ b/drivers/usb/gadget/lh7a40x_udc.c -@@ -2070,7 +2070,9 @@ static int lh7a40x_udc_probe(struct plat +@@ -2073,7 +2073,9 @@ static int lh7a40x_udc_probe(struct plat spin_lock_init(&dev->lock); dev->dev = &pdev->dev; @@ -500,7 +383,7 @@ all over the place... the_controller = dev; --- a/drivers/usb/gadget/m66592-udc.c +++ b/drivers/usb/gadget/m66592-udc.c -@@ -1590,7 +1590,9 @@ static int __init m66592_probe(struct pl +@@ -1622,7 +1622,9 @@ static int __init m66592_probe(struct pl dev_set_drvdata(&pdev->dev, m66592); m66592->gadget.ops = &m66592_gadget_ops; @@ -513,7 +396,7 @@ all over the place... m66592->gadget.dev.parent = &pdev->dev; --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c -@@ -2668,6 +2668,7 @@ static int __init +@@ -2659,6 +2659,7 @@ static int __init omap_udc_setup(struct platform_device *odev, struct otg_transceiver *xceiv) { unsigned tmp, buf; @@ -521,7 +404,7 @@ all over the place... /* abolish any previous hardware state */ omap_writew(0, UDC_SYSCON1); -@@ -2693,7 +2694,11 @@ omap_udc_setup(struct platform_device *o +@@ -2684,7 +2685,11 @@ omap_udc_setup(struct platform_device *o udc->gadget.speed = USB_SPEED_UNKNOWN; udc->gadget.name = driver_name; @@ -536,7 +419,7 @@ all over the place... udc->gadget.dev.parent = &odev->dev; --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c -@@ -2188,7 +2188,9 @@ static int __init pxa25x_udc_probe(struc +@@ -2227,7 +2227,9 @@ static int __init pxa25x_udc_probe(struc dev->timer.function = udc_watchdog; dev->timer.data = (unsigned long) dev; @@ -549,7 +432,7 @@ all over the place... --- a/drivers/usb/gadget/pxa27x_udc.c +++ b/drivers/usb/gadget/pxa27x_udc.c -@@ -2422,7 +2422,9 @@ static int __init pxa_udc_probe(struct p +@@ -2497,7 +2497,9 @@ static int __init pxa_udc_probe(struct p goto err_map; } @@ -562,7 +445,7 @@ all over the place... udc->vbus_sensed = 0; --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c -@@ -1845,7 +1845,9 @@ static int s3c2410_udc_probe(struct plat +@@ -1851,7 +1851,9 @@ static int s3c2410_udc_probe(struct plat goto err_mem; } @@ -575,7 +458,7 @@ all over the place... --- a/drivers/uwb/lc-dev.c +++ b/drivers/uwb/lc-dev.c -@@ -109,14 +109,19 @@ static void uwb_dev_sys_release(struct d +@@ -110,14 +110,19 @@ static void uwb_dev_sys_release(struct d * * Alloc, zero and call this function. */ @@ -597,7 +480,7 @@ all over the place... } static ssize_t uwb_dev_EUI_48_show(struct device *dev, -@@ -434,7 +439,11 @@ void uwbd_dev_onair(struct uwb_rc *rc, s +@@ -435,7 +440,11 @@ void uwbd_dev_onair(struct uwb_rc *rc, s macbuf); return; } @@ -612,7 +495,7 @@ all over the place... dev_set_name(&uwb_dev->dev, macbuf); --- a/drivers/uwb/lc-rc.c +++ b/drivers/uwb/lc-rc.c -@@ -84,11 +84,14 @@ static void uwb_rc_sys_release(struct de +@@ -85,11 +85,14 @@ static void uwb_rc_sys_release(struct de } @@ -629,7 +512,7 @@ all over the place... rc->uwb_dev.dev.class = &uwb_rc_class; rc->uwb_dev.dev.release = uwb_rc_sys_release; uwb_rc_neh_create(rc); -@@ -109,10 +112,15 @@ EXPORT_SYMBOL_GPL(uwb_rc_init); +@@ -110,10 +113,15 @@ EXPORT_SYMBOL_GPL(uwb_rc_init); struct uwb_rc *uwb_rc_alloc(void) { struct uwb_rc *rc; @@ -659,7 +542,7 @@ all over the place... struct uwb_rc *parent_rc); --- a/fs/partitions/check.c +++ b/fs/partitions/check.c -@@ -389,7 +389,9 @@ struct hd_struct *add_partition(struct g +@@ -454,7 +454,9 @@ struct hd_struct *add_partition(struct g else dev_set_name(pdev, "%s%d", dname, partno); @@ -683,110 +566,30 @@ all over the place... void uwb_rc_neh_grok(struct uwb_rc *, void *, size_t); --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c -@@ -101,6 +101,7 @@ static void add_conn(struct work_struct - void hci_conn_add_sysfs(struct hci_conn *conn) +@@ -140,6 +140,7 @@ static void del_conn(struct work_struct + void hci_conn_init_sysfs(struct hci_conn *conn) { struct hci_dev *hdev = conn->hdev; + int retval; BT_DBG("conn %p", conn); -@@ -112,7 +113,7 @@ void hci_conn_add_sysfs(struct hci_conn - - dev_set_drvdata(&conn->dev, conn); +@@ -147,7 +148,7 @@ void hci_conn_init_sysfs(struct hci_conn + conn->dev.class = bt_class; + conn->dev.parent = &hdev->dev; - device_initialize(&conn->dev); + retval = device_initialize(&conn->dev); - INIT_WORK(&conn->work, add_conn); - ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -4409,7 +4409,9 @@ int register_netdevice(struct net_device - if (dev->features & NETIF_F_SG) - dev->features |= NETIF_F_GSO; - -- netdev_initialize_kobject(dev); -+ ret = netdev_initialize_kobject(dev); -+ if (ret) -+ goto err_uninit; - ret = netdev_register_kobject(dev); - if (ret) - goto err_uninit; ---- a/net/core/net-sysfs.c -+++ b/net/core/net-sysfs.c -@@ -526,10 +526,10 @@ void netdev_class_remove_file(struct cla - EXPORT_SYMBOL(netdev_class_create_file); - EXPORT_SYMBOL(netdev_class_remove_file); - --void netdev_initialize_kobject(struct net_device *net) -+int netdev_initialize_kobject(struct net_device *net) - { - struct device *device = &(net->dev); -- device_initialize(device); -+ return device_initialize(device); - } - - int netdev_kobject_init(void) ---- a/net/core/net-sysfs.h -+++ b/net/core/net-sysfs.h -@@ -4,5 +4,5 @@ - int netdev_kobject_init(void); - int netdev_register_kobject(struct net_device *); - void netdev_unregister_kobject(struct net_device *); --void netdev_initialize_kobject(struct net_device *); -+int netdev_initialize_kobject(struct net_device *); - #endif ---- a/net/rfkill/rfkill.c -+++ b/net/rfkill/rfkill.c -@@ -671,6 +671,7 @@ struct rfkill * __must_check rfkill_allo - { - struct rfkill *rfkill; - struct device *dev; -+ int retval; - - if (WARN((type >= RFKILL_TYPE_MAX), - KERN_WARNING -@@ -689,10 +690,15 @@ struct rfkill * __must_check rfkill_allo - dev = &rfkill->dev; - dev->class = &rfkill_class; - dev->parent = parent; -- device_initialize(dev); -+ retval = device_initialize(dev); -+ if (retval) { -+ kfree(rfkill); -+ rfkill = NULL; -+ goto exit; -+ } - - __module_get(THIS_MODULE); -- -+exit: - return rfkill; - } - EXPORT_SYMBOL(rfkill_allocate); + INIT_WORK(&conn->work_add, add_conn); + INIT_WORK(&conn->work_del, del_conn); --- a/net/wireless/core.c +++ b/net/wireless/core.c -@@ -208,6 +208,7 @@ struct wiphy *wiphy_new(struct cfg80211_ +@@ -323,6 +323,7 @@ struct wiphy *wiphy_new(const struct cfg - struct cfg80211_registered_device *drv; + struct cfg80211_registered_device *rdev; int alloc_size; + int retval; - WARN_ON(!ops->add_key && ops->del_key); - WARN_ON(ops->add_key && !ops->del_key); -@@ -241,7 +242,13 @@ struct wiphy *wiphy_new(struct cfg80211_ - mutex_init(&drv->devlist_mtx); - INIT_LIST_HEAD(&drv->netdev_list); - -- device_initialize(&drv->wiphy.dev); -+ retval = device_initialize(&drv->wiphy.dev); -+ if (retval) { -+ wiphy_counter--; -+ kfree(drv); -+ return NULL; -+ } -+ - drv->wiphy.dev.class = &ieee80211_class; - drv->wiphy.dev.platform_data = drv; - + WARN_ON(ops->add_key && (!ops->del_key || !ops->set_default_key)); + WARN_ON(ops->auth && (!ops->assoc || !ops->deauth || !ops->disassoc)); diff --git a/pending/driver-core-move-stuff-out-of-device-into-a-private-structure.patch b/pending/driver-core-move-stuff-out-of-device-into-a-private-structure.patch deleted file mode 100644 index 76a06ed1ba02ee..00000000000000 --- a/pending/driver-core-move-stuff-out-of-device-into-a-private-structure.patch +++ /dev/null @@ -1,346 +0,0 @@ -Subject: driver core: move stuff out of device into a private structure - ---- - drivers/base/base.h | 8 ++++++++ - drivers/base/bus.c | 29 ++++++++++++++++++++++------- - drivers/base/core.c | 43 ++++++++++++++++++++++++++++++------------- - drivers/base/dd.c | 13 ++++++++----- - drivers/base/driver.c | 13 ++++++++++--- - include/linux/device.h | 7 +++---- - 6 files changed, 81 insertions(+), 32 deletions(-) - ---- a/drivers/base/base.h -+++ b/drivers/base/base.h -@@ -36,6 +36,14 @@ struct driver_private { - }; - #define to_driver(obj) container_of(obj, struct driver_private, kobj) - -+struct device_private { -+ struct klist klist_children; -+ struct klist_node knode_parent; /* node in sibling list */ -+ struct klist_node knode_driver; -+ struct klist_node knode_bus; -+ struct device *device; -+}; -+ - /* initialisation functions */ - extern int devices_init(void); - extern int buses_init(void); ---- a/drivers/base/bus.c -+++ b/drivers/base/bus.c -@@ -253,9 +253,17 @@ static ssize_t store_drivers_probe(struc - static struct device *next_device(struct klist_iter *i) - { - struct klist_node *n = klist_next(i); -- return n ? container_of(n, struct device, knode_bus) : NULL; -+ struct device_private *dev_prv; -+ struct device *dev = NULL; -+ -+ if (n) { -+ dev_prv = container_of(n, struct device_private, knode_bus); -+ dev = dev_prv->device; -+ } -+ return dev; - } - -+ - /** - * bus_for_each_dev - device iterator. - * @bus: bus type. -@@ -286,7 +294,7 @@ int bus_for_each_dev(struct bus_type *bu - return -EINVAL; - - klist_iter_init_node(&bus->p->klist_devices, &i, -- (start ? &start->knode_bus : NULL)); -+ (start ? &start->p->knode_bus : NULL)); - while ((dev = next_device(&i)) && !error) - error = fn(dev, data); - klist_iter_exit(&i); -@@ -320,7 +328,7 @@ struct device *bus_find_device(struct bu - return NULL; - - klist_iter_init_node(&bus->p->klist_devices, &i, -- (start ? &start->knode_bus : NULL)); -+ (start ? &start->p->knode_bus : NULL)); - while ((dev = next_device(&i))) - if (match(dev, data) && get_device(dev)) - break; -@@ -510,7 +518,8 @@ void bus_attach_device(struct device *de - ret = device_attach(dev); - WARN_ON(ret < 0); - if (ret >= 0) -- klist_add_tail(&dev->knode_bus, &bus->p->klist_devices); -+ klist_add_tail(&dev->p->knode_bus, -+ &bus->p->klist_devices); - else - dev->is_registered = 0; - } -@@ -535,7 +544,7 @@ void bus_remove_device(struct device *de - device_remove_attrs(dev->bus, dev); - if (dev->is_registered) { - dev->is_registered = 0; -- klist_del(&dev->knode_bus); -+ klist_del(&dev->p->knode_bus); - } - pr_debug("bus: '%s': remove device %s\n", - dev->bus->name, dev->bus_id); -@@ -836,15 +845,21 @@ static void bus_remove_attrs(struct bus_ - - static void klist_devices_get(struct klist_node *n) - { -- struct device *dev = container_of(n, struct device, knode_bus); -+ struct device_private *dev_prv; -+ struct device *dev; - -+ dev_prv = container_of(n, struct device_private, knode_bus); -+ dev = dev_prv->device; - get_device(dev); - } - - static void klist_devices_put(struct klist_node *n) - { -- struct device *dev = container_of(n, struct device, knode_bus); -+ struct device_private *dev_prv; -+ struct device *dev; - -+ dev_prv = container_of(n, struct device_private, knode_bus); -+ dev = dev_prv->device; - put_device(dev); - } - ---- a/drivers/base/core.c -+++ b/drivers/base/core.c -@@ -501,15 +501,21 @@ EXPORT_SYMBOL_GPL(device_schedule_callba - - static void klist_children_get(struct klist_node *n) - { -- struct device *dev = container_of(n, struct device, knode_parent); -+ struct device_private *dev_prv; -+ struct device *dev; - -+ dev_prv = container_of(n, struct device_private, knode_parent); -+ dev = dev_prv->device; - get_device(dev); - } - - static void klist_children_put(struct klist_node *n) - { -- struct device *dev = container_of(n, struct device, knode_parent); -+ struct device_private *dev_prv; -+ struct device *dev; - -+ dev_prv = container_of(n, struct device_private, knode_parent); -+ dev = dev_prv->device; - put_device(dev); - } - -@@ -527,7 +533,7 @@ void device_initialize(struct device *de - { - dev->kobj.kset = devices_kset; - kobject_init(&dev->kobj, &device_ktype); -- klist_init(&dev->klist_children, klist_children_get, -+ klist_init(&dev->p->klist_children, klist_children_get, - klist_children_put); - INIT_LIST_HEAD(&dev->dma_pools); - INIT_LIST_HEAD(&dev->node); -@@ -829,7 +835,8 @@ int device_add(struct device *dev) - kobject_uevent(&dev->kobj, KOBJ_ADD); - bus_attach_device(dev); - if (parent) -- klist_add_tail(&dev->knode_parent, &parent->klist_children); -+ klist_add_tail(&dev->p->knode_parent, -+ &parent->p->klist_children); - - if (dev->class) { - down(&dev->class->sem); -@@ -932,7 +939,7 @@ void device_del(struct device *dev) - - device_pm_remove(dev); - if (parent) -- klist_del(&dev->knode_parent); -+ klist_del(&dev->p->knode_parent); - if (MAJOR(dev->devt)) - device_remove_file(dev, &devt_attr); - if (dev->class) { -@@ -993,7 +1000,14 @@ void device_unregister(struct device *de - static struct device *next_device(struct klist_iter *i) - { - struct klist_node *n = klist_next(i); -- return n ? container_of(n, struct device, knode_parent) : NULL; -+ struct device_private *dev_prv; -+ struct device *dev = NULL; -+ -+ if (n) { -+ dev_prv = container_of(n, struct device_private, knode_parent); -+ dev = dev_prv->device; -+ } -+ return dev; - } - - /** -@@ -1015,7 +1029,7 @@ int device_for_each_child(struct device - struct device *child; - int error = 0; - -- klist_iter_init(&parent->klist_children, &i); -+ klist_iter_init(&parent->p->klist_children, &i); - while ((child = next_device(&i)) && !error) - error = fn(child, data); - klist_iter_exit(&i); -@@ -1046,7 +1060,7 @@ struct device *device_find_child(struct - if (!parent) - return NULL; - -- klist_iter_init(&parent->klist_children, &i); -+ klist_iter_init(&parent->p->klist_children, &i); - while ((child = next_device(&i))) - if (match(child, data) && get_device(child)) - break; -@@ -1320,6 +1334,7 @@ int device_move(struct device *dev, stru - int error; - struct device *old_parent; - struct kobject *new_parent_kobj; -+ struct device_private *dev_prv; - - dev = get_device(dev); - if (!dev) -@@ -1338,10 +1353,12 @@ int device_move(struct device *dev, stru - } - old_parent = dev->parent; - dev->parent = new_parent; -+ dev_prv = dev->p; - if (old_parent) -- klist_remove(&dev->knode_parent); -+ klist_remove(&dev_prv->knode_parent); - if (new_parent) -- klist_add_tail(&dev->knode_parent, &new_parent->klist_children); -+ klist_add_tail(&dev_prv->knode_parent, -+ &new_parent->p->klist_children); - if (!dev->class) - goto out_put; - error = device_move_class_links(dev, old_parent, new_parent); -@@ -1350,10 +1367,10 @@ int device_move(struct device *dev, stru - device_move_class_links(dev, new_parent, old_parent); - if (!kobject_move(&dev->kobj, &old_parent->kobj)) { - if (new_parent) -- klist_remove(&dev->knode_parent); -+ klist_remove(&dev_prv->knode_parent); - if (old_parent) -- klist_add_tail(&dev->knode_parent, -- &old_parent->klist_children); -+ klist_add_tail(&dev_prv->knode_parent, -+ &old_parent->p->klist_children); - } - cleanup_glue_dir(dev, new_parent_kobj); - put_device(new_parent); ---- a/drivers/base/dd.c -+++ b/drivers/base/dd.c -@@ -28,7 +28,7 @@ - - static void driver_bound(struct device *dev) - { -- if (klist_node_attached(&dev->knode_driver)) { -+ if (klist_node_attached(&dev->p->knode_driver)) { - printk(KERN_WARNING "%s: device %s already bound\n", - __FUNCTION__, kobject_name(&dev->kobj)); - return; -@@ -41,7 +41,7 @@ static void driver_bound(struct device * - blocking_notifier_call_chain(&dev->bus->p->bus_notifier, - BUS_NOTIFY_BOUND_DRIVER, dev); - -- klist_add_tail(&dev->knode_driver, &dev->driver->p->klist_devices); -+ klist_add_tail(&dev->p->knode_driver, &dev->driver->p->klist_devices); - } - - static int driver_sysfs_add(struct device *dev) -@@ -308,7 +308,7 @@ static void __device_release_driver(stru - drv->remove(dev); - devres_release_all(dev); - dev->driver = NULL; -- klist_remove(&dev->knode_driver); -+ klist_remove(&dev->p->knode_driver); - } - } - -@@ -338,6 +338,7 @@ EXPORT_SYMBOL_GPL(device_release_driver) - */ - void driver_detach(struct device_driver *drv) - { -+ struct device_private *dev_prv; - struct device *dev; - - for (;;) { -@@ -346,8 +347,10 @@ void driver_detach(struct device_driver - spin_unlock(&drv->p->klist_devices.k_lock); - break; - } -- dev = list_entry(drv->p->klist_devices.k_list.prev, -- struct device, knode_driver.n_node); -+ dev_prv = list_entry(drv->p->klist_devices.k_list.prev, -+ struct device_private, -+ knode_driver.n_node); -+ dev = dev_prv->device; - get_device(dev); - spin_unlock(&drv->p->klist_devices.k_lock); - ---- a/drivers/base/driver.c -+++ b/drivers/base/driver.c -@@ -22,7 +22,14 @@ - static struct device *next_device(struct klist_iter *i) - { - struct klist_node *n = klist_next(i); -- return n ? container_of(n, struct device, knode_driver) : NULL; -+ struct device_private *dev_prv; -+ struct device *dev = NULL; -+ -+ if (n) { -+ dev_prv = container_of(n, struct device_private, knode_driver); -+ dev = dev_prv->device; -+ } -+ return dev; - } - - /** -@@ -45,7 +52,7 @@ int driver_for_each_device(struct device - return -EINVAL; - - klist_iter_init_node(&drv->p->klist_devices, &i, -- start ? &start->knode_driver : NULL); -+ start ? &start->p->knode_driver : NULL); - while ((dev = next_device(&i)) && !error) - error = fn(dev, data); - klist_iter_exit(&i); -@@ -79,7 +86,7 @@ struct device *driver_find_device(struct - return NULL; - - klist_iter_init_node(&drv->p->klist_devices, &i, -- (start ? &start->knode_driver : NULL)); -+ (start ? &start->p->knode_driver : NULL)); - while ((dev = next_device(&i))) - if (match(dev, data) && get_device(dev)) - break; ---- a/include/linux/device.h -+++ b/include/linux/device.h -@@ -32,6 +32,7 @@ - - - struct device; -+struct device_private; - struct device_driver; - struct driver_private; - struct class; -@@ -420,12 +421,10 @@ struct device_dma_parameters { - }; - - struct device { -- struct klist klist_children; -- struct klist_node knode_parent; /* node in sibling list */ -- struct klist_node knode_driver; -- struct klist_node knode_bus; - struct device *parent; - -+ struct device_private *p; -+ - struct kobject kobj; - char bus_id[BUS_ID_SIZE]; /* position on parent bus */ - struct device_type *type; diff --git a/pending/driver-core-use-dev_get_drvdata-accessors.patch b/pending/driver-core-use-dev_get_drvdata-accessors.patch deleted file mode 100644 index 88471e5b81057d..00000000000000 --- a/pending/driver-core-use-dev_get_drvdata-accessors.patch +++ /dev/null @@ -1,1992 +0,0 @@ -From kernel-bounces+gregkh=suse.de@suse.de Thu Sep 11 01:54:40 2008 -From: Hannes Reinecke <hare@suse.de> -Date: Wed, 10 Sep 2008 14:16:04 +0200 -Subject: Driver core: Use dev_get_drvdata() accessors -To: kernel@suse.de -Message-ID: <20080910121604.E47B318C734@pentland.suse.de> - -Deprecated direct access to the ->driver_data field and -use accessors throughout. - -Signed-off-by: Hannes Reinecke <hare@suse.de> -Cc: Kay Sievers <kay.sievers@vrfy.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - drivers/block/xen-blkfront.c | 14 ++++---- - drivers/eisa/pci_eisa.c | 2 - - drivers/eisa/virtual_root.c | 2 - - drivers/ide/legacy/ide_platform.c | 2 - - drivers/input/xen-kbdfront.c | 8 ++-- - drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 22 ++++++------- - drivers/mfd/htc-pasic3.c | 8 ++-- - drivers/net/3c509.c | 42 +++++++++++++++++-------- - drivers/net/depca.c | 17 +++++++--- - drivers/net/hp100.c | 4 +- - drivers/net/ne3210.c | 4 +- - drivers/net/tulip/de4x5.c | 7 ++-- - drivers/net/wireless/atmel_cs.c | 2 - - drivers/net/wireless/ipw2100.c | 8 ++-- - drivers/net/wireless/ipw2200.c | 46 +++++++++++++-------------- - drivers/net/wireless/iwlwifi/iwl3945-base.c | 22 ++++++------- - drivers/net/xen-netfront.c | 10 ++--- - drivers/pcmcia/ds.c | 8 ++-- - drivers/s390/block/dasd_devmap.c | 6 +-- - drivers/s390/char/con3215.c | 16 ++++----- - drivers/s390/char/raw3270.c | 16 ++++----- - drivers/s390/char/tape_34xx.c | 4 +- - drivers/s390/char/tape_core.c | 20 +++++------ - drivers/s390/char/vmlogrdr.c | 12 +++---- - drivers/s390/char/vmur.c | 10 ++--- - drivers/s390/net/claw.c | 40 +++++++++++------------ - drivers/s390/net/lcs.c | 23 +++++++------ - drivers/s390/net/netiucv.c | 47 ++++++++++++++-------------- - drivers/scsi/aha1740.c | 3 + - drivers/scsi/ibmvscsi/ibmvstgt.c | 2 - - drivers/scsi/libsrp.c | 2 - - drivers/thermal/thermal_sys.c | 4 +- - drivers/video/xen-fbfront.c | 8 ++-- - include/linux/eisa.h | 4 +- - 34 files changed, 236 insertions(+), 209 deletions(-) - ---- a/drivers/block/xen-blkfront.c -+++ b/drivers/block/xen-blkfront.c -@@ -756,12 +756,12 @@ static int blkfront_probe(struct xenbus_ - - /* Front end dir is a number, which is used as the id. */ - info->handle = simple_strtoul(strrchr(dev->nodename, '/')+1, NULL, 0); -- dev->dev.driver_data = info; -+ dev_set_drvdata(&dev->dev, info); - - err = talk_to_backend(dev, info); - if (err) { - kfree(info); -- dev->dev.driver_data = NULL; -+ dev_set_drvdata(&dev->dev, NULL); - return err; - } - -@@ -846,7 +846,7 @@ static int blkif_recover(struct blkfront - */ - static int blkfront_resume(struct xenbus_device *dev) - { -- struct blkfront_info *info = dev->dev.driver_data; -+ struct blkfront_info *info = dev_get_drvdata(&dev->dev); - int err; - - dev_dbg(&dev->dev, "blkfront_resume: %s\n", dev->nodename); -@@ -925,7 +925,7 @@ static void blkfront_connect(struct blkf - */ - static void blkfront_closing(struct xenbus_device *dev) - { -- struct blkfront_info *info = dev->dev.driver_data; -+ struct blkfront_info *info = dev_get_drvdata(&dev->dev); - unsigned long flags; - - dev_dbg(&dev->dev, "blkfront_closing: %s removed\n", dev->nodename); -@@ -960,7 +960,7 @@ static void blkfront_closing(struct xenb - static void backend_changed(struct xenbus_device *dev, - enum xenbus_state backend_state) - { -- struct blkfront_info *info = dev->dev.driver_data; -+ struct blkfront_info *info = dev_get_drvdata(&dev->dev); - struct block_device *bd; - - dev_dbg(&dev->dev, "blkfront:backend_changed.\n"); -@@ -996,7 +996,7 @@ static void backend_changed(struct xenbu - - static int blkfront_remove(struct xenbus_device *dev) - { -- struct blkfront_info *info = dev->dev.driver_data; -+ struct blkfront_info *info = dev_get_drvdata(&dev->dev); - - dev_dbg(&dev->dev, "blkfront_remove: %s removed\n", dev->nodename); - -@@ -1009,7 +1009,7 @@ static int blkfront_remove(struct xenbus - - static int blkfront_is_ready(struct xenbus_device *dev) - { -- struct blkfront_info *info = dev->dev.driver_data; -+ struct blkfront_info *info = dev_get_drvdata(&dev->dev); - - return info->is_ready; - } ---- a/drivers/eisa/pci_eisa.c -+++ b/drivers/eisa/pci_eisa.c -@@ -31,11 +31,11 @@ static int __init pci_eisa_init(struct p - } - - pci_eisa_root.dev = &pdev->dev; -- pci_eisa_root.dev->driver_data = &pci_eisa_root; - pci_eisa_root.res = pdev->bus->resource[0]; - pci_eisa_root.bus_base_addr = pdev->bus->resource[0]->start; - pci_eisa_root.slots = EISA_MAX_SLOTS; - pci_eisa_root.dma_mask = pdev->dma_mask; -+ dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root); - - if (eisa_root_register (&pci_eisa_root)) { - printk (KERN_ERR "pci_eisa : Could not register EISA root\n"); ---- a/drivers/eisa/virtual_root.c -+++ b/drivers/eisa/virtual_root.c -@@ -57,7 +57,7 @@ static int __init virtual_eisa_root_init - - eisa_bus_root.force_probe = force_probe; - -- eisa_root_dev.dev.driver_data = &eisa_bus_root; -+ platform_set_drvdata(&eisa_root_dev, &eisa_bus_root); - - if (eisa_root_register (&eisa_bus_root)) { - /* A real bridge may have been registered before ---- a/drivers/ide/legacy/ide_platform.c -+++ b/drivers/ide/legacy/ide_platform.c -@@ -113,7 +113,7 @@ out: - - static int __devexit plat_ide_remove(struct platform_device *pdev) - { -- struct ide_host *host = pdev->dev.driver_data; -+ struct ide_host *host = platform_get_drvdata(pdev); - - ide_host_remove(host); - ---- a/drivers/input/xen-kbdfront.c -+++ b/drivers/input/xen-kbdfront.c -@@ -114,7 +114,7 @@ static int __devinit xenkbd_probe(struct - xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); - return -ENOMEM; - } -- dev->dev.driver_data = info; -+ dev_set_drvdata(&dev->dev, info); - info->xbdev = dev; - info->irq = -1; - snprintf(info->phys, sizeof(info->phys), "xenbus/%s", dev->nodename); -@@ -186,7 +186,7 @@ static int __devinit xenkbd_probe(struct - - static int xenkbd_resume(struct xenbus_device *dev) - { -- struct xenkbd_info *info = dev->dev.driver_data; -+ struct xenkbd_info *info = dev_get_drvdata(&dev->dev); - - xenkbd_disconnect_backend(info); - memset(info->page, 0, PAGE_SIZE); -@@ -195,7 +195,7 @@ static int xenkbd_resume(struct xenbus_d - - static int xenkbd_remove(struct xenbus_device *dev) - { -- struct xenkbd_info *info = dev->dev.driver_data; -+ struct xenkbd_info *info = dev_get_drvdata(&dev->dev); - - xenkbd_disconnect_backend(info); - if (info->kbd) -@@ -266,7 +266,7 @@ static void xenkbd_disconnect_backend(st - static void xenkbd_backend_changed(struct xenbus_device *dev, - enum xenbus_state backend_state) - { -- struct xenkbd_info *info = dev->dev.driver_data; -+ struct xenkbd_info *info = dev_get_drvdata(&dev->dev); - int ret, val; - - switch (backend_state) { ---- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c -+++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c -@@ -537,7 +537,7 @@ static void class_dev_destroy(struct pvr - &sfp->attr_unit_number); - } - pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev); -- sfp->class_dev->driver_data = NULL; -+ dev_set_drvdata(sfp->class_dev, NULL); - device_unregister(sfp->class_dev); - sfp->class_dev = NULL; - } -@@ -547,7 +547,7 @@ static ssize_t v4l_minor_number_show(str - struct device_attribute *attr, char *buf) - { - struct pvr2_sysfs *sfp; -- sfp = (struct pvr2_sysfs *)class_dev->driver_data; -+ sfp = dev_get_drvdata(class_dev); - if (!sfp) return -EINVAL; - return scnprintf(buf,PAGE_SIZE,"%d\n", - pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw, -@@ -559,7 +559,7 @@ static ssize_t bus_info_show(struct devi - struct device_attribute *attr, char *buf) - { - struct pvr2_sysfs *sfp; -- sfp = (struct pvr2_sysfs *)class_dev->driver_data; -+ sfp = dev_get_drvdata(class_dev); - if (!sfp) return -EINVAL; - return scnprintf(buf,PAGE_SIZE,"%s\n", - pvr2_hdw_get_bus_info(sfp->channel.hdw)); -@@ -570,7 +570,7 @@ static ssize_t hdw_name_show(struct devi - struct device_attribute *attr, char *buf) - { - struct pvr2_sysfs *sfp; -- sfp = (struct pvr2_sysfs *)class_dev->driver_data; -+ sfp = dev_get_drvdata(class_dev); - if (!sfp) return -EINVAL; - return scnprintf(buf,PAGE_SIZE,"%s\n", - pvr2_hdw_get_type(sfp->channel.hdw)); -@@ -581,7 +581,7 @@ static ssize_t hdw_desc_show(struct devi - struct device_attribute *attr, char *buf) - { - struct pvr2_sysfs *sfp; -- sfp = (struct pvr2_sysfs *)class_dev->driver_data; -+ sfp = dev_get_drvdata(class_dev); - if (!sfp) return -EINVAL; - return scnprintf(buf,PAGE_SIZE,"%s\n", - pvr2_hdw_get_desc(sfp->channel.hdw)); -@@ -593,7 +593,7 @@ static ssize_t v4l_radio_minor_number_sh - char *buf) - { - struct pvr2_sysfs *sfp; -- sfp = (struct pvr2_sysfs *)class_dev->driver_data; -+ sfp = dev_get_drvdata(class_dev); - if (!sfp) return -EINVAL; - return scnprintf(buf,PAGE_SIZE,"%d\n", - pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw, -@@ -605,7 +605,7 @@ static ssize_t unit_number_show(struct d - struct device_attribute *attr, char *buf) - { - struct pvr2_sysfs *sfp; -- sfp = (struct pvr2_sysfs *)class_dev->driver_data; -+ sfp = dev_get_drvdata(class_dev); - if (!sfp) return -EINVAL; - return scnprintf(buf,PAGE_SIZE,"%d\n", - pvr2_hdw_get_unit_number(sfp->channel.hdw)); -@@ -641,7 +641,7 @@ static void class_dev_create(struct pvr2 - class_dev->parent = &usb_dev->dev; - - sfp->class_dev = class_dev; -- class_dev->driver_data = sfp; -+ dev_set_drvdata(class_dev,sfp); - ret = device_register(class_dev); - if (ret) { - pvr2_trace(PVR2_TRACE_ERROR_LEGS, -@@ -798,7 +798,7 @@ static ssize_t debuginfo_show(struct dev - struct device_attribute *attr, char *buf) - { - struct pvr2_sysfs *sfp; -- sfp = (struct pvr2_sysfs *)class_dev->driver_data; -+ sfp = dev_get_drvdata(class_dev); - if (!sfp) return -EINVAL; - pvr2_hdw_trigger_module_log(sfp->channel.hdw); - return pvr2_debugifc_print_info(sfp->channel.hdw,buf,PAGE_SIZE); -@@ -809,7 +809,7 @@ static ssize_t debugcmd_show(struct devi - struct device_attribute *attr, char *buf) - { - struct pvr2_sysfs *sfp; -- sfp = (struct pvr2_sysfs *)class_dev->driver_data; -+ sfp = dev_get_drvdata(class_dev); - if (!sfp) return -EINVAL; - return pvr2_debugifc_print_status(sfp->channel.hdw,buf,PAGE_SIZE); - } -@@ -822,7 +822,7 @@ static ssize_t debugcmd_store(struct dev - struct pvr2_sysfs *sfp; - int ret; - -- sfp = (struct pvr2_sysfs *)class_dev->driver_data; -+ sfp = dev_get_drvdata(class_dev); - if (!sfp) return -EINVAL; - - ret = pvr2_debugifc_docmd(sfp->channel.hdw,buf,count); ---- a/drivers/mfd/htc-pasic3.c -+++ b/drivers/mfd/htc-pasic3.c -@@ -36,7 +36,7 @@ struct pasic3_data { - */ - void pasic3_write_register(struct device *dev, u32 reg, u8 val) - { -- struct pasic3_data *asic = dev->driver_data; -+ struct pasic3_data *asic = dev_get_drvdata(dev); - int bus_shift = asic->bus_shift; - void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift); - void __iomem *data = asic->mapping + (REG_DATA << bus_shift); -@@ -51,7 +51,7 @@ EXPORT_SYMBOL(pasic3_write_register); /* - */ - u8 pasic3_read_register(struct device *dev, u32 reg) - { -- struct pasic3_data *asic = dev->driver_data; -+ struct pasic3_data *asic = dev_get_drvdata(dev); - int bus_shift = asic->bus_shift; - void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift); - void __iomem *data = asic->mapping + (REG_DATA << bus_shift); -@@ -68,7 +68,7 @@ EXPORT_SYMBOL(pasic3_read_register); /* - static int led_device_add(struct device *pasic3_dev, - const struct pasic3_leds_machinfo *pdata) - { -- struct pasic3_data *asic = pasic3_dev->driver_data; -+ struct pasic3_data *asic = dev_get_drvdata(pasic3_dev); - struct platform_device *pdev; - int ret; - -@@ -135,7 +135,7 @@ static struct ds1wm_platform_data ds1wm_ - static int ds1wm_device_add(struct platform_device *pasic3_pdev, int bus_shift) - { - struct device *pasic3_dev = &pasic3_pdev->dev; -- struct pasic3_data *asic = pasic3_dev->driver_data; -+ struct pasic3_data *asic = dev_get_drvdata(pasic3_dev); - struct platform_device *pdev; - int ret; - ---- a/drivers/net/3c509.c -+++ b/drivers/net/3c509.c -@@ -188,6 +188,8 @@ static int nopnp; - - static int __init el3_common_init(struct net_device *dev); - static void el3_common_remove(struct net_device *dev); -+static int el3_common_suspend(struct net_device *dev); -+static int el3_common_resume(struct net_device *dev); - static ushort id_read_eeprom(int index); - static ushort read_eeprom(int ioaddr, int index); - static int el3_open(struct net_device *dev); -@@ -346,7 +348,7 @@ static int __devinit el3_isa_match(struc - static int __devexit el3_isa_remove(struct device *pdev, - unsigned int ndev) - { -- el3_device_remove(pdev); -+ el3_common_remove(dev_get_drvdata(pdev)); - dev_set_drvdata(pdev, NULL); - return 0; - } -@@ -356,7 +358,7 @@ static int el3_isa_suspend(struct device - pm_message_t state) - { - current_tag = 0; -- return el3_suspend(dev, state); -+ return el3_common_suspend(dev_get_drvdata(dev)); - } - - static int el3_isa_resume(struct device *dev, unsigned int n) -@@ -378,7 +380,7 @@ static int el3_isa_resume(struct device - return 1; - /* Free the interrupt so that some other card can use it. */ - outw(0x0f00, ioaddr + WN0_IRQ); -- return el3_resume(dev); -+ return el3_common_resume(ndev); - } - #endif - -@@ -456,12 +458,12 @@ static void __devexit el3_pnp_remove(str - #ifdef CONFIG_PM - static int el3_pnp_suspend(struct pnp_dev *pdev, pm_message_t state) - { -- return el3_suspend(&pdev->dev, state); -+ return el3_common_suspend(pnp_get_drvdata(pdev)); - } - - static int el3_pnp_resume(struct pnp_dev *pdev) - { -- return el3_resume(&pdev->dev); -+ return el3_common_resume(pnp_get_drvdata(pdev)); - } - #endif - -@@ -647,11 +649,11 @@ static int __init el3_mca_probe(struct d - netdev_boot_setup_check(dev); - - el3_dev_fill(dev, phys_addr, ioaddr, irq, if_port, EL3_MCA); -- device->driver_data = dev; -+ dev_set_drvdata(device, dev); - err = el3_common_init(dev); - - if (err) { -- device->driver_data = NULL; -+ dev_set_drvdata(device, NULL); - free_netdev(dev); - return -ENOMEM; - } -@@ -1439,14 +1441,12 @@ el3_up(struct net_device *dev) - #ifdef CONFIG_PM - - static int --el3_suspend(struct device *pdev, pm_message_t state) -+el3_common_suspend(struct net_device *dev) - { - unsigned long flags; -- struct net_device *dev; - struct el3_private *lp; - int ioaddr; - -- dev = pdev->driver_data; - lp = netdev_priv(dev); - ioaddr = dev->base_addr; - -@@ -1463,14 +1463,21 @@ el3_suspend(struct device *pdev, pm_mess - } - - static int --el3_resume(struct device *pdev) -+el3_suspend(struct device *pdev, pm_message_t state) - { -- unsigned long flags; - struct net_device *dev; -+ -+ dev = dev_get_drvdata(pdev); -+ return el3_common_suspend(dev); -+} -+ -+static int -+el3_common_resume(struct net_device *dev) -+{ -+ unsigned long flags; - struct el3_private *lp; - int ioaddr; - -- dev = pdev->driver_data; - lp = netdev_priv(dev); - ioaddr = dev->base_addr; - -@@ -1486,6 +1493,15 @@ el3_resume(struct device *pdev) - return 0; - } - -+static int -+el3_resume(struct device *pdev) -+{ -+ struct net_device *dev; -+ -+ dev = dev_get_drvdata(pdev); -+ return el3_common_resume(dev); -+} -+ - #endif /* CONFIG_PM */ - - module_param(debug,int, 0); ---- a/drivers/net/depca.c -+++ b/drivers/net/depca.c -@@ -398,10 +398,11 @@ static struct mca_driver depca_mca_drive - #endif - - static int depca_isa_probe (struct platform_device *); -+static int depca_common_remove(struct net_device *dev); - - static int __devexit depca_isa_remove(struct platform_device *pdev) - { -- return depca_device_remove(&pdev->dev); -+ return depca_common_remove(dev_get_drvdata(&pdev->dev)); - } - - static struct platform_driver depca_isa_driver = { -@@ -804,7 +805,7 @@ static int __init depca_hw_init (struct - - dev->mem_start = 0; - -- device->driver_data = dev; -+ dev_set_drvdata(device, dev); - SET_NETDEV_DEV (dev, device); - - status = register_netdev(dev); -@@ -1598,13 +1599,11 @@ static int __init depca_eisa_probe (stru - } - #endif - --static int __devexit depca_device_remove (struct device *device) -+static int __devexit depca_common_remove (struct net_device *dev) - { -- struct net_device *dev; - struct depca_private *lp; - int bus; - -- dev = device->driver_data; - lp = dev->priv; - - unregister_netdev (dev); -@@ -1617,6 +1616,14 @@ static int __devexit depca_device_remove - return 0; - } - -+static int __devexit depca_device_remove (struct device *device) -+{ -+ struct net_device *dev; -+ -+ dev = dev_get_drvdata(device); -+ return depca_common_remove(dev); -+} -+ - /* - ** Look for a particular board name in the on-board Remote Diagnostics - ** and Boot (readb) ROM. This will also give us a clue to the network RAM ---- a/drivers/net/hp100.c -+++ b/drivers/net/hp100.c -@@ -2851,7 +2851,7 @@ static int __init hp100_eisa_probe (stru - printk("hp100: %s: EISA adapter found at 0x%x\n", dev->name, - dev->base_addr); - #endif -- gendev->driver_data = dev; -+ dev_set_drvdata(gendev, dev); - return 0; - out1: - free_netdev(dev); -@@ -2860,7 +2860,7 @@ static int __init hp100_eisa_probe (stru - - static int __devexit hp100_eisa_remove (struct device *gendev) - { -- struct net_device *dev = gendev->driver_data; -+ struct net_device *dev = dev_get_drvdata(gendev); - cleanup_dev(dev); - return 0; - } ---- a/drivers/net/ne3210.c -+++ b/drivers/net/ne3210.c -@@ -108,7 +108,7 @@ static int __init ne3210_eisa_probe (str - } - - SET_NETDEV_DEV(dev, device); -- device->driver_data = dev; -+ dev_set_drvdata(device, dev); - ioaddr = edev->base_addr; - - if (!request_region(ioaddr, NE3210_IO_EXTENT, DRV_NAME)) { -@@ -231,7 +231,7 @@ static int __init ne3210_eisa_probe (str - - static int __devexit ne3210_eisa_remove (struct device *device) - { -- struct net_device *dev = device->driver_data; -+ struct net_device *dev = dev_get_drvdata(device); - unsigned long ioaddr = to_eisa_device (device)->base_addr; - - unregister_netdev (dev); ---- a/drivers/net/tulip/de4x5.c -+++ b/drivers/net/tulip/de4x5.c -@@ -1087,7 +1087,7 @@ de4x5_hw_init(struct net_device *dev, u_ - int i, status=0; - DECLARE_MAC_BUF(mac); - -- gendev->driver_data = dev; -+ dev_set_drvdata(gendev, dev); - - /* Ensure we're not sleeping */ - if (lp->bus == EISA) { -@@ -2089,13 +2089,14 @@ static int __devexit de4x5_eisa_remove ( - struct net_device *dev; - u_long iobase; - -- dev = device->driver_data; -+ dev = dev_get_drvdata(device); - iobase = dev->base_addr; - - unregister_netdev (dev); - free_netdev (dev); - release_region (iobase + DE4X5_EISA_IO_PORTS, DE4X5_EISA_TOTAL_SIZE); - release_region (iobase, DE4X5_EISA_TOTAL_SIZE); -+ dev_set_drvdata(device, NULL); - - return 0; - } -@@ -2333,7 +2334,7 @@ static void __devexit de4x5_pci_remove ( - struct net_device *dev; - u_long iobase; - -- dev = pdev->dev.driver_data; -+ dev = dev_get_drvdata(&pdev->dev); - iobase = dev->base_addr; - - unregister_netdev (dev); ---- a/drivers/net/wireless/atmel_cs.c -+++ b/drivers/net/wireless/atmel_cs.c -@@ -279,7 +279,7 @@ static int atmel_config(struct pcmcia_de - struct pcmcia_device_id *did; - - dev = link->priv; -- did = handle_to_dev(link).driver_data; -+ did = dev_get_drvdata(&handle_to_dev(link)); - - DEBUG(0, "atmel_config(0x%p)\n", link); - ---- a/drivers/net/wireless/ipw2100.c -+++ b/drivers/net/wireless/ipw2100.c -@@ -3477,7 +3477,7 @@ static DEVICE_ATTR(pci, S_IRUGO, show_pc - static ssize_t show_cfg(struct device *d, struct device_attribute *attr, - char *buf) - { -- struct ipw2100_priv *p = d->driver_data; -+ struct ipw2100_priv *p = dev_get_drvdata(d); - return sprintf(buf, "0x%08x\n", (int)p->config); - } - -@@ -3486,7 +3486,7 @@ static DEVICE_ATTR(cfg, S_IRUGO, show_cf - static ssize_t show_status(struct device *d, struct device_attribute *attr, - char *buf) - { -- struct ipw2100_priv *p = d->driver_data; -+ struct ipw2100_priv *p = dev_get_drvdata(d); - return sprintf(buf, "0x%08x\n", (int)p->status); - } - -@@ -3495,7 +3495,7 @@ static DEVICE_ATTR(status, S_IRUGO, show - static ssize_t show_capability(struct device *d, struct device_attribute *attr, - char *buf) - { -- struct ipw2100_priv *p = d->driver_data; -+ struct ipw2100_priv *p = dev_get_drvdata(d); - return sprintf(buf, "0x%08x\n", (int)p->capability); - } - -@@ -4214,7 +4214,7 @@ static ssize_t show_rf_kill(struct devic - 1 - SW based RF kill active (sysfs) - 2 - HW based RF kill active - 3 - Both HW and SW baed RF kill active */ -- struct ipw2100_priv *priv = (struct ipw2100_priv *)d->driver_data; -+ struct ipw2100_priv *priv = dev_get_drvdata(d); - int val = ((priv->status & STATUS_RF_KILL_SW) ? 0x1 : 0x0) | - (rf_kill_active(priv) ? 0x2 : 0x0); - return sprintf(buf, "%i\n", val); ---- a/drivers/net/wireless/ipw2200.c -+++ b/drivers/net/wireless/ipw2200.c -@@ -1513,7 +1513,7 @@ static DEVICE_ATTR(led, S_IWUSR | S_IRUG - static ssize_t show_status(struct device *d, - struct device_attribute *attr, char *buf) - { -- struct ipw_priv *p = d->driver_data; -+ struct ipw_priv *p = dev_get_drvdata(d); - return sprintf(buf, "0x%08x\n", (int)p->status); - } - -@@ -1522,7 +1522,7 @@ static DEVICE_ATTR(status, S_IRUGO, show - static ssize_t show_cfg(struct device *d, struct device_attribute *attr, - char *buf) - { -- struct ipw_priv *p = d->driver_data; -+ struct ipw_priv *p = dev_get_drvdata(d); - return sprintf(buf, "0x%08x\n", (int)p->config); - } - -@@ -1531,7 +1531,7 @@ static DEVICE_ATTR(cfg, S_IRUGO, show_cf - static ssize_t show_nic_type(struct device *d, - struct device_attribute *attr, char *buf) - { -- struct ipw_priv *priv = d->driver_data; -+ struct ipw_priv *priv = dev_get_drvdata(d); - return sprintf(buf, "TYPE: %d\n", priv->nic_type); - } - -@@ -1541,7 +1541,7 @@ static ssize_t show_ucode_version(struct - struct device_attribute *attr, char *buf) - { - u32 len = sizeof(u32), tmp = 0; -- struct ipw_priv *p = d->driver_data; -+ struct ipw_priv *p = dev_get_drvdata(d); - - if (ipw_get_ordinal(p, IPW_ORD_STAT_UCODE_VERSION, &tmp, &len)) - return 0; -@@ -1555,7 +1555,7 @@ static ssize_t show_rtc(struct device *d - char *buf) - { - u32 len = sizeof(u32), tmp = 0; -- struct ipw_priv *p = d->driver_data; -+ struct ipw_priv *p = dev_get_drvdata(d); - - if (ipw_get_ordinal(p, IPW_ORD_STAT_RTC, &tmp, &len)) - return 0; -@@ -1572,14 +1572,14 @@ static DEVICE_ATTR(rtc, S_IWUSR | S_IRUG - static ssize_t show_eeprom_delay(struct device *d, - struct device_attribute *attr, char *buf) - { -- int n = ((struct ipw_priv *)d->driver_data)->eeprom_delay; -+ int n = ((struct ipw_priv *)dev_get_drvdata(d))->eeprom_delay; - return sprintf(buf, "%i\n", n); - } - static ssize_t store_eeprom_delay(struct device *d, - struct device_attribute *attr, - const char *buf, size_t count) - { -- struct ipw_priv *p = d->driver_data; -+ struct ipw_priv *p = dev_get_drvdata(d); - sscanf(buf, "%i", &p->eeprom_delay); - return strnlen(buf, count); - } -@@ -1591,7 +1591,7 @@ static ssize_t show_command_event_reg(st - struct device_attribute *attr, char *buf) - { - u32 reg = 0; -- struct ipw_priv *p = d->driver_data; -+ struct ipw_priv *p = dev_get_drvdata(d); - - reg = ipw_read_reg32(p, IPW_INTERNAL_CMD_EVENT); - return sprintf(buf, "0x%08x\n", reg); -@@ -1601,7 +1601,7 @@ static ssize_t store_command_event_reg(s - const char *buf, size_t count) - { - u32 reg; -- struct ipw_priv *p = d->driver_data; -+ struct ipw_priv *p = dev_get_drvdata(d); - - sscanf(buf, "%x", ®); - ipw_write_reg32(p, IPW_INTERNAL_CMD_EVENT, reg); -@@ -1615,7 +1615,7 @@ static ssize_t show_mem_gpio_reg(struct - struct device_attribute *attr, char *buf) - { - u32 reg = 0; -- struct ipw_priv *p = d->driver_data; -+ struct ipw_priv *p = dev_get_drvdata(d); - - reg = ipw_read_reg32(p, 0x301100); - return sprintf(buf, "0x%08x\n", reg); -@@ -1625,7 +1625,7 @@ static ssize_t store_mem_gpio_reg(struct - const char *buf, size_t count) - { - u32 reg; -- struct ipw_priv *p = d->driver_data; -+ struct ipw_priv *p = dev_get_drvdata(d); - - sscanf(buf, "%x", ®); - ipw_write_reg32(p, 0x301100, reg); -@@ -1639,7 +1639,7 @@ static ssize_t show_indirect_dword(struc - struct device_attribute *attr, char *buf) - { - u32 reg = 0; -- struct ipw_priv *priv = d->driver_data; -+ struct ipw_priv *priv = dev_get_drvdata(d); - - if (priv->status & STATUS_INDIRECT_DWORD) - reg = ipw_read_reg32(priv, priv->indirect_dword); -@@ -1652,7 +1652,7 @@ static ssize_t store_indirect_dword(stru - struct device_attribute *attr, - const char *buf, size_t count) - { -- struct ipw_priv *priv = d->driver_data; -+ struct ipw_priv *priv = dev_get_drvdata(d); - - sscanf(buf, "%x", &priv->indirect_dword); - priv->status |= STATUS_INDIRECT_DWORD; -@@ -1666,7 +1666,7 @@ static ssize_t show_indirect_byte(struct - struct device_attribute *attr, char *buf) - { - u8 reg = 0; -- struct ipw_priv *priv = d->driver_data; -+ struct ipw_priv *priv = dev_get_drvdata(d); - - if (priv->status & STATUS_INDIRECT_BYTE) - reg = ipw_read_reg8(priv, priv->indirect_byte); -@@ -1679,7 +1679,7 @@ static ssize_t store_indirect_byte(struc - struct device_attribute *attr, - const char *buf, size_t count) - { -- struct ipw_priv *priv = d->driver_data; -+ struct ipw_priv *priv = dev_get_drvdata(d); - - sscanf(buf, "%x", &priv->indirect_byte); - priv->status |= STATUS_INDIRECT_BYTE; -@@ -1693,7 +1693,7 @@ static ssize_t show_direct_dword(struct - struct device_attribute *attr, char *buf) - { - u32 reg = 0; -- struct ipw_priv *priv = d->driver_data; -+ struct ipw_priv *priv = dev_get_drvdata(d); - - if (priv->status & STATUS_DIRECT_DWORD) - reg = ipw_read32(priv, priv->direct_dword); -@@ -1706,7 +1706,7 @@ static ssize_t store_direct_dword(struct - struct device_attribute *attr, - const char *buf, size_t count) - { -- struct ipw_priv *priv = d->driver_data; -+ struct ipw_priv *priv = dev_get_drvdata(d); - - sscanf(buf, "%x", &priv->direct_dword); - priv->status |= STATUS_DIRECT_DWORD; -@@ -1733,7 +1733,7 @@ static ssize_t show_rf_kill(struct devic - 1 - SW based RF kill active (sysfs) - 2 - HW based RF kill active - 3 - Both HW and SW baed RF kill active */ -- struct ipw_priv *priv = d->driver_data; -+ struct ipw_priv *priv = dev_get_drvdata(d); - int val = ((priv->status & STATUS_RF_KILL_SW) ? 0x1 : 0x0) | - (rf_kill_active(priv) ? 0x2 : 0x0); - return sprintf(buf, "%i\n", val); -@@ -1777,7 +1777,7 @@ static int ipw_radio_kill_sw(struct ipw_ - static ssize_t store_rf_kill(struct device *d, struct device_attribute *attr, - const char *buf, size_t count) - { -- struct ipw_priv *priv = d->driver_data; -+ struct ipw_priv *priv = dev_get_drvdata(d); - - ipw_radio_kill_sw(priv, buf[0] == '1'); - -@@ -1789,7 +1789,7 @@ static DEVICE_ATTR(rf_kill, S_IWUSR | S_ - static ssize_t show_speed_scan(struct device *d, struct device_attribute *attr, - char *buf) - { -- struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; -+ struct ipw_priv *priv = dev_get_drvdata(d); - int pos = 0, len = 0; - if (priv->config & CFG_SPEED_SCAN) { - while (priv->speed_scan[pos] != 0) -@@ -1804,7 +1804,7 @@ static ssize_t show_speed_scan(struct de - static ssize_t store_speed_scan(struct device *d, struct device_attribute *attr, - const char *buf, size_t count) - { -- struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; -+ struct ipw_priv *priv = dev_get_drvdata(d); - int channel, pos = 0; - const char *p = buf; - -@@ -1843,14 +1843,14 @@ static DEVICE_ATTR(speed_scan, S_IWUSR | - static ssize_t show_net_stats(struct device *d, struct device_attribute *attr, - char *buf) - { -- struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; -+ struct ipw_priv *priv = dev_get_drvdata(d); - return sprintf(buf, "%c\n", (priv->config & CFG_NET_STATS) ? '1' : '0'); - } - - static ssize_t store_net_stats(struct device *d, struct device_attribute *attr, - const char *buf, size_t count) - { -- struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; -+ struct ipw_priv *priv = dev_get_drvdata(d); - if (buf[0] == '1') - priv->config |= CFG_NET_STATS; - else ---- a/drivers/net/wireless/iwlwifi/iwl3945-base.c -+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c -@@ -7360,7 +7360,7 @@ static DRIVER_ATTR(debug_level, S_IWUSR - static ssize_t show_temperature(struct device *d, - struct device_attribute *attr, char *buf) - { -- struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; -+ struct iwl3945_priv *priv = dev_get_drvdata(d); - - if (!iwl3945_is_alive(priv)) - return -EAGAIN; -@@ -7373,7 +7373,7 @@ static DEVICE_ATTR(temperature, S_IRUGO, - static ssize_t show_tx_power(struct device *d, - struct device_attribute *attr, char *buf) - { -- struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; -+ struct iwl3945_priv *priv = dev_get_drvdata(d); - return sprintf(buf, "%d\n", priv->user_txpower_limit); - } - -@@ -7381,7 +7381,7 @@ static ssize_t store_tx_power(struct dev - struct device_attribute *attr, - const char *buf, size_t count) - { -- struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; -+ struct iwl3945_priv *priv = dev_get_drvdata(d); - char *p = (char *)buf; - u32 val; - -@@ -7400,7 +7400,7 @@ static DEVICE_ATTR(tx_power, S_IWUSR | S - static ssize_t show_flags(struct device *d, - struct device_attribute *attr, char *buf) - { -- struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; -+ struct iwl3945_priv *priv = dev_get_drvdata(d); - - return sprintf(buf, "0x%04X\n", priv->active_rxon.flags); - } -@@ -7409,7 +7409,7 @@ static ssize_t store_flags(struct device - struct device_attribute *attr, - const char *buf, size_t count) - { -- struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; -+ struct iwl3945_priv *priv = dev_get_drvdata(d); - u32 flags = simple_strtoul(buf, NULL, 0); - - mutex_lock(&priv->mutex); -@@ -7434,7 +7434,7 @@ static DEVICE_ATTR(flags, S_IWUSR | S_IR - static ssize_t show_filter_flags(struct device *d, - struct device_attribute *attr, char *buf) - { -- struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; -+ struct iwl3945_priv *priv = dev_get_drvdata(d); - - return sprintf(buf, "0x%04X\n", - le32_to_cpu(priv->active_rxon.filter_flags)); -@@ -7444,7 +7444,7 @@ static ssize_t store_filter_flags(struct - struct device_attribute *attr, - const char *buf, size_t count) - { -- struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; -+ struct iwl3945_priv *priv = dev_get_drvdata(d); - u32 filter_flags = simple_strtoul(buf, NULL, 0); - - mutex_lock(&priv->mutex); -@@ -7742,7 +7742,7 @@ static DEVICE_ATTR(antenna, S_IWUSR | S_ - static ssize_t show_status(struct device *d, - struct device_attribute *attr, char *buf) - { -- struct iwl3945_priv *priv = (struct iwl3945_priv *)d->driver_data; -+ struct iwl3945_priv *priv = dev_get_drvdata(d); - if (!iwl3945_is_alive(priv)) - return -EAGAIN; - return sprintf(buf, "0x%08x\n", (int)priv->status); -@@ -7757,7 +7757,7 @@ static ssize_t dump_error_log(struct dev - char *p = (char *)buf; - - if (p[0] == '1') -- iwl3945_dump_nic_error_log((struct iwl3945_priv *)d->driver_data); -+ iwl3945_dump_nic_error_log(dev_get_drvdata(d)); - - return strnlen(buf, count); - } -@@ -7771,7 +7771,7 @@ static ssize_t dump_event_log(struct dev - char *p = (char *)buf; - - if (p[0] == '1') -- iwl3945_dump_nic_event_log((struct iwl3945_priv *)d->driver_data); -+ iwl3945_dump_nic_event_log(dev_get_drvdata(d)); - - return strnlen(buf, count); - } -@@ -7868,7 +7868,7 @@ static int iwl3945_pci_probe(struct pci_ - int err = 0; - struct iwl3945_priv *priv; - struct ieee80211_hw *hw; -- struct iwl_3945_cfg *cfg = (struct iwl_3945_cfg *)(ent->driver_data); -+ struct iwl_3945_cfg *cfg = dev_get_drvdata(ent); - unsigned long flags; - DECLARE_MAC_BUF(mac); - ---- a/drivers/net/xen-netfront.c -+++ b/drivers/net/xen-netfront.c -@@ -1206,7 +1206,7 @@ static int __devinit netfront_probe(stru - } - - info = netdev_priv(netdev); -- dev->dev.driver_data = info; -+ dev_set_drvdata(&dev->dev, info); - - err = register_netdev(info->netdev); - if (err) { -@@ -1227,7 +1227,7 @@ static int __devinit netfront_probe(stru - - fail: - free_netdev(netdev); -- dev->dev.driver_data = NULL; -+ dev_set_drvdata(&dev->dev, NULL); - return err; - } - -@@ -1269,7 +1269,7 @@ static void xennet_disconnect_backend(st - */ - static int netfront_resume(struct xenbus_device *dev) - { -- struct netfront_info *info = dev->dev.driver_data; -+ struct netfront_info *info = dev_get_drvdata(&dev->dev); - - dev_dbg(&dev->dev, "%s\n", dev->nodename); - -@@ -1594,7 +1594,7 @@ static int xennet_connect(struct net_dev - static void backend_changed(struct xenbus_device *dev, - enum xenbus_state backend_state) - { -- struct netfront_info *np = dev->dev.driver_data; -+ struct netfront_info *np = dev_get_drvdata(&dev->dev); - struct net_device *netdev = np->netdev; - - dev_dbg(&dev->dev, "%s\n", xenbus_strstate(backend_state)); -@@ -1768,7 +1768,7 @@ static struct xenbus_device_id netfront_ - - static int __devexit xennet_remove(struct xenbus_device *dev) - { -- struct netfront_info *info = dev->dev.driver_data; -+ struct netfront_info *info = dev_get_drvdata(&dev->dev); - - dev_dbg(&dev->dev, "%s\n", dev->nodename); - ---- a/drivers/pcmcia/ds.c -+++ b/drivers/pcmcia/ds.c -@@ -394,7 +394,7 @@ static int pcmcia_device_probe(struct de - p_drv = to_pcmcia_drv(dev->driver); - s = p_dev->socket; - -- /* The PCMCIA code passes the match data in via dev->driver_data -+ /* The PCMCIA code passes the match data in via driver data - * which is an ugly hack. Once the driver probe is called it may - * and often will overwrite the match data so we must save it first - * -@@ -404,7 +404,7 @@ static int pcmcia_device_probe(struct de - * call which will then check whether there are two - * pseudo devices, and if not, add the second one. - */ -- did = p_dev->dev.driver_data; -+ did = dev_get_drvdata(&p_dev->dev); - - ds_dev_dbg(1, dev, "trying to bind to %s\n", p_drv->drv.name); - -@@ -499,7 +499,7 @@ static int pcmcia_device_remove(struct d - * pseudo multi-function card, we need to unbind - * all devices - */ -- did = p_dev->dev.driver_data; -+ did = dev_get_drvdata(dev); - if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && - (p_dev->socket->device_count != 0) && - (p_dev->device_no == 0)) -@@ -987,7 +987,7 @@ static inline int pcmcia_devmatch(struct - return 0; - } - -- dev->dev.driver_data = (void *) did; -+ dev_set_drvdata(&dev->dev, did); - - return 1; - } ---- a/drivers/s390/block/dasd_devmap.c -+++ b/drivers/s390/block/dasd_devmap.c -@@ -561,7 +561,7 @@ dasd_create_device(struct ccw_device *cd - } - - spin_lock_irqsave(get_ccwdev_lock(cdev), flags); -- cdev->dev.driver_data = device; -+ dev_set_drvdata(&cdev->dev, device); - spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); - - return device; -@@ -597,7 +597,7 @@ dasd_delete_device(struct dasd_device *d - - /* Disconnect dasd_device structure from ccw_device structure. */ - spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags); -- device->cdev->dev.driver_data = NULL; -+ dev_set_drvdata(&device->cdev->dev, NULL); - spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags); - - /* -@@ -638,7 +638,7 @@ dasd_put_device_wake(struct dasd_device - struct dasd_device * - dasd_device_from_cdev_locked(struct ccw_device *cdev) - { -- struct dasd_device *device = cdev->dev.driver_data; -+ struct dasd_device *device = dev_get_drvdata(&cdev->dev); - - if (!device) - return ERR_PTR(-ENODEV); ---- a/drivers/s390/char/con3215.c -+++ b/drivers/s390/char/con3215.c -@@ -368,7 +368,7 @@ raw3215_irq(struct ccw_device *cdev, uns - int cstat, dstat; - int count; - -- raw = cdev->dev.driver_data; -+ raw = dev_get_drvdata(&cdev->dev); - req = (struct raw3215_req *) intparm; - cstat = irb->scsw.cmd.cstat; - dstat = irb->scsw.cmd.dstat; -@@ -635,7 +635,7 @@ raw3215_probe (struct ccw_device *cdev) - int line; - - /* Console is special. */ -- if (raw3215[0] && (cdev->dev.driver_data == raw3215[0])) -+ if (raw3215[0] && (dev_get_drvdata(&cdev->dev) == raw3215[0])) - return 0; - raw = kmalloc(sizeof(struct raw3215_info) + - RAW3215_INBUF_SIZE, GFP_KERNEL|GFP_DMA); -@@ -669,7 +669,7 @@ raw3215_probe (struct ccw_device *cdev) - } - init_waitqueue_head(&raw->empty_wait); - -- cdev->dev.driver_data = raw; -+ dev_set_drvdata(&cdev->dev, raw); - cdev->handler = raw3215_irq; - - return 0; -@@ -681,9 +681,9 @@ raw3215_remove (struct ccw_device *cdev) - struct raw3215_info *raw; - - ccw_device_set_offline(cdev); -- raw = cdev->dev.driver_data; -+ raw = dev_get_drvdata(&cdev->dev); - if (raw) { -- cdev->dev.driver_data = NULL; -+ dev_set_drvdata(&cdev->dev, NULL); - kfree(raw->buffer); - kfree(raw); - } -@@ -694,7 +694,7 @@ raw3215_set_online (struct ccw_device *c - { - struct raw3215_info *raw; - -- raw = cdev->dev.driver_data; -+ raw = dev_get_drvdata(&cdev->dev); - if (!raw) - return -ENODEV; - -@@ -706,7 +706,7 @@ raw3215_set_offline (struct ccw_device * - { - struct raw3215_info *raw; - -- raw = cdev->dev.driver_data; -+ raw = dev_get_drvdata(&cdev->dev); - if (!raw) - return -ENODEV; - -@@ -848,7 +848,7 @@ con3215_init(void) - raw->buffer = (char *) alloc_bootmem_low(RAW3215_BUFFER_SIZE); - raw->inbuf = (char *) alloc_bootmem_low(RAW3215_INBUF_SIZE); - raw->cdev = cdev; -- cdev->dev.driver_data = raw; -+ dev_set_drvdata(&cdev->dev, raw); - cdev->handler = raw3215_irq; - - raw->flags |= RAW3215_FIXED; ---- a/drivers/s390/char/raw3270.c -+++ b/drivers/s390/char/raw3270.c -@@ -355,7 +355,7 @@ raw3270_irq (struct ccw_device *cdev, un - struct raw3270_request *rq; - int rc; - -- rp = (struct raw3270 *) cdev->dev.driver_data; -+ rp = dev_get_drvdata(&cdev->dev); - if (!rp) - return; - rq = (struct raw3270_request *) intparm; -@@ -828,7 +828,7 @@ raw3270_setup_device(struct ccw_device * - if (rp->minor == -1) - return -EUSERS; - rp->cdev = cdev; -- cdev->dev.driver_data = rp; -+ dev_set_drvdata(&cdev->dev, rp); - cdev->handler = raw3270_irq; - return 0; - } -@@ -1105,7 +1105,7 @@ raw3270_delete_device(struct raw3270 *rp - /* Disconnect from ccw_device. */ - cdev = rp->cdev; - rp->cdev = NULL; -- cdev->dev.driver_data = NULL; -+ dev_set_drvdata(&cdev->dev, NULL); - cdev->handler = NULL; - - /* Put ccw_device structure. */ -@@ -1129,7 +1129,7 @@ static ssize_t - raw3270_model_show(struct device *dev, struct device_attribute *attr, char *buf) - { - return snprintf(buf, PAGE_SIZE, "%i\n", -- ((struct raw3270 *) dev->driver_data)->model); -+ ((struct raw3270 *) dev_get_drvdata(dev))->model); - } - static DEVICE_ATTR(model, 0444, raw3270_model_show, NULL); - -@@ -1137,7 +1137,7 @@ static ssize_t - raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf) - { - return snprintf(buf, PAGE_SIZE, "%i\n", -- ((struct raw3270 *) dev->driver_data)->rows); -+ ((struct raw3270 *) dev_get_drvdata(dev))->rows); - } - static DEVICE_ATTR(rows, 0444, raw3270_rows_show, NULL); - -@@ -1145,7 +1145,7 @@ static ssize_t - raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *buf) - { - return snprintf(buf, PAGE_SIZE, "%i\n", -- ((struct raw3270 *) dev->driver_data)->cols); -+ ((struct raw3270 *) dev_get_drvdata(dev))->cols); - } - static DEVICE_ATTR(columns, 0444, raw3270_columns_show, NULL); - -@@ -1282,7 +1282,7 @@ raw3270_remove (struct ccw_device *cdev) - struct raw3270_view *v; - struct raw3270_notifier *np; - -- rp = cdev->dev.driver_data; -+ rp = dev_get_drvdata(&cdev->dev); - /* - * _remove is the opposite of _probe; it's probe that - * should set up rp. raw3270_remove gets entered for -@@ -1330,7 +1330,7 @@ raw3270_set_offline (struct ccw_device * - { - struct raw3270 *rp; - -- rp = cdev->dev.driver_data; -+ rp = dev_get_drvdata(&cdev->dev); - if (test_bit(RAW3270_FLAGS_CONSOLE, &rp->flags)) - return -EBUSY; - raw3270_remove(cdev); ---- a/drivers/s390/char/tape_34xx.c -+++ b/drivers/s390/char/tape_34xx.c -@@ -1310,7 +1310,7 @@ static int - tape_34xx_online(struct ccw_device *cdev) - { - return tape_generic_online( -- cdev->dev.driver_data, -+ dev_get_drvdata(&cdev->dev), - &tape_discipline_34xx - ); - } -@@ -1318,7 +1318,7 @@ tape_34xx_online(struct ccw_device *cdev - static int - tape_34xx_offline(struct ccw_device *cdev) - { -- return tape_generic_offline(cdev->dev.driver_data); -+ return tape_generic_offline(dev_get_drvdata(&cdev->dev)); - } - - static struct ccw_driver tape_34xx_driver = { ---- a/drivers/s390/char/tape_core.c -+++ b/drivers/s390/char/tape_core.c -@@ -92,7 +92,7 @@ tape_medium_state_show(struct device *de - { - struct tape_device *tdev; - -- tdev = (struct tape_device *) dev->driver_data; -+ tdev = dev_get_drvdata(dev); - return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->medium_state); - } - -@@ -104,7 +104,7 @@ tape_first_minor_show(struct device *dev - { - struct tape_device *tdev; - -- tdev = (struct tape_device *) dev->driver_data; -+ tdev = dev_get_drvdata(dev); - return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->first_minor); - } - -@@ -116,7 +116,7 @@ tape_state_show(struct device *dev, stru - { - struct tape_device *tdev; - -- tdev = (struct tape_device *) dev->driver_data; -+ tdev = dev_get_drvdata(dev); - return scnprintf(buf, PAGE_SIZE, "%s\n", (tdev->first_minor < 0) ? - "OFFLINE" : tape_state_verbose[tdev->tape_state]); - } -@@ -130,7 +130,7 @@ tape_operation_show(struct device *dev, - struct tape_device *tdev; - ssize_t rc; - -- tdev = (struct tape_device *) dev->driver_data; -+ tdev = dev_get_drvdata(dev); - if (tdev->first_minor < 0) - return scnprintf(buf, PAGE_SIZE, "N/A\n"); - -@@ -156,7 +156,7 @@ tape_blocksize_show(struct device *dev, - { - struct tape_device *tdev; - -- tdev = (struct tape_device *) dev->driver_data; -+ tdev = dev_get_drvdata(dev); - - return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->char_data.block_size); - } -@@ -542,7 +542,7 @@ tape_generic_probe(struct ccw_device *cd - dev_name(&cdev->dev)); - return ret; - } -- cdev->dev.driver_data = device; -+ dev_set_drvdata(&cdev->dev, device); - cdev->handler = __tape_do_irq; - device->cdev = cdev; - ccw_device_get_id(cdev, &dev_id); -@@ -582,7 +582,7 @@ tape_generic_remove(struct ccw_device *c - { - struct tape_device * device; - -- device = cdev->dev.driver_data; -+ device = dev_get_drvdata(&cdev->dev); - if (!device) { - PRINT_ERR("No device pointer in tape_generic_remove!\n"); - return; -@@ -625,9 +625,9 @@ tape_generic_remove(struct ccw_device *c - tape_cleanup_device(device); - } - -- if (cdev->dev.driver_data != NULL) { -+ if (dev_get_drvdata(&cdev->dev) != NULL) { - sysfs_remove_group(&cdev->dev.kobj, &tape_attr_group); -- cdev->dev.driver_data = tape_put_device(cdev->dev.driver_data); -+ dev_set_drvdata(&cdev->dev, tape_put_device(dev_get_drvdata(&cdev->dev))); - } - } - -@@ -1049,7 +1049,7 @@ __tape_do_irq (struct ccw_device *cdev, - struct tape_request *request; - int rc; - -- device = (struct tape_device *) cdev->dev.driver_data; -+ device = dev_get_drvdata(&cdev->dev); - if (device == NULL) { - PRINT_ERR("could not get device structure for %s " - "in interrupt\n", dev_name(&cdev->dev)); ---- a/drivers/s390/char/vmlogrdr.c -+++ b/drivers/s390/char/vmlogrdr.c -@@ -503,7 +503,7 @@ static ssize_t vmlogrdr_autopurge_store( - struct device_attribute *attr, - const char * buf, size_t count) - { -- struct vmlogrdr_priv_t *priv = dev->driver_data; -+ struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); - ssize_t ret = count; - - switch (buf[0]) { -@@ -524,7 +524,7 @@ static ssize_t vmlogrdr_autopurge_show(s - struct device_attribute *attr, - char *buf) - { -- struct vmlogrdr_priv_t *priv = dev->driver_data; -+ struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); - return sprintf(buf, "%u\n", priv->autopurge); - } - -@@ -540,7 +540,7 @@ static ssize_t vmlogrdr_purge_store(stru - - char cp_command[80]; - char cp_response[80]; -- struct vmlogrdr_priv_t *priv = dev->driver_data; -+ struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); - - if (buf[0] != '1') - return -EINVAL; -@@ -577,7 +577,7 @@ static ssize_t vmlogrdr_autorecording_st - struct device_attribute *attr, - const char *buf, size_t count) - { -- struct vmlogrdr_priv_t *priv = dev->driver_data; -+ struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); - ssize_t ret = count; - - switch (buf[0]) { -@@ -598,7 +598,7 @@ static ssize_t vmlogrdr_autorecording_sh - struct device_attribute *attr, - char *buf) - { -- struct vmlogrdr_priv_t *priv = dev->driver_data; -+ struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); - return sprintf(buf, "%u\n", priv->autorecording); - } - -@@ -611,7 +611,7 @@ static ssize_t vmlogrdr_recording_store( - struct device_attribute *attr, - const char * buf, size_t count) - { -- struct vmlogrdr_priv_t *priv = dev->driver_data; -+ struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); - ssize_t ret; - - switch (buf[0]) { ---- a/drivers/s390/char/vmur.c -+++ b/drivers/s390/char/vmur.c -@@ -128,7 +128,7 @@ static struct urdev *urdev_get_from_cdev - unsigned long flags; - - spin_lock_irqsave(get_ccwdev_lock(cdev), flags); -- urd = cdev->dev.driver_data; -+ urd = dev_get_drvdata(&cdev->dev); - if (urd) - urdev_get(urd); - spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); -@@ -285,7 +285,7 @@ static void ur_int_handler(struct ccw_de - TRACE("ur_int_handler: unsolicited interrupt\n"); - return; - } -- urd = cdev->dev.driver_data; -+ urd = dev_get_drvdata(&cdev->dev); - BUG_ON(!urd); - /* On special conditions irb is an error pointer */ - if (IS_ERR(irb)) -@@ -831,7 +831,7 @@ static int ur_probe(struct ccw_device *c - goto fail_remove_attr; - } - spin_lock_irq(get_ccwdev_lock(cdev)); -- cdev->dev.driver_data = urd; -+ dev_set_drvdata(&cdev->dev, urd); - spin_unlock_irq(get_ccwdev_lock(cdev)); - - mutex_unlock(&vmur_mutex); -@@ -971,8 +971,8 @@ static void ur_remove(struct ccw_device - ur_remove_attributes(&cdev->dev); - - spin_lock_irqsave(get_ccwdev_lock(cdev), flags); -- urdev_put(cdev->dev.driver_data); -- cdev->dev.driver_data = NULL; -+ urdev_put(dev_get_drvdata(&cdev->dev)); -+ dev_set_drvdata(&cdev->dev, NULL); - spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); - - mutex_unlock(&vmur_mutex); ---- a/drivers/s390/net/claw.c -+++ b/drivers/s390/net/claw.c -@@ -581,7 +581,7 @@ claw_irq_handler(struct ccw_device *cdev - - CLAW_DBF_TEXT(4, trace, "clawirq"); - /* Bypass all 'unsolicited interrupts' */ -- if (!cdev->dev.driver_data) { -+ if (!dev_get_drvdata(&cdev->dev)) { - printk(KERN_WARNING "claw: unsolicited interrupt for device:" - "%s received c-%02x d-%02x\n", - dev_name(&cdev->dev), irb->scsw.cmd.cstat, -@@ -589,7 +589,7 @@ claw_irq_handler(struct ccw_device *cdev - CLAW_DBF_TEXT(2, trace, "badirq"); - return; - } -- privptr = (struct claw_privbk *)cdev->dev.driver_data; -+ privptr = dev_get_drvdata(&cdev->dev); - - /* Try to extract channel from driver data. */ - if (privptr->channel[READ].cdev == cdev) -@@ -1964,7 +1964,7 @@ probe_error( struct ccwgroup_device *cgd - struct claw_privbk *privptr; - - CLAW_DBF_TEXT(4, trace, "proberr"); -- privptr = (struct claw_privbk *) cgdev->dev.driver_data; -+ privptr = dev_get_drvdata(&cgdev->dev); - if (privptr != NULL) { - cgdev->dev.driver_data = NULL; - kfree(privptr->p_env); -@@ -2883,7 +2883,7 @@ claw_new_device(struct ccwgroup_device * - printk(KERN_INFO "claw: add for %s\n", - dev_name(&cgdev->cdev[READ]->dev)); - CLAW_DBF_TEXT(2, setup, "new_dev"); -- privptr = cgdev->dev.driver_data; -+ privptr = dev_get_drvdata(&cgdev->dev); - cgdev->cdev[READ]->dev.driver_data = privptr; - cgdev->cdev[WRITE]->dev.driver_data = privptr; - if (!privptr) -@@ -2935,7 +2935,7 @@ claw_new_device(struct ccwgroup_device * - } - dev->flags &=~IFF_RUNNING; - if (privptr->buffs_alloc == 0) { -- ret=init_ccw_bk(dev); -+ ret=init_ccw_bk(dev); - if (ret !=0) { - unregister_netdev(dev); - claw_free_netdevice(dev,1); -@@ -2991,7 +2991,7 @@ claw_shutdown_device(struct ccwgroup_dev - int ret; - - CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev)); -- priv = cgdev->dev.driver_data; -+ priv = dev_get_drvdata(&cgdev->dev); - if (!priv) - return -ENODEV; - ndev = priv->channel[READ].ndev; -@@ -3021,7 +3021,7 @@ claw_remove_device(struct ccwgroup_devic - - BUG_ON(!cgdev); - CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev)); -- priv = cgdev->dev.driver_data; -+ priv = dev_get_drvdata(&cgdev->dev); - BUG_ON(!priv); - printk(KERN_INFO "claw: %s() called %s will be removed.\n", - __func__, dev_name(&cgdev->cdev[0]->dev)); -@@ -3037,9 +3037,9 @@ claw_remove_device(struct ccwgroup_devic - kfree(priv->channel[1].irb); - priv->channel[1].irb=NULL; - kfree(priv); -- cgdev->dev.driver_data=NULL; -- cgdev->cdev[READ]->dev.driver_data = NULL; -- cgdev->cdev[WRITE]->dev.driver_data = NULL; -+ dev_set_drvdata(&cgdev->dev,NULL); -+ dev_set_drvdata(&cgdev->cdev[READ]->dev, NULL); -+ dev_set_drvdata(&cgdev->cdev[WRITE]->dev, NULL); - put_device(&cgdev->dev); - - return; -@@ -3055,7 +3055,7 @@ claw_hname_show(struct device *dev, stru - struct claw_privbk *priv; - struct claw_env * p_env; - -- priv = dev->driver_data; -+ priv = dev_get_drvdata(dev); - if (!priv) - return -ENODEV; - p_env = priv->p_env; -@@ -3068,7 +3068,7 @@ claw_hname_write(struct device *dev, str - struct claw_privbk *priv; - struct claw_env * p_env; - -- priv = dev->driver_data; -+ priv = dev_get_drvdata(dev); - if (!priv) - return -ENODEV; - p_env = priv->p_env; -@@ -3092,7 +3092,7 @@ claw_adname_show(struct device *dev, str - struct claw_privbk *priv; - struct claw_env * p_env; - -- priv = dev->driver_data; -+ priv = dev_get_drvdata(dev); - if (!priv) - return -ENODEV; - p_env = priv->p_env; -@@ -3105,7 +3105,7 @@ claw_adname_write(struct device *dev, st - struct claw_privbk *priv; - struct claw_env * p_env; - -- priv = dev->driver_data; -+ priv = dev_get_drvdata(dev); - if (!priv) - return -ENODEV; - p_env = priv->p_env; -@@ -3129,7 +3129,7 @@ claw_apname_show(struct device *dev, str - struct claw_privbk *priv; - struct claw_env * p_env; - -- priv = dev->driver_data; -+ priv = dev_get_drvdata(dev); - if (!priv) - return -ENODEV; - p_env = priv->p_env; -@@ -3143,7 +3143,7 @@ claw_apname_write(struct device *dev, st - struct claw_privbk *priv; - struct claw_env * p_env; - -- priv = dev->driver_data; -+ priv = dev_get_drvdata(dev); - if (!priv) - return -ENODEV; - p_env = priv->p_env; -@@ -3177,7 +3177,7 @@ claw_wbuff_show(struct device *dev, stru - struct claw_privbk *priv; - struct claw_env * p_env; - -- priv = dev->driver_data; -+ priv = dev_get_drvdata(dev); - if (!priv) - return -ENODEV; - p_env = priv->p_env; -@@ -3191,7 +3191,7 @@ claw_wbuff_write(struct device *dev, str - struct claw_env * p_env; - int nnn,max; - -- priv = dev->driver_data; -+ priv = dev_get_drvdata(dev); - if (!priv) - return -ENODEV; - p_env = priv->p_env; -@@ -3218,7 +3218,7 @@ claw_rbuff_show(struct device *dev, stru - struct claw_privbk *priv; - struct claw_env * p_env; - -- priv = dev->driver_data; -+ priv = dev_get_drvdata(dev); - if (!priv) - return -ENODEV; - p_env = priv->p_env; -@@ -3232,7 +3232,7 @@ claw_rbuff_write(struct device *dev, str - struct claw_env *p_env; - int nnn,max; - -- priv = dev->driver_data; -+ priv = dev_get_drvdata(dev); - if (!priv) - return -ENODEV; - p_env = priv->p_env; ---- a/drivers/s390/net/lcs.c -+++ b/drivers/s390/net/lcs.c -@@ -1378,6 +1378,7 @@ lcs_schedule_recovery(struct lcs_card *c - static void - lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) - { -+ struct ccwgroup_device *gdev = dev_get_drvdata(&cdev->dev); - struct lcs_card *card; - struct lcs_channel *channel; - int rc, index; -@@ -1386,7 +1387,7 @@ lcs_irq(struct ccw_device *cdev, unsigne - if (lcs_check_irb_error(cdev, irb)) - return; - -- card = CARD_FROM_DEV(cdev); -+ card = dev_get_drvdata(&gdev->dev); - if (card->read.ccwdev == cdev) - channel = &card->read; - else -@@ -1924,7 +1925,7 @@ lcs_portno_show (struct device *dev, str - { - struct lcs_card *card; - -- card = (struct lcs_card *)dev->driver_data; -+ card = dev_get_drvdata(dev); - - if (!card) - return 0; -@@ -1941,7 +1942,7 @@ lcs_portno_store (struct device *dev, st - struct lcs_card *card; - int value; - -- card = (struct lcs_card *)dev->driver_data; -+ card = dev_get_drvdata(dev); - - if (!card) - return 0; -@@ -1975,7 +1976,7 @@ lcs_timeout_show(struct device *dev, str - { - struct lcs_card *card; - -- card = (struct lcs_card *)dev->driver_data; -+ card = dev_get_drvdata(dev); - - return card ? sprintf(buf, "%u\n", card->lancmd_timeout) : 0; - } -@@ -1986,7 +1987,7 @@ lcs_timeout_store (struct device *dev, s - struct lcs_card *card; - int value; - -- card = (struct lcs_card *)dev->driver_data; -+ card = dev_get_drvdata(dev); - - if (!card) - return 0; -@@ -2005,7 +2006,7 @@ static ssize_t - lcs_dev_recover_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) - { -- struct lcs_card *card = dev->driver_data; -+ struct lcs_card *card = dev_get_drvdata(dev); - char *tmp; - int i; - -@@ -2058,7 +2059,7 @@ lcs_probe_device(struct ccwgroup_device - put_device(&ccwgdev->dev); - return ret; - } -- ccwgdev->dev.driver_data = card; -+ dev_set_drvdata(&ccwgdev->dev, card); - ccwgdev->cdev[0]->handler = lcs_irq; - ccwgdev->cdev[1]->handler = lcs_irq; - card->gdev = ccwgdev; -@@ -2075,7 +2076,7 @@ lcs_register_netdev(struct ccwgroup_devi - struct lcs_card *card; - - LCS_DBF_TEXT(2, setup, "regnetdv"); -- card = (struct lcs_card *)ccwgdev->dev.driver_data; -+ card = dev_get_drvdata(&ccwgdev->dev); - if (card->dev->reg_state != NETREG_UNINITIALIZED) - return 0; - SET_NETDEV_DEV(card->dev, &ccwgdev->dev); -@@ -2094,7 +2095,7 @@ lcs_new_device(struct ccwgroup_device *c - enum lcs_dev_states recover_state; - int rc; - -- card = (struct lcs_card *)ccwgdev->dev.driver_data; -+ card = dev_get_drvdata(&ccwgdev->dev); - if (!card) - return -ENODEV; - -@@ -2202,7 +2203,7 @@ __lcs_shutdown_device(struct ccwgroup_de - int ret; - - LCS_DBF_TEXT(3, setup, "shtdndev"); -- card = (struct lcs_card *)ccwgdev->dev.driver_data; -+ card = dev_get_drvdata(&ccwgdev->dev); - if (!card) - return -ENODEV; - if (recovery_mode == 0) { -@@ -2269,7 +2270,7 @@ lcs_remove_device(struct ccwgroup_device - { - struct lcs_card *card; - -- card = (struct lcs_card *)ccwgdev->dev.driver_data; -+ card = dev_get_drvdata(&ccwgdev->dev); - if (!card) - return; - ---- a/drivers/s390/net/netiucv.c -+++ b/drivers/s390/net/netiucv.c -@@ -1353,7 +1353,7 @@ static int netiucv_change_mtu(struct net - static ssize_t user_show(struct device *dev, struct device_attribute *attr, - char *buf) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 5, __func__); - return sprintf(buf, "%s\n", netiucv_printname(priv->conn->userid)); -@@ -1362,7 +1362,7 @@ static ssize_t user_show(struct device * - static ssize_t user_write(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - struct net_device *ndev = priv->conn->netdev; - char *p; - char *tmp; -@@ -1419,7 +1419,8 @@ static DEVICE_ATTR(user, 0644, user_show - - static ssize_t buffer_show (struct device *dev, struct device_attribute *attr, - char *buf) --{ struct netiucv_priv *priv = dev->driver_data; -+{ -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 5, __func__); - return sprintf(buf, "%d\n", priv->conn->max_buffsize); -@@ -1428,7 +1429,7 @@ static ssize_t buffer_show (struct devic - static ssize_t buffer_write (struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - struct net_device *ndev = priv->conn->netdev; - char *e; - int bs1; -@@ -1476,7 +1477,7 @@ static DEVICE_ATTR(buffer, 0644, buffer_ - static ssize_t dev_fsm_show (struct device *dev, struct device_attribute *attr, - char *buf) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 5, __func__); - return sprintf(buf, "%s\n", fsm_getstate_str(priv->fsm)); -@@ -1487,7 +1488,7 @@ static DEVICE_ATTR(device_fsm_state, 044 - static ssize_t conn_fsm_show (struct device *dev, - struct device_attribute *attr, char *buf) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 5, __func__); - return sprintf(buf, "%s\n", fsm_getstate_str(priv->conn->fsm)); -@@ -1498,7 +1499,7 @@ static DEVICE_ATTR(connection_fsm_state, - static ssize_t maxmulti_show (struct device *dev, - struct device_attribute *attr, char *buf) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 5, __func__); - return sprintf(buf, "%ld\n", priv->conn->prof.maxmulti); -@@ -1508,7 +1509,7 @@ static ssize_t maxmulti_write (struct de - struct device_attribute *attr, - const char *buf, size_t count) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 4, __func__); - priv->conn->prof.maxmulti = 0; -@@ -1520,7 +1521,7 @@ static DEVICE_ATTR(max_tx_buffer_used, 0 - static ssize_t maxcq_show (struct device *dev, struct device_attribute *attr, - char *buf) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 5, __func__); - return sprintf(buf, "%ld\n", priv->conn->prof.maxcqueue); -@@ -1529,7 +1530,7 @@ static ssize_t maxcq_show (struct device - static ssize_t maxcq_write (struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 4, __func__); - priv->conn->prof.maxcqueue = 0; -@@ -1541,7 +1542,7 @@ static DEVICE_ATTR(max_chained_skbs, 064 - static ssize_t sdoio_show (struct device *dev, struct device_attribute *attr, - char *buf) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 5, __func__); - return sprintf(buf, "%ld\n", priv->conn->prof.doios_single); -@@ -1550,7 +1551,7 @@ static ssize_t sdoio_show (struct device - static ssize_t sdoio_write (struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 4, __func__); - priv->conn->prof.doios_single = 0; -@@ -1562,7 +1563,7 @@ static DEVICE_ATTR(tx_single_write_ops, - static ssize_t mdoio_show (struct device *dev, struct device_attribute *attr, - char *buf) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 5, __func__); - return sprintf(buf, "%ld\n", priv->conn->prof.doios_multi); -@@ -1571,7 +1572,7 @@ static ssize_t mdoio_show (struct device - static ssize_t mdoio_write (struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 5, __func__); - priv->conn->prof.doios_multi = 0; -@@ -1583,7 +1584,7 @@ static DEVICE_ATTR(tx_multi_write_ops, 0 - static ssize_t txlen_show (struct device *dev, struct device_attribute *attr, - char *buf) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 5, __func__); - return sprintf(buf, "%ld\n", priv->conn->prof.txlen); -@@ -1592,7 +1593,7 @@ static ssize_t txlen_show (struct device - static ssize_t txlen_write (struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 4, __func__); - priv->conn->prof.txlen = 0; -@@ -1604,7 +1605,7 @@ static DEVICE_ATTR(netto_bytes, 0644, tx - static ssize_t txtime_show (struct device *dev, struct device_attribute *attr, - char *buf) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 5, __func__); - return sprintf(buf, "%ld\n", priv->conn->prof.tx_time); -@@ -1613,7 +1614,7 @@ static ssize_t txtime_show (struct devic - static ssize_t txtime_write (struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 4, __func__); - priv->conn->prof.tx_time = 0; -@@ -1625,7 +1626,7 @@ static DEVICE_ATTR(max_tx_io_time, 0644, - static ssize_t txpend_show (struct device *dev, struct device_attribute *attr, - char *buf) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 5, __func__); - return sprintf(buf, "%ld\n", priv->conn->prof.tx_pending); -@@ -1634,7 +1635,7 @@ static ssize_t txpend_show (struct devic - static ssize_t txpend_write (struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 4, __func__); - priv->conn->prof.tx_pending = 0; -@@ -1646,7 +1647,7 @@ static DEVICE_ATTR(tx_pending, 0644, txp - static ssize_t txmpnd_show (struct device *dev, struct device_attribute *attr, - char *buf) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 5, __func__); - return sprintf(buf, "%ld\n", priv->conn->prof.tx_max_pending); -@@ -1655,7 +1656,7 @@ static ssize_t txmpnd_show (struct devic - static ssize_t txmpnd_write (struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) - { -- struct netiucv_priv *priv = dev->driver_data; -+ struct netiucv_priv *priv = dev_get_drvdata(dev); - - IUCV_DBF_TEXT(trace, 4, __func__); - priv->conn->prof.tx_max_pending = 0; -@@ -1747,7 +1748,7 @@ static int netiucv_register_device(struc - if (ret) - goto out_unreg; - priv->dev = dev; -- dev->driver_data = priv; -+ dev_set_drvdata(dev, priv); - return 0; - - out_unreg: ---- a/drivers/scsi/aha1740.c -+++ b/drivers/scsi/aha1740.c -@@ -646,7 +646,8 @@ static int aha1740_probe (struct device - - static __devexit int aha1740_remove (struct device *dev) - { -- struct Scsi_Host *shpnt = dev->driver_data; -+ struct eisa_device *edev = to_eisa_device (dev); -+ struct Scsi_Host *shpnt = eisa_get_drvdata(edev); - struct aha1740_hostdata *host = HOSTDATA (shpnt); - - scsi_remove_host(shpnt); ---- a/drivers/scsi/ibmvscsi/ibmvstgt.c -+++ b/drivers/scsi/ibmvscsi/ibmvstgt.c -@@ -890,7 +890,7 @@ free_vport: - - static int ibmvstgt_remove(struct vio_dev *dev) - { -- struct srp_target *target = (struct srp_target *) dev->dev.driver_data; -+ struct srp_target *target = dev_get_drvdata(&dev->dev); - struct Scsi_Host *shost = target->shost; - struct vio_port *vport = target->ldata; - ---- a/drivers/scsi/libsrp.c -+++ b/drivers/scsi/libsrp.c -@@ -135,7 +135,7 @@ int srp_target_alloc(struct srp_target * - INIT_LIST_HEAD(&target->cmd_queue); - - target->dev = dev; -- target->dev->driver_data = target; -+ dev_set_drvdata(target->dev, target); - - target->srp_iu_size = iu_size; - target->rx_ring_size = nr; ---- a/drivers/thermal/thermal_sys.c -+++ b/drivers/thermal/thermal_sys.c -@@ -304,7 +304,7 @@ static LIST_HEAD(thermal_hwmon_list); - static ssize_t - name_show(struct device *dev, struct device_attribute *attr, char *buf) - { -- struct thermal_hwmon_device *hwmon = dev->driver_data; -+ struct thermal_hwmon_device *hwmon = dev_get_drvdata(dev); - return sprintf(buf, "%s\n", hwmon->type); - } - static DEVICE_ATTR(name, 0444, name_show, NULL); -@@ -362,7 +362,7 @@ thermal_add_hwmon_sysfs(struct thermal_z - result = PTR_ERR(hwmon->device); - goto free_mem; - } -- hwmon->device->driver_data = hwmon; -+ dev_set_drvdata(hwmon->device, hwmon); - result = device_create_file(hwmon->device, &dev_attr_name); - if (result) - goto unregister_hwmon_device; ---- a/drivers/video/xen-fbfront.c -+++ b/drivers/video/xen-fbfront.c -@@ -384,7 +384,7 @@ static int __devinit xenfb_probe(struct - fb_size = XENFB_DEFAULT_FB_LEN; - } - -- dev->dev.driver_data = info; -+ dev_set_drvdata(&dev->dev, info); - info->xbdev = dev; - info->irq = -1; - info->x1 = info->y1 = INT_MAX; -@@ -503,7 +503,7 @@ xenfb_make_preferred_console(void) - - static int xenfb_resume(struct xenbus_device *dev) - { -- struct xenfb_info *info = dev->dev.driver_data; -+ struct xenfb_info *info = dev_get_drvdata(&dev->dev); - - xenfb_disconnect_backend(info); - xenfb_init_shared_page(info, info->fb_info); -@@ -512,7 +512,7 @@ static int xenfb_resume(struct xenbus_de - - static int xenfb_remove(struct xenbus_device *dev) - { -- struct xenfb_info *info = dev->dev.driver_data; -+ struct xenfb_info *info = dev_get_drvdata(&dev->dev); - - xenfb_disconnect_backend(info); - if (info->fb_info) { -@@ -621,7 +621,7 @@ static void xenfb_disconnect_backend(str - static void xenfb_backend_changed(struct xenbus_device *dev, - enum xenbus_state backend_state) - { -- struct xenfb_info *info = dev->dev.driver_data; -+ struct xenfb_info *info = dev_get_drvdata(&dev->dev); - int val; - - switch (backend_state) { ---- a/include/linux/eisa.h -+++ b/include/linux/eisa.h -@@ -78,12 +78,12 @@ static inline void eisa_driver_unregiste - /* Mimics pci.h... */ - static inline void *eisa_get_drvdata (struct eisa_device *edev) - { -- return edev->dev.driver_data; -+ return dev_get_drvdata(&edev->dev); - } - - static inline void eisa_set_drvdata (struct eisa_device *edev, void *data) - { -- edev->dev.driver_data = data; -+ dev_set_drvdata(&edev->dev, data); - } - - /* The EISA root device. There's rumours about machines with multiple diff --git a/pending/ehea-remove-incorrect-sysfs-links.patch b/pending/ehea-remove-incorrect-sysfs-links.patch deleted file mode 100644 index 6dd91aa99cbf95..00000000000000 --- a/pending/ehea-remove-incorrect-sysfs-links.patch +++ /dev/null @@ -1,68 +0,0 @@ -Subject: ehea: remove incorrect sysfs links - ---- - drivers/net/ehea/ehea_main.c | 37 ------------------------------------- - 1 file changed, 37 deletions(-) - ---- a/drivers/net/ehea/ehea_main.c -+++ b/drivers/net/ehea/ehea_main.c -@@ -2804,34 +2804,6 @@ static void __devinit logical_port_relea - of_node_put(port->ofdev.node); - } - --static int ehea_driver_sysfs_add(struct device *dev, -- struct device_driver *driver) --{ -- int ret; -- -- ret = sysfs_create_link(&driver->kobj, &dev->kobj, -- kobject_name(&dev->kobj)); -- if (ret == 0) { -- ret = sysfs_create_link(&dev->kobj, &driver->kobj, -- "driver"); -- if (ret) -- sysfs_remove_link(&driver->kobj, -- kobject_name(&dev->kobj)); -- } -- return ret; --} -- --static void ehea_driver_sysfs_remove(struct device *dev, -- struct device_driver *driver) --{ -- struct device_driver *drv = driver; -- -- if (drv) { -- sysfs_remove_link(&drv->kobj, kobject_name(&dev->kobj)); -- sysfs_remove_link(&dev->kobj, "driver"); -- } --} -- - static struct device *ehea_register_port(struct ehea_port *port, - struct device_node *dn) - { -@@ -2856,16 +2828,8 @@ static struct device *ehea_register_port - goto out_unreg_of_dev; - } - -- ret = ehea_driver_sysfs_add(&port->ofdev.dev, &ehea_driver.driver); -- if (ret) { -- ehea_error("failed to register sysfs driver link"); -- goto out_rem_dev_file; -- } -- - return &port->ofdev.dev; - --out_rem_dev_file: -- device_remove_file(&port->ofdev.dev, &dev_attr_log_port_id); - out_unreg_of_dev: - of_device_unregister(&port->ofdev); - out: -@@ -2874,7 +2838,6 @@ out: - - static void ehea_unregister_port(struct ehea_port *port) - { -- ehea_driver_sysfs_remove(&port->ofdev.dev, &ehea_driver.driver); - device_remove_file(&port->ofdev.dev, &dev_attr_log_port_id); - of_device_unregister(&port->ofdev); - } diff --git a/pending/kobject-change-sys-kernel-uids-to-not-use-a-kset.patch b/pending/kobject-change-sys-kernel-uids-to-not-use-a-kset.patch deleted file mode 100644 index 8d01f1bc6d4c7c..00000000000000 --- a/pending/kobject-change-sys-kernel-uids-to-not-use-a-kset.patch +++ /dev/null @@ -1,49 +0,0 @@ -From foo@baz Tue Apr 9 12:12:43 2002 -Date: Thu, 29 Nov 2007 22:38:12 -0800 -To: Greg KH <greg@kroah.com> -From: Greg Kroah-Hartman <gregkh@suse.de> -Subject: kobject: change /sys/kernel/uids to not use a kset - -A kset is not needed for the uids kobjects, so switch to using a -kobject instead. - -Cc: Kay Sievers <kay.sievers@vrfy.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - kernel/user.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - ---- a/kernel/user.c -+++ b/kernel/user.c -@@ -115,7 +115,9 @@ static void sched_switch_user(struct tas - - #if defined(CONFIG_FAIR_USER_SCHED) && defined(CONFIG_SYSFS) - --static struct kset *uids_kset; /* represents the /sys/kernel/uids/ directory */ -+/* represents the /sys/kernel/uids/ directory */ -+static struct kobject *uids_kobj; -+ - static DEFINE_MUTEX(uids_mutex); - - static inline void uids_mutex_lock(void) -@@ -182,7 +184,7 @@ static int uids_user_create(struct user_ - - memset(kobj, 0, sizeof(struct kobject)); - kobj->ktype = &uids_ktype; -- kobj->kset = uids_kset; -+ kobj->parent = uids_kobj; - kobject_init(kobj); - kobject_set_name(&up->kobj, "%d", up->uid); - error = kobject_add(kobj); -@@ -201,8 +203,8 @@ done: - */ - int __init uids_sysfs_init(void) - { -- uids_kset = kset_create_and_register("uids", NULL, kernel_kobj); -- if (!uids_kset) -+ uids_kobj = kobject_create_and_register("uids", kernel_kobj); -+ if (!uids_kobj) - return -ENOMEM; - - return uids_user_create(&root_user); diff --git a/pending/panic-on-io-nmi.diff b/pending/panic-on-io-nmi.diff deleted file mode 100644 index 4c134c3af9a46e..00000000000000 --- a/pending/panic-on-io-nmi.diff +++ /dev/null @@ -1,98 +0,0 @@ -From: Kurt Garloff <garloff@suse.de> -Subject: [PATCH] X86: sysctl to allow panic on IOCK NMI error -References: bnc427979 - -This patch introduces a sysctl /proc/sys/kernel/panic_on_io_nmi., -which defaults to 0 (off). -When enabled, the kernel panics when the kernel receives an NMI -caused by an IO error. - -The IO error triggered NMI indicates a serious system condition, -which could result in IO data corruption. Rather than contiuing, -panicing and dumping might be a better choice, so one can figure -out what's causing the IO error. -This could be especially important to companies running IO intensive -applications where corruption must be avoided, e.g. a banks databases. - - -Signed-off-by: Roberto Angelino <robertangelino@gmail.com> - - ---- - arch/x86/kernel/dumpstack.c | 1 + - arch/x86/kernel/traps.c | 3 +++ - include/linux/kernel.h | 1 + - include/linux/sysctl.h | 1 + - kernel/sysctl.c | 8 ++++++++ - kernel/sysctl_check.c | 1 + - 6 files changed, 15 insertions(+) - ---- a/arch/x86/kernel/dumpstack.c -+++ b/arch/x86/kernel/dumpstack.c -@@ -22,6 +22,7 @@ - #include "dumpstack.h" - - int panic_on_unrecovered_nmi; -+int panic_on_io_nmi; - unsigned int code_bytes = 64; - int kstack_depth_to_print = 3 * STACKSLOTS_PER_LINE; - static int die_counter; ---- a/arch/x86/kernel/traps.c -+++ b/arch/x86/kernel/traps.c -@@ -346,6 +346,9 @@ io_check_error(unsigned char reason, str - printk(KERN_EMERG "NMI: IOCK error (debug interrupt?)\n"); - show_registers(regs); - -+ if (panic_on_io_nmi) -+ panic("NMI IOCK error: Not continuing"); -+ - /* Re-enable the IOCK line, wait for a few seconds */ - reason = (reason & 0xf) | 8; - outb(reason, 0x61); ---- a/include/linux/kernel.h -+++ b/include/linux/kernel.h -@@ -303,6 +303,7 @@ extern int oops_in_progress; /* If set, - extern int panic_timeout; - extern int panic_on_oops; - extern int panic_on_unrecovered_nmi; -+extern int panic_on_io_nmi; - extern const char *print_tainted(void); - extern void add_taint(unsigned flag); - extern int test_taint(unsigned flag); ---- a/include/linux/sysctl.h -+++ b/include/linux/sysctl.h -@@ -163,6 +163,7 @@ enum - KERN_MAX_LOCK_DEPTH=74, - KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */ - KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */ -+ KERN_PANIC_ON_IO_NMI=77, /* int: whether we will panic on an io NMI */ - }; - - ---- a/kernel/sysctl.c -+++ b/kernel/sysctl.c -@@ -744,6 +744,14 @@ static struct ctl_table kern_table[] = { - .proc_handler = &proc_dointvec, - }, - { -+ .ctl_name = KERN_PANIC_ON_IO_NMI, -+ .procname = "panic_on_io_nmi", -+ .data = &panic_on_io_nmi, -+ .maxlen = sizeof(int), -+ .mode = 0644, -+ .proc_handler = &proc_dointvec, -+ }, -+ { - .ctl_name = KERN_BOOTLOADER_TYPE, - .procname = "bootloader_type", - .data = &bootloader_type, ---- a/kernel/sysctl_check.c -+++ b/kernel/sysctl_check.c -@@ -104,6 +104,7 @@ static const struct trans_ctl_table tran - { KERN_MAX_LOCK_DEPTH, "max_lock_depth" }, - { KERN_NMI_WATCHDOG, "nmi_watchdog" }, - { KERN_PANIC_ON_NMI, "panic_on_unrecovered_nmi" }, -+ { KERN_PANIC_ON_IO_NMI, "panic_on_io_nmi" }, - {} - }; - diff --git a/pending/usb-fix-usage-count-in-usb-serial-generic-open-regarding-autoresume.patch b/pending/usb-fix-usage-count-in-usb-serial-generic-open-regarding-autoresume.patch deleted file mode 100644 index 71bff70ea2a4af..00000000000000 --- a/pending/usb-fix-usage-count-in-usb-serial-generic-open-regarding-autoresume.patch +++ /dev/null @@ -1,60 +0,0 @@ -From oliver@neukum.org Sat Jul 18 15:45:44 2009 -From: Oliver Neukum <oliver@neukum.org> -Date: Sat, 18 Jul 2009 15:47:17 +0200 -Subject: USB: fix usage count in usb serial generic open regarding autoresume -To: Matthew Garrett <mjg59@srcf.ucam.org>, Greg KH <greg@kroah.com>, Alan Stern <stern@rowland.harvard.edu>, linux-usb@vger.kernel.org -Message-ID: <200907181547.17813.oliver@neukum.org> -Content-Disposition: inline - - -The resume handler has to resubmit the reading URBs if the device is -resumed while opened. But the open() method bumps the counter before -it resumes a device. The fix is to increment the counter only after -the resumption or if no resumption is attempted. - -Signed-off-by: Oliver Neukum <oliver@neukum.org> -Tested-by: Matthew Garrett <mjg@redhat.com> -Cc: stable <stable@kernel.org> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - - ---- - drivers/usb/serial/usb-serial.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - ---- a/drivers/usb/serial/usb-serial.c -+++ b/drivers/usb/serial/usb-serial.c -@@ -214,15 +214,13 @@ static int serial_open (struct tty_struc - goto bailout_port_put; - } - -- ++port->port.count; -- - /* set up our port structure making the tty driver - * remember our port object, and us it */ - tty->driver_data = port; - tty_port_tty_set(&port->port, tty); - - /* If the console is attached, the device is already open */ -- if (port->port.count == 1 && !port->console) { -+ if (!port->port.count && !port->console) { - - /* lock this module before we call it - * this may fail, which means we must bail out, -@@ -240,12 +238,16 @@ static int serial_open (struct tty_struc - if (retval) - goto bailout_module_put; - -+ ++port->port.count; -+ - /* only call the device specific open if this - * is the first time the port is opened */ - retval = serial->type->open(tty, port, filp); - if (retval) - goto bailout_interface_put; - mutex_unlock(&serial->disc_mutex); -+ } else { -+ ++port->port.count; - } - mutex_unlock(&port->mutex); - /* Now do the correct tty layer semantics */ diff --git a/pending/usb-gotemp.patch b/pending/usb-gotemp.patch index 87a0b37d52dbbc..c1bcfef73e9650 100644 --- a/pending/usb-gotemp.patch +++ b/pending/usb-gotemp.patch @@ -13,11 +13,36 @@ instead for this device. This is only a teaching tool. --- - drivers/usb/misc/Kconfig | 8 + + drivers/usb/misc/Kconfig | 9 + drivers/usb/misc/Makefile | 1 drivers/usb/misc/gotemp.c | 301 ++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 310 insertions(+) + 3 files changed, 311 insertions(+) +--- a/drivers/usb/misc/Kconfig ++++ b/drivers/usb/misc/Kconfig +@@ -244,3 +244,12 @@ config USB_YUREX + To compile this driver as a module, choose M here: the + module will be called yurex. + ++config USB_GOTEMP ++ tristate "GoTemp USB thermometer driver support" ++ depends on USB ++ help ++ Say Y here if you want to connect a GoTemp USB thermometer ++ device to your computer's USB port. ++ ++ To compile this driver as a module, choose M here: the ++ module will be called gotemp. +--- a/drivers/usb/misc/Makefile ++++ b/drivers/usb/misc/Makefile +@@ -12,6 +12,7 @@ obj-$(CONFIG_USB_CYTHERM) += cytherm.o + obj-$(CONFIG_USB_EMI26) += emi26.o + obj-$(CONFIG_USB_EMI62) += emi62.o + obj-$(CONFIG_USB_FTDI_ELAN) += ftdi-elan.o ++obj-$(CONFIG_USB_GOTEMP) += gotemp.o + obj-$(CONFIG_USB_IDMOUSE) += idmouse.o + obj-$(CONFIG_USB_IOWARRIOR) += iowarrior.o + obj-$(CONFIG_USB_ISIGHTFW) += isight_firmware.o --- /dev/null +++ b/drivers/usb/misc/gotemp.c @@ -0,0 +1,301 @@ @@ -322,28 +347,3 @@ This is only a teaching tool. +MODULE_AUTHOR(DRIVER_AUTHOR); +MODULE_DESCRIPTION(DRIVER_DESC); +MODULE_LICENSE("GPL"); ---- a/drivers/usb/misc/Kconfig -+++ b/drivers/usb/misc/Kconfig -@@ -255,4 +255,12 @@ config USB_VST - To compile this driver as a module, choose M here: the - module will be called vstusb. - -+config USB_GOTEMP -+ tristate "GoTemp USB thermometer driver support" -+ depends on USB -+ help -+ Say Y here if you want to connect a GoTemp USB thermometer -+ device to your computer's USB port. - -+ To compile this driver as a module, choose M here: the -+ module will be called gotemp. ---- a/drivers/usb/misc/Makefile -+++ b/drivers/usb/misc/Makefile -@@ -11,6 +11,7 @@ obj-$(CONFIG_USB_CYTHERM) += cytherm.o - obj-$(CONFIG_USB_EMI26) += emi26.o - obj-$(CONFIG_USB_EMI62) += emi62.o - obj-$(CONFIG_USB_FTDI_ELAN) += ftdi-elan.o -+obj-$(CONFIG_USB_GOTEMP) += gotemp.o - obj-$(CONFIG_USB_IDMOUSE) += idmouse.o - obj-$(CONFIG_USB_IOWARRIOR) += iowarrior.o - obj-$(CONFIG_USB_ISIGHTFW) += isight_firmware.o diff --git a/pending/x86-detect-running-on-a-hyperv-system.patch b/pending/x86-detect-running-on-a-hyperv-system.patch deleted file mode 100644 index 15282ab5104343..00000000000000 --- a/pending/x86-detect-running-on-a-hyperv-system.patch +++ /dev/null @@ -1,208 +0,0 @@ -From ksrinivasan@novell.com Wed Apr 28 13:36:10 2010 -From: Ky Srinivasan <ksrinivasan@novell.com> -Date: Wed, 28 Apr 2010 14:36:05 -0600 -Subject: x86: detect running on a HyperV system -To: <devel@driverdev.osuosl.org> -Cc: "Haiyang Zhang" <haiyangz@microsoft.com>, "Hank Janssen" <hjanssen@microsoft.com>, "Greg KH" <gregkh@suse.de> -Message-ID: <4BD857BE.E57C.0030.1@novell.com> - -From: Ky Srinivasan <ksrinivasan@novell.com> - -This patch integrates HyperV detection within the framework currently used by -VmWare. With this patch, we can avoid having to replicate the HyperV detection -code in each of the HyperV specific Linux drivers - MSFT Linux Integration -Components. - -Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com> -Cc: Thomas Gleixner <tglx@linutronix.de> -Cc: Ingo Molnar <mingo@redhat.com> -Cc: "H. Peter Anvin" <hpa@zytor.com> -Cc: Vadim Rozenfeld <vrozenfe@redhat.com> -Cc: Avi Kivity <avi@redhat.com> -Cc: Gleb Natapov <gleb@redhat.com> -Cc: Frederic Weisbecker <fweisbec@gmail.com> -Cc: Alexey Dobriyan <adobriyan@gmail.com> -Cc: "K.Prasad" <prasad@linux.vnet.ibm.com> -Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> -Cc: Stephane Eranian <eranian@google.com> -Cc: Paul Mackerras <paulus@samba.org> -Cc: Alan Cox <alan@linux.intel.com> -Cc: Haiyang Zhang <haiyangz@microsoft.com> -Cc: Hank Janssen <hjanssen@microsoft.com> -Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> - ---- - arch/x86/include/asm/hyperv.h | 6 +++ - arch/x86/include/asm/mshyperv.h | 7 ++++ - arch/x86/include/asm/processor.h | 3 + - arch/x86/kernel/cpu/Makefile | 2 - - arch/x86/kernel/cpu/hypervisor.c | 10 ++++- - arch/x86/kernel/cpu/mshyperv.c | 67 +++++++++++++++++++++++++++++++++++++++ - 6 files changed, 91 insertions(+), 4 deletions(-) - ---- a/arch/x86/include/asm/hyperv.h -+++ b/arch/x86/include/asm/hyperv.h -@@ -14,6 +14,9 @@ - #define HYPERV_CPUID_ENLIGHTMENT_INFO 0x40000004 - #define HYPERV_CPUID_IMPLEMENT_LIMITS 0x40000005 - -+#define HYPERV_HYPERVISOR_PRESENT_BIT 0x80000000 -+#define HYPERV_CPUID_MIN 0x40000005 -+ - /* - * Feature identification. EAX indicates which features are available - * to the partition based upon the current partition privileges. -@@ -129,6 +132,9 @@ - /* MSR used to provide vcpu index */ - #define HV_X64_MSR_VP_INDEX 0x40000002 - -+/* MSR used to read the per-partition time reference counter */ -+#define HV_X64_MSR_TIME_REF_COUNT 0x40000020 -+ - /* Define the virtual APIC registers */ - #define HV_X64_MSR_EOI 0x40000070 - #define HV_X64_MSR_ICR 0x40000071 ---- /dev/null -+++ b/arch/x86/include/asm/mshyperv.h -@@ -0,0 +1,7 @@ -+#ifndef ASM_X86__MSHYPER_H -+#define ASM_X86__MSHYPER_H -+ -+int ms_hyperv_platform(void); -+void __cpuinit ms_hyperv_set_feature_bits(struct cpuinfo_x86 *c); -+ -+#endif ---- a/arch/x86/include/asm/processor.h -+++ b/arch/x86/include/asm/processor.h -@@ -114,6 +114,8 @@ struct cpuinfo_x86 { - u16 cpu_index; - #endif - unsigned int x86_hyper_vendor; -+ /* The layout of this field is hypervisor specific */ -+ unsigned int x86_hyper_features; - } __attribute__((__aligned__(SMP_CACHE_BYTES))); - - #define X86_VENDOR_INTEL 0 -@@ -129,6 +131,7 @@ struct cpuinfo_x86 { - - #define X86_HYPER_VENDOR_NONE 0 - #define X86_HYPER_VENDOR_VMWARE 1 -+#define X86_HYPER_VENDOR_MSFT 2 - - /* - * capabilities of CPUs ---- a/arch/x86/kernel/cpu/Makefile -+++ b/arch/x86/kernel/cpu/Makefile -@@ -14,7 +14,7 @@ CFLAGS_common.o := $(nostackp) - - obj-y := intel_cacheinfo.o addon_cpuid_features.o - obj-y += proc.o capflags.o powerflags.o common.o --obj-y += vmware.o hypervisor.o sched.o -+obj-y += vmware.o hypervisor.o sched.o mshyperv.o - - obj-$(CONFIG_X86_32) += bugs.o cmpxchg.o - obj-$(CONFIG_X86_64) += bugs_64.o ---- a/arch/x86/kernel/cpu/hypervisor.c -+++ b/arch/x86/kernel/cpu/hypervisor.c -@@ -23,6 +23,7 @@ - - #include <asm/processor.h> - #include <asm/vmware.h> -+#include <asm/mshyperv.h> - #include <asm/hypervisor.h> - - static inline void __cpuinit -@@ -30,6 +31,8 @@ detect_hypervisor_vendor(struct cpuinfo_ - { - if (vmware_platform()) - c->x86_hyper_vendor = X86_HYPER_VENDOR_VMWARE; -+ else if (ms_hyperv_platform()) -+ c->x86_hyper_vendor = X86_HYPER_VENDOR_MSFT; - else - c->x86_hyper_vendor = X86_HYPER_VENDOR_NONE; - } -@@ -37,10 +40,11 @@ detect_hypervisor_vendor(struct cpuinfo_ - static inline void __cpuinit - hypervisor_set_feature_bits(struct cpuinfo_x86 *c) - { -- if (boot_cpu_data.x86_hyper_vendor == X86_HYPER_VENDOR_VMWARE) { -+ if (boot_cpu_data.x86_hyper_vendor == X86_HYPER_VENDOR_VMWARE) - vmware_set_feature_bits(c); -- return; -- } -+ else if (boot_cpu_data.x86_hyper_vendor == X86_HYPER_VENDOR_MSFT) -+ ms_hyperv_set_feature_bits(c); -+ return; - } - - void __cpuinit init_hypervisor(struct cpuinfo_x86 *c) ---- /dev/null -+++ b/arch/x86/kernel/cpu/mshyperv.c -@@ -0,0 +1,67 @@ -+/* -+ * HyperV Detection code. -+ * -+ * Copyright (C) 2010, Novell, Inc. -+ * Author : K. Y. Srinivasan <ksrinivasan@novell.com> -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or -+ * NON INFRINGEMENT. See the GNU General Public License for more -+ * details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ */ -+ -+#include <linux/types.h> -+#include <asm/processor.h> -+#include <asm/hyperv.h> -+#include <asm/mshyperv.h> -+ -+ -+int ms_hyperv_platform(void) -+{ -+ u32 eax, ebx, ecx, edx; -+ char hyp_signature[13]; -+ -+ cpuid(1, &eax, &ebx, &ecx, &edx); -+ if (!(ecx & HYPERV_HYPERVISOR_PRESENT_BIT)) -+ return 0; -+ -+ cpuid(HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS, &eax, &ebx, &ecx, &edx); -+ *(u32 *)(hyp_signature + 0) = ebx; -+ *(u32 *)(hyp_signature + 4) = ecx; -+ *(u32 *)(hyp_signature + 8) = edx; -+ -+ if ((eax < HYPERV_CPUID_MIN) || (memcmp("Microsoft Hv", hyp_signature, 12))) -+ return 0; -+ return 1; -+} -+ -+void __cpuinit ms_hyperv_set_feature_bits(struct cpuinfo_x86 *c) -+{ -+ u32 eax, ebx, ecx, edx; -+ -+ c->x86_hyper_features = 0; -+ /* -+ * Extract the features, recommendations etc. -+ * The first 9 bits will be used to track hypervisor features. -+ * The next 6 bits will be used to track the hypervisor -+ * recommendations. -+ */ -+ cpuid(HYPERV_CPUID_FEATURES, &eax, &ebx, &ecx, &edx); -+ c->x86_hyper_features |= (eax & 0x1ff); -+ -+ cpuid(HYPERV_CPUID_ENLIGHTMENT_INFO, &eax, &ebx, &ecx, &edx); -+ c->x86_hyper_features |= ((eax & 0x3f) << 9); -+ printk(KERN_INFO "Detected HyperV with features: %x\n", -+ c->x86_hyper_features); -+} |