diff options
Diffstat (limited to 'drivers')
82 files changed, 439 insertions, 271 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index 1977d4beb89e..7ecb1938e590 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/kallsyms.h> | 22 | #include <linux/kallsyms.h> |
23 | #include <linux/semaphore.h> | 23 | #include <linux/semaphore.h> |
24 | #include <linux/mutex.h> | 24 | #include <linux/mutex.h> |
25 | #include <linux/async.h> | ||
25 | 26 | ||
26 | #include "base.h" | 27 | #include "base.h" |
27 | #include "power/power.h" | 28 | #include "power/power.h" |
@@ -161,10 +162,18 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj, | |||
161 | struct device *dev = to_dev(kobj); | 162 | struct device *dev = to_dev(kobj); |
162 | int retval = 0; | 163 | int retval = 0; |
163 | 164 | ||
164 | /* add the major/minor if present */ | 165 | /* add device node properties if present */ |
165 | if (MAJOR(dev->devt)) { | 166 | if (MAJOR(dev->devt)) { |
167 | const char *tmp; | ||
168 | const char *name; | ||
169 | |||
166 | add_uevent_var(env, "MAJOR=%u", MAJOR(dev->devt)); | 170 | add_uevent_var(env, "MAJOR=%u", MAJOR(dev->devt)); |
167 | add_uevent_var(env, "MINOR=%u", MINOR(dev->devt)); | 171 | add_uevent_var(env, "MINOR=%u", MINOR(dev->devt)); |
172 | name = device_get_nodename(dev, &tmp); | ||
173 | if (name) { | ||
174 | add_uevent_var(env, "DEVNAME=%s", name); | ||
175 | kfree(tmp); | ||
176 | } | ||
168 | } | 177 | } |
169 | 178 | ||
170 | if (dev->type && dev->type->name) | 179 | if (dev->type && dev->type->name) |
@@ -874,7 +883,7 @@ int device_add(struct device *dev) | |||
874 | * the name, and force the use of dev_name() | 883 | * the name, and force the use of dev_name() |
875 | */ | 884 | */ |
876 | if (dev->init_name) { | 885 | if (dev->init_name) { |
877 | dev_set_name(dev, dev->init_name); | 886 | dev_set_name(dev, "%s", dev->init_name); |
878 | dev->init_name = NULL; | 887 | dev->init_name = NULL; |
879 | } | 888 | } |
880 | 889 | ||
@@ -1128,6 +1137,47 @@ static struct device *next_device(struct klist_iter *i) | |||
1128 | } | 1137 | } |
1129 | 1138 | ||
1130 | /** | 1139 | /** |
1140 | * device_get_nodename - path of device node file | ||
1141 | * @dev: device | ||
1142 | * @tmp: possibly allocated string | ||
1143 | * | ||
1144 | * Return the relative path of a possible device node. | ||
1145 | * Non-default names may need to allocate a memory to compose | ||
1146 | * a name. This memory is returned in tmp and needs to be | ||
1147 | * freed by the caller. | ||
1148 | */ | ||
1149 | const char *device_get_nodename(struct device *dev, const char **tmp) | ||
1150 | { | ||
1151 | char *s; | ||
1152 | |||
1153 | *tmp = NULL; | ||
1154 | |||
1155 | /* the device type may provide a specific name */ | ||
1156 | if (dev->type && dev->type->nodename) | ||
1157 | *tmp = dev->type->nodename(dev); | ||
1158 | if (*tmp) | ||
1159 | return *tmp; | ||
1160 | |||
1161 | /* the class may provide a specific name */ | ||
1162 | if (dev->class && dev->class->nodename) | ||
1163 | *tmp = dev->class->nodename(dev); | ||
1164 | if (*tmp) | ||
1165 | return *tmp; | ||
1166 | |||
1167 | /* return name without allocation, tmp == NULL */ | ||
1168 | if (strchr(dev_name(dev), '!') == NULL) | ||
1169 | return dev_name(dev); | ||
1170 | |||
1171 | /* replace '!' in the name with '/' */ | ||
1172 | *tmp = kstrdup(dev_name(dev), GFP_KERNEL); | ||
1173 | if (!*tmp) | ||
1174 | return NULL; | ||
1175 | while ((s = strchr(*tmp, '!'))) | ||
1176 | s[0] = '/'; | ||
1177 | return *tmp; | ||
1178 | } | ||
1179 | |||
1180 | /** | ||
1131 | * device_for_each_child - device child iterator. | 1181 | * device_for_each_child - device child iterator. |
1132 | * @parent: parent struct device. | 1182 | * @parent: parent struct device. |
1133 | * @data: data for the callback. | 1183 | * @data: data for the callback. |
@@ -1271,7 +1321,7 @@ struct device *__root_device_register(const char *name, struct module *owner) | |||
1271 | if (!root) | 1321 | if (!root) |
1272 | return ERR_PTR(err); | 1322 | return ERR_PTR(err); |
1273 | 1323 | ||
1274 | err = dev_set_name(&root->dev, name); | 1324 | err = dev_set_name(&root->dev, "%s", name); |
1275 | if (err) { | 1325 | if (err) { |
1276 | kfree(root); | 1326 | kfree(root); |
1277 | return ERR_PTR(err); | 1327 | return ERR_PTR(err); |
@@ -1665,4 +1715,5 @@ void device_shutdown(void) | |||
1665 | kobject_put(sysfs_dev_char_kobj); | 1715 | kobject_put(sysfs_dev_char_kobj); |
1666 | kobject_put(sysfs_dev_block_kobj); | 1716 | kobject_put(sysfs_dev_block_kobj); |
1667 | kobject_put(dev_kobj); | 1717 | kobject_put(dev_kobj); |
1718 | async_synchronize_full(); | ||
1668 | } | 1719 | } |
diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 742cbe6b042b..f0106875f01d 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c | |||
@@ -226,7 +226,7 @@ static int __device_attach(struct device_driver *drv, void *data) | |||
226 | * pair is found, break out and return. | 226 | * pair is found, break out and return. |
227 | * | 227 | * |
228 | * Returns 1 if the device was bound to a driver; | 228 | * Returns 1 if the device was bound to a driver; |
229 | * 0 if no matching device was found; | 229 | * 0 if no matching driver was found; |
230 | * -ENODEV if the device is not registered. | 230 | * -ENODEV if the device is not registered. |
231 | * | 231 | * |
232 | * When called for a USB interface, @dev->parent->sem must be held. | 232 | * When called for a USB interface, @dev->parent->sem must be held. |
@@ -320,6 +320,10 @@ static void __device_release_driver(struct device *dev) | |||
320 | devres_release_all(dev); | 320 | devres_release_all(dev); |
321 | dev->driver = NULL; | 321 | dev->driver = NULL; |
322 | klist_remove(&dev->p->knode_driver); | 322 | klist_remove(&dev->p->knode_driver); |
323 | if (dev->bus) | ||
324 | blocking_notifier_call_chain(&dev->bus->p->bus_notifier, | ||
325 | BUS_NOTIFY_UNBOUND_DRIVER, | ||
326 | dev); | ||
323 | } | 327 | } |
324 | } | 328 | } |
325 | 329 | ||
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 8a267c427629..ddeb819c8f87 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
@@ -40,7 +40,7 @@ static int loading_timeout = 60; /* In seconds */ | |||
40 | static DEFINE_MUTEX(fw_lock); | 40 | static DEFINE_MUTEX(fw_lock); |
41 | 41 | ||
42 | struct firmware_priv { | 42 | struct firmware_priv { |
43 | char fw_id[FIRMWARE_NAME_MAX]; | 43 | char *fw_id; |
44 | struct completion completion; | 44 | struct completion completion; |
45 | struct bin_attribute attr_data; | 45 | struct bin_attribute attr_data; |
46 | struct firmware *fw; | 46 | struct firmware *fw; |
@@ -355,8 +355,9 @@ static void fw_dev_release(struct device *dev) | |||
355 | for (i = 0; i < fw_priv->nr_pages; i++) | 355 | for (i = 0; i < fw_priv->nr_pages; i++) |
356 | __free_page(fw_priv->pages[i]); | 356 | __free_page(fw_priv->pages[i]); |
357 | kfree(fw_priv->pages); | 357 | kfree(fw_priv->pages); |
358 | kfree(fw_priv->fw_id); | ||
358 | kfree(fw_priv); | 359 | kfree(fw_priv); |
359 | kfree(dev); | 360 | put_device(dev); |
360 | 361 | ||
361 | module_put(THIS_MODULE); | 362 | module_put(THIS_MODULE); |
362 | } | 363 | } |
@@ -386,13 +387,19 @@ static int fw_register_device(struct device **dev_p, const char *fw_name, | |||
386 | 387 | ||
387 | init_completion(&fw_priv->completion); | 388 | init_completion(&fw_priv->completion); |
388 | fw_priv->attr_data = firmware_attr_data_tmpl; | 389 | fw_priv->attr_data = firmware_attr_data_tmpl; |
389 | strlcpy(fw_priv->fw_id, fw_name, FIRMWARE_NAME_MAX); | 390 | fw_priv->fw_id = kstrdup(fw_name, GFP_KERNEL); |
391 | if (!fw_priv->fw_id) { | ||
392 | dev_err(device, "%s: Firmware name allocation failed\n", | ||
393 | __func__); | ||
394 | retval = -ENOMEM; | ||
395 | goto error_kfree; | ||
396 | } | ||
390 | 397 | ||
391 | fw_priv->timeout.function = firmware_class_timeout; | 398 | fw_priv->timeout.function = firmware_class_timeout; |
392 | fw_priv->timeout.data = (u_long) fw_priv; | 399 | fw_priv->timeout.data = (u_long) fw_priv; |
393 | init_timer(&fw_priv->timeout); | 400 | init_timer(&fw_priv->timeout); |
394 | 401 | ||
395 | dev_set_name(f_dev, dev_name(device)); | 402 | dev_set_name(f_dev, "%s", dev_name(device)); |
396 | f_dev->parent = device; | 403 | f_dev->parent = device; |
397 | f_dev->class = &firmware_class; | 404 | f_dev->class = &firmware_class; |
398 | dev_set_drvdata(f_dev, fw_priv); | 405 | dev_set_drvdata(f_dev, fw_priv); |
@@ -400,14 +407,17 @@ static int fw_register_device(struct device **dev_p, const char *fw_name, | |||
400 | retval = device_register(f_dev); | 407 | retval = device_register(f_dev); |
401 | if (retval) { | 408 | if (retval) { |
402 | dev_err(device, "%s: device_register failed\n", __func__); | 409 | dev_err(device, "%s: device_register failed\n", __func__); |
403 | goto error_kfree; | 410 | put_device(f_dev); |
411 | goto error_kfree_fw_id; | ||
404 | } | 412 | } |
405 | *dev_p = f_dev; | 413 | *dev_p = f_dev; |
406 | return 0; | 414 | return 0; |
407 | 415 | ||
416 | error_kfree_fw_id: | ||
417 | kfree(fw_priv->fw_id); | ||
408 | error_kfree: | 418 | error_kfree: |
409 | kfree(fw_priv); | ||
410 | kfree(f_dev); | 419 | kfree(f_dev); |
420 | kfree(fw_priv); | ||
411 | return retval; | 421 | return retval; |
412 | } | 422 | } |
413 | 423 | ||
@@ -615,8 +625,9 @@ request_firmware_work_func(void *arg) | |||
615 | * @cont: function will be called asynchronously when the firmware | 625 | * @cont: function will be called asynchronously when the firmware |
616 | * request is over. | 626 | * request is over. |
617 | * | 627 | * |
618 | * Asynchronous variant of request_firmware() for contexts where | 628 | * Asynchronous variant of request_firmware() for user contexts where |
619 | * it is not possible to sleep. | 629 | * it is not possible to sleep for long time. It can't be called |
630 | * in atomic contexts. | ||
620 | **/ | 631 | **/ |
621 | int | 632 | int |
622 | request_firmware_nowait( | 633 | request_firmware_nowait( |
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index ead3f64c41d0..81cb01bfc356 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -69,7 +69,8 @@ EXPORT_SYMBOL_GPL(platform_get_irq); | |||
69 | * @name: resource name | 69 | * @name: resource name |
70 | */ | 70 | */ |
71 | struct resource *platform_get_resource_byname(struct platform_device *dev, | 71 | struct resource *platform_get_resource_byname(struct platform_device *dev, |
72 | unsigned int type, char *name) | 72 | unsigned int type, |
73 | const char *name) | ||
73 | { | 74 | { |
74 | int i; | 75 | int i; |
75 | 76 | ||
@@ -88,7 +89,7 @@ EXPORT_SYMBOL_GPL(platform_get_resource_byname); | |||
88 | * @dev: platform device | 89 | * @dev: platform device |
89 | * @name: IRQ name | 90 | * @name: IRQ name |
90 | */ | 91 | */ |
91 | int platform_get_irq_byname(struct platform_device *dev, char *name) | 92 | int platform_get_irq_byname(struct platform_device *dev, const char *name) |
92 | { | 93 | { |
93 | struct resource *r = platform_get_resource_byname(dev, IORESOURCE_IRQ, | 94 | struct resource *r = platform_get_resource_byname(dev, IORESOURCE_IRQ, |
94 | name); | 95 | name); |
@@ -244,7 +245,7 @@ int platform_device_add(struct platform_device *pdev) | |||
244 | if (pdev->id != -1) | 245 | if (pdev->id != -1) |
245 | dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id); | 246 | dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id); |
246 | else | 247 | else |
247 | dev_set_name(&pdev->dev, pdev->name); | 248 | dev_set_name(&pdev->dev, "%s", pdev->name); |
248 | 249 | ||
249 | for (i = 0; i < pdev->num_resources; i++) { | 250 | for (i = 0; i < pdev->num_resources; i++) { |
250 | struct resource *p, *r = &pdev->resource[i]; | 251 | struct resource *p, *r = &pdev->resource[i]; |
diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 9742a78c9fe4..79a9ae5238ac 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c | |||
@@ -131,6 +131,8 @@ static struct kset *system_kset; | |||
131 | 131 | ||
132 | int sysdev_class_register(struct sysdev_class *cls) | 132 | int sysdev_class_register(struct sysdev_class *cls) |
133 | { | 133 | { |
134 | int retval; | ||
135 | |||
134 | pr_debug("Registering sysdev class '%s'\n", cls->name); | 136 | pr_debug("Registering sysdev class '%s'\n", cls->name); |
135 | 137 | ||
136 | INIT_LIST_HEAD(&cls->drivers); | 138 | INIT_LIST_HEAD(&cls->drivers); |
@@ -138,7 +140,11 @@ int sysdev_class_register(struct sysdev_class *cls) | |||
138 | cls->kset.kobj.parent = &system_kset->kobj; | 140 | cls->kset.kobj.parent = &system_kset->kobj; |
139 | cls->kset.kobj.ktype = &ktype_sysdev_class; | 141 | cls->kset.kobj.ktype = &ktype_sysdev_class; |
140 | cls->kset.kobj.kset = system_kset; | 142 | cls->kset.kobj.kset = system_kset; |
141 | kobject_set_name(&cls->kset.kobj, cls->name); | 143 | |
144 | retval = kobject_set_name(&cls->kset.kobj, "%s", cls->name); | ||
145 | if (retval) | ||
146 | return retval; | ||
147 | |||
142 | return kset_register(&cls->kset); | 148 | return kset_register(&cls->kset); |
143 | } | 149 | } |
144 | 150 | ||
diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c index 200efc4d2c1e..19888354188f 100644 --- a/drivers/block/aoe/aoechr.c +++ b/drivers/block/aoe/aoechr.c | |||
@@ -266,6 +266,11 @@ static const struct file_operations aoe_fops = { | |||
266 | .owner = THIS_MODULE, | 266 | .owner = THIS_MODULE, |
267 | }; | 267 | }; |
268 | 268 | ||
269 | static char *aoe_nodename(struct device *dev) | ||
270 | { | ||
271 | return kasprintf(GFP_KERNEL, "etherd/%s", dev_name(dev)); | ||
272 | } | ||
273 | |||
269 | int __init | 274 | int __init |
270 | aoechr_init(void) | 275 | aoechr_init(void) |
271 | { | 276 | { |
@@ -283,6 +288,8 @@ aoechr_init(void) | |||
283 | unregister_chrdev(AOE_MAJOR, "aoechr"); | 288 | unregister_chrdev(AOE_MAJOR, "aoechr"); |
284 | return PTR_ERR(aoe_class); | 289 | return PTR_ERR(aoe_class); |
285 | } | 290 | } |
291 | aoe_class->nodename = aoe_nodename; | ||
292 | |||
286 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) | 293 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) |
287 | device_create(aoe_class, NULL, | 294 | device_create(aoe_class, NULL, |
288 | MKDEV(AOE_MAJOR, chardevs[i].minor), NULL, | 295 | MKDEV(AOE_MAJOR, chardevs[i].minor), NULL, |
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index d57f11759480..83650e00632d 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -430,7 +430,7 @@ static void pkt_sysfs_cleanup(void) | |||
430 | /******************************************************************** | 430 | /******************************************************************** |
431 | entries in debugfs | 431 | entries in debugfs |
432 | 432 | ||
433 | /debugfs/pktcdvd[0-7]/ | 433 | /sys/kernel/debug/pktcdvd[0-7]/ |
434 | info | 434 | info |
435 | 435 | ||
436 | *******************************************************************/ | 436 | *******************************************************************/ |
@@ -2855,6 +2855,11 @@ static struct block_device_operations pktcdvd_ops = { | |||
2855 | .media_changed = pkt_media_changed, | 2855 | .media_changed = pkt_media_changed, |
2856 | }; | 2856 | }; |
2857 | 2857 | ||
2858 | static char *pktcdvd_nodename(struct gendisk *gd) | ||
2859 | { | ||
2860 | return kasprintf(GFP_KERNEL, "pktcdvd/%s", gd->disk_name); | ||
2861 | } | ||
2862 | |||
2858 | /* | 2863 | /* |
2859 | * Set up mapping from pktcdvd device to CD-ROM device. | 2864 | * Set up mapping from pktcdvd device to CD-ROM device. |
2860 | */ | 2865 | */ |
@@ -2907,6 +2912,7 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev) | |||
2907 | disk->fops = &pktcdvd_ops; | 2912 | disk->fops = &pktcdvd_ops; |
2908 | disk->flags = GENHD_FL_REMOVABLE; | 2913 | disk->flags = GENHD_FL_REMOVABLE; |
2909 | strcpy(disk->disk_name, pd->name); | 2914 | strcpy(disk->disk_name, pd->name); |
2915 | disk->nodename = pktcdvd_nodename; | ||
2910 | disk->private_data = pd; | 2916 | disk->private_data = pd; |
2911 | disk->queue = blk_alloc_queue(GFP_KERNEL); | 2917 | disk->queue = blk_alloc_queue(GFP_KERNEL); |
2912 | if (!disk->queue) | 2918 | if (!disk->queue) |
@@ -3062,6 +3068,7 @@ static const struct file_operations pkt_ctl_fops = { | |||
3062 | static struct miscdevice pkt_misc = { | 3068 | static struct miscdevice pkt_misc = { |
3063 | .minor = MISC_DYNAMIC_MINOR, | 3069 | .minor = MISC_DYNAMIC_MINOR, |
3064 | .name = DRIVER_NAME, | 3070 | .name = DRIVER_NAME, |
3071 | .name = "pktcdvd/control", | ||
3065 | .fops = &pkt_ctl_fops | 3072 | .fops = &pkt_ctl_fops |
3066 | }; | 3073 | }; |
3067 | 3074 | ||
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index c1996829d5ec..e53284767f7c 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -753,12 +753,12 @@ static int blkfront_probe(struct xenbus_device *dev, | |||
753 | 753 | ||
754 | /* Front end dir is a number, which is used as the id. */ | 754 | /* Front end dir is a number, which is used as the id. */ |
755 | info->handle = simple_strtoul(strrchr(dev->nodename, '/')+1, NULL, 0); | 755 | info->handle = simple_strtoul(strrchr(dev->nodename, '/')+1, NULL, 0); |
756 | dev->dev.driver_data = info; | 756 | dev_set_drvdata(&dev->dev, info); |
757 | 757 | ||
758 | err = talk_to_backend(dev, info); | 758 | err = talk_to_backend(dev, info); |
759 | if (err) { | 759 | if (err) { |
760 | kfree(info); | 760 | kfree(info); |
761 | dev->dev.driver_data = NULL; | 761 | dev_set_drvdata(&dev->dev, NULL); |
762 | return err; | 762 | return err; |
763 | } | 763 | } |
764 | 764 | ||
@@ -843,7 +843,7 @@ static int blkif_recover(struct blkfront_info *info) | |||
843 | */ | 843 | */ |
844 | static int blkfront_resume(struct xenbus_device *dev) | 844 | static int blkfront_resume(struct xenbus_device *dev) |
845 | { | 845 | { |
846 | struct blkfront_info *info = dev->dev.driver_data; | 846 | struct blkfront_info *info = dev_get_drvdata(&dev->dev); |
847 | int err; | 847 | int err; |
848 | 848 | ||
849 | dev_dbg(&dev->dev, "blkfront_resume: %s\n", dev->nodename); | 849 | dev_dbg(&dev->dev, "blkfront_resume: %s\n", dev->nodename); |
@@ -922,7 +922,7 @@ static void blkfront_connect(struct blkfront_info *info) | |||
922 | */ | 922 | */ |
923 | static void blkfront_closing(struct xenbus_device *dev) | 923 | static void blkfront_closing(struct xenbus_device *dev) |
924 | { | 924 | { |
925 | struct blkfront_info *info = dev->dev.driver_data; | 925 | struct blkfront_info *info = dev_get_drvdata(&dev->dev); |
926 | unsigned long flags; | 926 | unsigned long flags; |
927 | 927 | ||
928 | dev_dbg(&dev->dev, "blkfront_closing: %s removed\n", dev->nodename); | 928 | dev_dbg(&dev->dev, "blkfront_closing: %s removed\n", dev->nodename); |
@@ -957,7 +957,7 @@ static void blkfront_closing(struct xenbus_device *dev) | |||
957 | static void backend_changed(struct xenbus_device *dev, | 957 | static void backend_changed(struct xenbus_device *dev, |
958 | enum xenbus_state backend_state) | 958 | enum xenbus_state backend_state) |
959 | { | 959 | { |
960 | struct blkfront_info *info = dev->dev.driver_data; | 960 | struct blkfront_info *info = dev_get_drvdata(&dev->dev); |
961 | struct block_device *bd; | 961 | struct block_device *bd; |
962 | 962 | ||
963 | dev_dbg(&dev->dev, "blkfront:backend_changed.\n"); | 963 | dev_dbg(&dev->dev, "blkfront:backend_changed.\n"); |
@@ -997,7 +997,7 @@ static void backend_changed(struct xenbus_device *dev, | |||
997 | 997 | ||
998 | static int blkfront_remove(struct xenbus_device *dev) | 998 | static int blkfront_remove(struct xenbus_device *dev) |
999 | { | 999 | { |
1000 | struct blkfront_info *info = dev->dev.driver_data; | 1000 | struct blkfront_info *info = dev_get_drvdata(&dev->dev); |
1001 | 1001 | ||
1002 | dev_dbg(&dev->dev, "blkfront_remove: %s removed\n", dev->nodename); | 1002 | dev_dbg(&dev->dev, "blkfront_remove: %s removed\n", dev->nodename); |
1003 | 1003 | ||
@@ -1010,7 +1010,7 @@ static int blkfront_remove(struct xenbus_device *dev) | |||
1010 | 1010 | ||
1011 | static int blkfront_is_ready(struct xenbus_device *dev) | 1011 | static int blkfront_is_ready(struct xenbus_device *dev) |
1012 | { | 1012 | { |
1013 | struct blkfront_info *info = dev->dev.driver_data; | 1013 | struct blkfront_info *info = dev_get_drvdata(&dev->dev); |
1014 | 1014 | ||
1015 | return info->is_ready; | 1015 | return info->is_ready; |
1016 | } | 1016 | } |
diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c index c76bccf5354d..7d64e4230e66 100644 --- a/drivers/char/hvcs.c +++ b/drivers/char/hvcs.c | |||
@@ -347,7 +347,7 @@ static void __exit hvcs_module_exit(void); | |||
347 | 347 | ||
348 | static inline struct hvcs_struct *from_vio_dev(struct vio_dev *viod) | 348 | static inline struct hvcs_struct *from_vio_dev(struct vio_dev *viod) |
349 | { | 349 | { |
350 | return viod->dev.driver_data; | 350 | return dev_get_drvdata(&viod->dev); |
351 | } | 351 | } |
352 | /* The sysfs interface for the driver and devices */ | 352 | /* The sysfs interface for the driver and devices */ |
353 | 353 | ||
@@ -785,7 +785,7 @@ static int __devinit hvcs_probe( | |||
785 | kref_init(&hvcsd->kref); | 785 | kref_init(&hvcsd->kref); |
786 | 786 | ||
787 | hvcsd->vdev = dev; | 787 | hvcsd->vdev = dev; |
788 | dev->dev.driver_data = hvcsd; | 788 | dev_set_drvdata(&dev->dev, hvcsd); |
789 | 789 | ||
790 | hvcsd->index = index; | 790 | hvcsd->index = index; |
791 | 791 | ||
@@ -831,7 +831,7 @@ static int __devinit hvcs_probe( | |||
831 | 831 | ||
832 | static int __devexit hvcs_remove(struct vio_dev *dev) | 832 | static int __devexit hvcs_remove(struct vio_dev *dev) |
833 | { | 833 | { |
834 | struct hvcs_struct *hvcsd = dev->dev.driver_data; | 834 | struct hvcs_struct *hvcsd = dev_get_drvdata(&dev->dev); |
835 | unsigned long flags; | 835 | unsigned long flags; |
836 | struct tty_struct *tty; | 836 | struct tty_struct *tty; |
837 | 837 | ||
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index e5d583c84e4f..fc93e2fc7c71 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c | |||
@@ -153,6 +153,7 @@ static const struct file_operations rng_chrdev_ops = { | |||
153 | static struct miscdevice rng_miscdev = { | 153 | static struct miscdevice rng_miscdev = { |
154 | .minor = RNG_MISCDEV_MINOR, | 154 | .minor = RNG_MISCDEV_MINOR, |
155 | .name = RNG_MODULE_NAME, | 155 | .name = RNG_MODULE_NAME, |
156 | .devnode = "hwrng", | ||
156 | .fops = &rng_chrdev_ops, | 157 | .fops = &rng_chrdev_ops, |
157 | }; | 158 | }; |
158 | 159 | ||
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 259644646b82..d2e698096ace 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -2375,14 +2375,14 @@ static int __devinit ipmi_of_probe(struct of_device *dev, | |||
2375 | info->io.addr_data, info->io.regsize, info->io.regspacing, | 2375 | info->io.addr_data, info->io.regsize, info->io.regspacing, |
2376 | info->irq); | 2376 | info->irq); |
2377 | 2377 | ||
2378 | dev->dev.driver_data = (void *) info; | 2378 | dev_set_drvdata(&dev->dev, info); |
2379 | 2379 | ||
2380 | return try_smi_init(info); | 2380 | return try_smi_init(info); |
2381 | } | 2381 | } |
2382 | 2382 | ||
2383 | static int __devexit ipmi_of_remove(struct of_device *dev) | 2383 | static int __devexit ipmi_of_remove(struct of_device *dev) |
2384 | { | 2384 | { |
2385 | cleanup_one_si(dev->dev.driver_data); | 2385 | cleanup_one_si(dev_get_drvdata(&dev->dev)); |
2386 | return 0; | 2386 | return 0; |
2387 | } | 2387 | } |
2388 | 2388 | ||
diff --git a/drivers/char/misc.c b/drivers/char/misc.c index a5e0db9d7662..62c99fa59e2b 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c | |||
@@ -168,7 +168,6 @@ static const struct file_operations misc_fops = { | |||
168 | .open = misc_open, | 168 | .open = misc_open, |
169 | }; | 169 | }; |
170 | 170 | ||
171 | |||
172 | /** | 171 | /** |
173 | * misc_register - register a miscellaneous device | 172 | * misc_register - register a miscellaneous device |
174 | * @misc: device structure | 173 | * @misc: device structure |
@@ -217,8 +216,8 @@ int misc_register(struct miscdevice * misc) | |||
217 | misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7); | 216 | misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7); |
218 | dev = MKDEV(MISC_MAJOR, misc->minor); | 217 | dev = MKDEV(MISC_MAJOR, misc->minor); |
219 | 218 | ||
220 | misc->this_device = device_create(misc_class, misc->parent, dev, NULL, | 219 | misc->this_device = device_create(misc_class, misc->parent, dev, |
221 | "%s", misc->name); | 220 | misc, "%s", misc->name); |
222 | if (IS_ERR(misc->this_device)) { | 221 | if (IS_ERR(misc->this_device)) { |
223 | err = PTR_ERR(misc->this_device); | 222 | err = PTR_ERR(misc->this_device); |
224 | goto out; | 223 | goto out; |
@@ -264,6 +263,15 @@ int misc_deregister(struct miscdevice *misc) | |||
264 | EXPORT_SYMBOL(misc_register); | 263 | EXPORT_SYMBOL(misc_register); |
265 | EXPORT_SYMBOL(misc_deregister); | 264 | EXPORT_SYMBOL(misc_deregister); |
266 | 265 | ||
266 | static char *misc_nodename(struct device *dev) | ||
267 | { | ||
268 | struct miscdevice *c = dev_get_drvdata(dev); | ||
269 | |||
270 | if (c->devnode) | ||
271 | return kstrdup(c->devnode, GFP_KERNEL); | ||
272 | return NULL; | ||
273 | } | ||
274 | |||
267 | static int __init misc_init(void) | 275 | static int __init misc_init(void) |
268 | { | 276 | { |
269 | int err; | 277 | int err; |
@@ -279,6 +287,7 @@ static int __init misc_init(void) | |||
279 | err = -EIO; | 287 | err = -EIO; |
280 | if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) | 288 | if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) |
281 | goto fail_printk; | 289 | goto fail_printk; |
290 | misc_class->nodename = misc_nodename; | ||
282 | return 0; | 291 | return 0; |
283 | 292 | ||
284 | fail_printk: | 293 | fail_printk: |
diff --git a/drivers/char/raw.c b/drivers/char/raw.c index db32f0e4c7dd..05f9d18b9361 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c | |||
@@ -261,6 +261,11 @@ static const struct file_operations raw_ctl_fops = { | |||
261 | 261 | ||
262 | static struct cdev raw_cdev; | 262 | static struct cdev raw_cdev; |
263 | 263 | ||
264 | static char *raw_nodename(struct device *dev) | ||
265 | { | ||
266 | return kasprintf(GFP_KERNEL, "raw/%s", dev_name(dev)); | ||
267 | } | ||
268 | |||
264 | static int __init raw_init(void) | 269 | static int __init raw_init(void) |
265 | { | 270 | { |
266 | dev_t dev = MKDEV(RAW_MAJOR, 0); | 271 | dev_t dev = MKDEV(RAW_MAJOR, 0); |
@@ -284,6 +289,7 @@ static int __init raw_init(void) | |||
284 | ret = PTR_ERR(raw_class); | 289 | ret = PTR_ERR(raw_class); |
285 | goto error_region; | 290 | goto error_region; |
286 | } | 291 | } |
292 | raw_class->nodename = raw_nodename; | ||
287 | device_create(raw_class, NULL, MKDEV(RAW_MAJOR, 0), NULL, "rawctl"); | 293 | device_create(raw_class, NULL, MKDEV(RAW_MAJOR, 0), NULL, "rawctl"); |
288 | 294 | ||
289 | return 0; | 295 | return 0; |
diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c index 74edb1d0110f..0dd0f633b18d 100644 --- a/drivers/eisa/pci_eisa.c +++ b/drivers/eisa/pci_eisa.c | |||
@@ -31,11 +31,11 @@ static int __init pci_eisa_init(struct pci_dev *pdev, | |||
31 | } | 31 | } |
32 | 32 | ||
33 | pci_eisa_root.dev = &pdev->dev; | 33 | pci_eisa_root.dev = &pdev->dev; |
34 | pci_eisa_root.dev->driver_data = &pci_eisa_root; | ||
35 | pci_eisa_root.res = pdev->bus->resource[0]; | 34 | pci_eisa_root.res = pdev->bus->resource[0]; |
36 | pci_eisa_root.bus_base_addr = pdev->bus->resource[0]->start; | 35 | pci_eisa_root.bus_base_addr = pdev->bus->resource[0]->start; |
37 | pci_eisa_root.slots = EISA_MAX_SLOTS; | 36 | pci_eisa_root.slots = EISA_MAX_SLOTS; |
38 | pci_eisa_root.dma_mask = pdev->dma_mask; | 37 | pci_eisa_root.dma_mask = pdev->dma_mask; |
38 | dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root); | ||
39 | 39 | ||
40 | if (eisa_root_register (&pci_eisa_root)) { | 40 | if (eisa_root_register (&pci_eisa_root)) { |
41 | printk (KERN_ERR "pci_eisa : Could not register EISA root\n"); | 41 | printk (KERN_ERR "pci_eisa : Could not register EISA root\n"); |
diff --git a/drivers/eisa/virtual_root.c b/drivers/eisa/virtual_root.c index 3074879f231f..535e4f9c83f4 100644 --- a/drivers/eisa/virtual_root.c +++ b/drivers/eisa/virtual_root.c | |||
@@ -57,7 +57,7 @@ static int __init virtual_eisa_root_init (void) | |||
57 | 57 | ||
58 | eisa_bus_root.force_probe = force_probe; | 58 | eisa_bus_root.force_probe = force_probe; |
59 | 59 | ||
60 | eisa_root_dev.dev.driver_data = &eisa_bus_root; | 60 | dev_set_drvdata(&eisa_root_dev.dev, &eisa_bus_root); |
61 | 61 | ||
62 | if (eisa_root_register (&eisa_bus_root)) { | 62 | if (eisa_root_register (&eisa_bus_root)) { |
63 | /* A real bridge may have been registered before | 63 | /* A real bridge may have been registered before |
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c index 2bcf51557c72..a70e66e78c7b 100644 --- a/drivers/firewire/fw-sbp2.c +++ b/drivers/firewire/fw-sbp2.c | |||
@@ -1125,7 +1125,7 @@ static int sbp2_probe(struct device *dev) | |||
1125 | return -ENOMEM; | 1125 | return -ENOMEM; |
1126 | 1126 | ||
1127 | tgt = (struct sbp2_target *)shost->hostdata; | 1127 | tgt = (struct sbp2_target *)shost->hostdata; |
1128 | unit->device.driver_data = tgt; | 1128 | dev_set_drvdata(&unit->device, tgt); |
1129 | tgt->unit = unit; | 1129 | tgt->unit = unit; |
1130 | kref_init(&tgt->kref); | 1130 | kref_init(&tgt->kref); |
1131 | INIT_LIST_HEAD(&tgt->lu_list); | 1131 | INIT_LIST_HEAD(&tgt->lu_list); |
@@ -1180,7 +1180,7 @@ static int sbp2_probe(struct device *dev) | |||
1180 | static int sbp2_remove(struct device *dev) | 1180 | static int sbp2_remove(struct device *dev) |
1181 | { | 1181 | { |
1182 | struct fw_unit *unit = fw_unit(dev); | 1182 | struct fw_unit *unit = fw_unit(dev); |
1183 | struct sbp2_target *tgt = unit->device.driver_data; | 1183 | struct sbp2_target *tgt = dev_get_drvdata(&unit->device); |
1184 | 1184 | ||
1185 | sbp2_target_put(tgt); | 1185 | sbp2_target_put(tgt); |
1186 | return 0; | 1186 | return 0; |
@@ -1240,7 +1240,7 @@ static void sbp2_reconnect(struct work_struct *work) | |||
1240 | 1240 | ||
1241 | static void sbp2_update(struct fw_unit *unit) | 1241 | static void sbp2_update(struct fw_unit *unit) |
1242 | { | 1242 | { |
1243 | struct sbp2_target *tgt = unit->device.driver_data; | 1243 | struct sbp2_target *tgt = dev_get_drvdata(&unit->device); |
1244 | struct sbp2_logical_unit *lu; | 1244 | struct sbp2_logical_unit *lu; |
1245 | 1245 | ||
1246 | fw_device_enable_phys_dma(fw_device(unit->device.parent)); | 1246 | fw_device_enable_phys_dma(fw_device(unit->device.parent)); |
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index c77c6c6d9d2c..6ce0e2667a85 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c | |||
@@ -105,7 +105,7 @@ int drm_debugfs_create_files(struct drm_info_list *files, int count, | |||
105 | ent = debugfs_create_file(files[i].name, S_IFREG | S_IRUGO, | 105 | ent = debugfs_create_file(files[i].name, S_IFREG | S_IRUGO, |
106 | root, tmp, &drm_debugfs_fops); | 106 | root, tmp, &drm_debugfs_fops); |
107 | if (!ent) { | 107 | if (!ent) { |
108 | DRM_ERROR("Cannot create /debugfs/dri/%s/%s\n", | 108 | DRM_ERROR("Cannot create /sys/kernel/debug/dri/%s/%s\n", |
109 | name, files[i].name); | 109 | name, files[i].name); |
110 | drm_free(tmp, sizeof(struct drm_info_node), | 110 | drm_free(tmp, sizeof(struct drm_info_node), |
111 | _DRM_DRIVER); | 111 | _DRM_DRIVER); |
@@ -133,9 +133,9 @@ EXPORT_SYMBOL(drm_debugfs_create_files); | |||
133 | * \param minor device minor number | 133 | * \param minor device minor number |
134 | * \param root DRI debugfs dir entry. | 134 | * \param root DRI debugfs dir entry. |
135 | * | 135 | * |
136 | * Create the DRI debugfs root entry "/debugfs/dri", the device debugfs root entry | 136 | * Create the DRI debugfs root entry "/sys/kernel/debug/dri", the device debugfs root entry |
137 | * "/debugfs/dri/%minor%/", and each entry in debugfs_list as | 137 | * "/sys/kernel/debug/dri/%minor%/", and each entry in debugfs_list as |
138 | * "/debugfs/dri/%minor%/%name%". | 138 | * "/sys/kernel/debug/dri/%minor%/%name%". |
139 | */ | 139 | */ |
140 | int drm_debugfs_init(struct drm_minor *minor, int minor_id, | 140 | int drm_debugfs_init(struct drm_minor *minor, int minor_id, |
141 | struct dentry *root) | 141 | struct dentry *root) |
@@ -148,7 +148,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, | |||
148 | sprintf(name, "%d", minor_id); | 148 | sprintf(name, "%d", minor_id); |
149 | minor->debugfs_root = debugfs_create_dir(name, root); | 149 | minor->debugfs_root = debugfs_create_dir(name, root); |
150 | if (!minor->debugfs_root) { | 150 | if (!minor->debugfs_root) { |
151 | DRM_ERROR("Cannot create /debugfs/dri/%s\n", name); | 151 | DRM_ERROR("Cannot create /sys/kernel/debug/dri/%s\n", name); |
152 | return -1; | 152 | return -1; |
153 | } | 153 | } |
154 | 154 | ||
@@ -165,7 +165,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, | |||
165 | ret = dev->driver->debugfs_init(minor); | 165 | ret = dev->driver->debugfs_init(minor); |
166 | if (ret) { | 166 | if (ret) { |
167 | DRM_ERROR("DRM: Driver failed to initialize " | 167 | DRM_ERROR("DRM: Driver failed to initialize " |
168 | "/debugfs/dri.\n"); | 168 | "/sys/kernel/debug/dri.\n"); |
169 | return ret; | 169 | return ret; |
170 | } | 170 | } |
171 | } | 171 | } |
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 019b7c578236..1bf7efd8d334 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c | |||
@@ -339,7 +339,7 @@ static int __init drm_core_init(void) | |||
339 | 339 | ||
340 | drm_debugfs_root = debugfs_create_dir("dri", NULL); | 340 | drm_debugfs_root = debugfs_create_dir("dri", NULL); |
341 | if (!drm_debugfs_root) { | 341 | if (!drm_debugfs_root) { |
342 | DRM_ERROR("Cannot create /debugfs/dri\n"); | 342 | DRM_ERROR("Cannot create /sys/kernel/debug/dri\n"); |
343 | ret = -1; | 343 | ret = -1; |
344 | goto err_p3; | 344 | goto err_p3; |
345 | } | 345 | } |
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 89050684fe0d..387a8de1bc7e 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c | |||
@@ -343,7 +343,7 @@ static int drm_get_minor(struct drm_device *dev, struct drm_minor **minor, int t | |||
343 | #if defined(CONFIG_DEBUG_FS) | 343 | #if defined(CONFIG_DEBUG_FS) |
344 | ret = drm_debugfs_init(new_minor, minor_id, drm_debugfs_root); | 344 | ret = drm_debugfs_init(new_minor, minor_id, drm_debugfs_root); |
345 | if (ret) { | 345 | if (ret) { |
346 | DRM_ERROR("DRM: Failed to initialize /debugfs/dri.\n"); | 346 | DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n"); |
347 | goto err_g2; | 347 | goto err_g2; |
348 | } | 348 | } |
349 | #endif | 349 | #endif |
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 9987ab880835..85ec31b3ff00 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c | |||
@@ -70,6 +70,11 @@ static ssize_t version_show(struct class *dev, char *buf) | |||
70 | CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE); | 70 | CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE); |
71 | } | 71 | } |
72 | 72 | ||
73 | static char *drm_nodename(struct device *dev) | ||
74 | { | ||
75 | return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev)); | ||
76 | } | ||
77 | |||
73 | static CLASS_ATTR(version, S_IRUGO, version_show, NULL); | 78 | static CLASS_ATTR(version, S_IRUGO, version_show, NULL); |
74 | 79 | ||
75 | /** | 80 | /** |
@@ -101,6 +106,8 @@ struct class *drm_sysfs_create(struct module *owner, char *name) | |||
101 | if (err) | 106 | if (err) |
102 | goto err_out_class; | 107 | goto err_out_class; |
103 | 108 | ||
109 | class->nodename = drm_nodename; | ||
110 | |||
104 | return class; | 111 | return class; |
105 | 112 | ||
106 | err_out_class: | 113 | err_out_class: |
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index e9b436d2d944..9e9421525fb9 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c | |||
@@ -850,8 +850,14 @@ static const struct file_operations hiddev_fops = { | |||
850 | #endif | 850 | #endif |
851 | }; | 851 | }; |
852 | 852 | ||
853 | static char *hiddev_nodename(struct device *dev) | ||
854 | { | ||
855 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); | ||
856 | } | ||
857 | |||
853 | static struct usb_class_driver hiddev_class = { | 858 | static struct usb_class_driver hiddev_class = { |
854 | .name = "hiddev%d", | 859 | .name = "hiddev%d", |
860 | .nodename = hiddev_nodename, | ||
855 | .fops = &hiddev_fops, | 861 | .fops = &hiddev_fops, |
856 | .minor_base = HIDDEV_MINOR_BASE, | 862 | .minor_base = HIDDEV_MINOR_BASE, |
857 | }; | 863 | }; |
@@ -955,7 +961,6 @@ static int hiddev_usbd_probe(struct usb_interface *intf, | |||
955 | return -ENODEV; | 961 | return -ENODEV; |
956 | } | 962 | } |
957 | 963 | ||
958 | |||
959 | static /* const */ struct usb_driver hiddev_driver = { | 964 | static /* const */ struct usb_driver hiddev_driver = { |
960 | .name = "hiddev", | 965 | .name = "hiddev", |
961 | .probe = hiddev_usbd_probe, | 966 | .probe = hiddev_usbd_probe, |
diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c index ba1488bd8430..c14ca144cffe 100644 --- a/drivers/ide/ide-pm.c +++ b/drivers/ide/ide-pm.c | |||
@@ -3,7 +3,8 @@ | |||
3 | 3 | ||
4 | int generic_ide_suspend(struct device *dev, pm_message_t mesg) | 4 | int generic_ide_suspend(struct device *dev, pm_message_t mesg) |
5 | { | 5 | { |
6 | ide_drive_t *drive = dev->driver_data, *pair = ide_get_pair_dev(drive); | 6 | ide_drive_t *drive = dev_get_drvdata(dev); |
7 | ide_drive_t *pair = ide_get_pair_dev(drive); | ||
7 | ide_hwif_t *hwif = drive->hwif; | 8 | ide_hwif_t *hwif = drive->hwif; |
8 | struct request *rq; | 9 | struct request *rq; |
9 | struct request_pm_state rqpm; | 10 | struct request_pm_state rqpm; |
@@ -34,7 +35,8 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg) | |||
34 | 35 | ||
35 | int generic_ide_resume(struct device *dev) | 36 | int generic_ide_resume(struct device *dev) |
36 | { | 37 | { |
37 | ide_drive_t *drive = dev->driver_data, *pair = ide_get_pair_dev(drive); | 38 | ide_drive_t *drive = dev_get_drvdata(dev); |
39 | ide_drive_t *pair = ide_get_pair_dev(drive); | ||
38 | ide_hwif_t *hwif = drive->hwif; | 40 | ide_hwif_t *hwif = drive->hwif; |
39 | struct request *rq; | 41 | struct request *rq; |
40 | struct request_pm_state rqpm; | 42 | struct request_pm_state rqpm; |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index f371b0de314f..79e0af3fd158 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -535,7 +535,7 @@ static int ide_register_port(ide_hwif_t *hwif) | |||
535 | 535 | ||
536 | /* register with global device tree */ | 536 | /* register with global device tree */ |
537 | dev_set_name(&hwif->gendev, hwif->name); | 537 | dev_set_name(&hwif->gendev, hwif->name); |
538 | hwif->gendev.driver_data = hwif; | 538 | dev_set_drvdata(&hwif->gendev, hwif); |
539 | if (hwif->gendev.parent == NULL) | 539 | if (hwif->gendev.parent == NULL) |
540 | hwif->gendev.parent = hwif->dev; | 540 | hwif->gendev.parent = hwif->dev; |
541 | hwif->gendev.release = hwif_release_dev; | 541 | hwif->gendev.release = hwif_release_dev; |
@@ -987,9 +987,9 @@ static void hwif_register_devices(ide_hwif_t *hwif) | |||
987 | int ret; | 987 | int ret; |
988 | 988 | ||
989 | dev_set_name(dev, "%u.%u", hwif->index, i); | 989 | dev_set_name(dev, "%u.%u", hwif->index, i); |
990 | dev_set_drvdata(dev, drive); | ||
990 | dev->parent = &hwif->gendev; | 991 | dev->parent = &hwif->gendev; |
991 | dev->bus = &ide_bus_type; | 992 | dev->bus = &ide_bus_type; |
992 | dev->driver_data = drive; | ||
993 | dev->release = drive_release_dev; | 993 | dev->release = drive_release_dev; |
994 | 994 | ||
995 | ret = device_register(dev); | 995 | ret = device_register(dev); |
diff --git a/drivers/ide/ide_platform.c b/drivers/ide/ide_platform.c index ee9b55ecc62b..b579fbe88370 100644 --- a/drivers/ide/ide_platform.c +++ b/drivers/ide/ide_platform.c | |||
@@ -112,7 +112,7 @@ out: | |||
112 | 112 | ||
113 | static int __devexit plat_ide_remove(struct platform_device *pdev) | 113 | static int __devexit plat_ide_remove(struct platform_device *pdev) |
114 | { | 114 | { |
115 | struct ide_host *host = pdev->dev.driver_data; | 115 | struct ide_host *host = dev_get_drvdata(&pdev->dev); |
116 | 116 | ||
117 | ide_host_remove(host); | 117 | ide_host_remove(host); |
118 | 118 | ||
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 4ca103577c0a..f5c586c2bba6 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c | |||
@@ -361,7 +361,7 @@ static int eth1394_new_node(struct eth1394_host_info *hi, | |||
361 | node_info->pdg.sz = 0; | 361 | node_info->pdg.sz = 0; |
362 | node_info->fifo = CSR1212_INVALID_ADDR_SPACE; | 362 | node_info->fifo = CSR1212_INVALID_ADDR_SPACE; |
363 | 363 | ||
364 | ud->device.driver_data = node_info; | 364 | dev_set_drvdata(&ud->device, node_info); |
365 | new_node->ud = ud; | 365 | new_node->ud = ud; |
366 | 366 | ||
367 | priv = netdev_priv(hi->dev); | 367 | priv = netdev_priv(hi->dev); |
@@ -406,7 +406,7 @@ static int eth1394_remove(struct device *dev) | |||
406 | list_del(&old_node->list); | 406 | list_del(&old_node->list); |
407 | kfree(old_node); | 407 | kfree(old_node); |
408 | 408 | ||
409 | node_info = (struct eth1394_node_info*)ud->device.driver_data; | 409 | node_info = dev_get_drvdata(&ud->device); |
410 | 410 | ||
411 | spin_lock_irqsave(&node_info->pdg.lock, flags); | 411 | spin_lock_irqsave(&node_info->pdg.lock, flags); |
412 | /* The partial datagram list should be empty, but we'll just | 412 | /* The partial datagram list should be empty, but we'll just |
@@ -416,7 +416,7 @@ static int eth1394_remove(struct device *dev) | |||
416 | spin_unlock_irqrestore(&node_info->pdg.lock, flags); | 416 | spin_unlock_irqrestore(&node_info->pdg.lock, flags); |
417 | 417 | ||
418 | kfree(node_info); | 418 | kfree(node_info); |
419 | ud->device.driver_data = NULL; | 419 | dev_set_drvdata(&ud->device, NULL); |
420 | return 0; | 420 | return 0; |
421 | } | 421 | } |
422 | 422 | ||
@@ -688,7 +688,7 @@ static void ether1394_host_reset(struct hpsb_host *host) | |||
688 | ether1394_reset_priv(dev, 0); | 688 | ether1394_reset_priv(dev, 0); |
689 | 689 | ||
690 | list_for_each_entry(node, &priv->ip_node_list, list) { | 690 | list_for_each_entry(node, &priv->ip_node_list, list) { |
691 | node_info = node->ud->device.driver_data; | 691 | node_info = dev_get_drvdata(&node->ud->device); |
692 | 692 | ||
693 | spin_lock_irqsave(&node_info->pdg.lock, flags); | 693 | spin_lock_irqsave(&node_info->pdg.lock, flags); |
694 | 694 | ||
@@ -872,8 +872,7 @@ static __be16 ether1394_parse_encap(struct sk_buff *skb, struct net_device *dev, | |||
872 | if (!node) | 872 | if (!node) |
873 | return cpu_to_be16(0); | 873 | return cpu_to_be16(0); |
874 | 874 | ||
875 | node_info = | 875 | node_info = dev_get_drvdata(&node->ud->device); |
876 | (struct eth1394_node_info *)node->ud->device.driver_data; | ||
877 | 876 | ||
878 | /* Update our speed/payload/fifo_offset table */ | 877 | /* Update our speed/payload/fifo_offset table */ |
879 | node_info->maxpayload = maxpayload; | 878 | node_info->maxpayload = maxpayload; |
@@ -1080,7 +1079,7 @@ static int ether1394_data_handler(struct net_device *dev, int srcid, int destid, | |||
1080 | priv->ud_list[NODEID_TO_NODE(srcid)] = ud; | 1079 | priv->ud_list[NODEID_TO_NODE(srcid)] = ud; |
1081 | } | 1080 | } |
1082 | 1081 | ||
1083 | node_info = (struct eth1394_node_info *)ud->device.driver_data; | 1082 | node_info = dev_get_drvdata(&ud->device); |
1084 | 1083 | ||
1085 | /* First, did we receive a fragmented or unfragmented datagram? */ | 1084 | /* First, did we receive a fragmented or unfragmented datagram? */ |
1086 | hdr->words.word1 = ntohs(hdr->words.word1); | 1085 | hdr->words.word1 = ntohs(hdr->words.word1); |
@@ -1617,8 +1616,7 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) | |||
1617 | if (!node) | 1616 | if (!node) |
1618 | goto fail; | 1617 | goto fail; |
1619 | 1618 | ||
1620 | node_info = | 1619 | node_info = dev_get_drvdata(&node->ud->device); |
1621 | (struct eth1394_node_info *)node->ud->device.driver_data; | ||
1622 | if (node_info->fifo == CSR1212_INVALID_ADDR_SPACE) | 1620 | if (node_info->fifo == CSR1212_INVALID_ADDR_SPACE) |
1623 | goto fail; | 1621 | goto fail; |
1624 | 1622 | ||
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index a51ab233342d..83b734aec923 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c | |||
@@ -718,7 +718,7 @@ static int sbp2_remove(struct device *dev) | |||
718 | struct scsi_device *sdev; | 718 | struct scsi_device *sdev; |
719 | 719 | ||
720 | ud = container_of(dev, struct unit_directory, device); | 720 | ud = container_of(dev, struct unit_directory, device); |
721 | lu = ud->device.driver_data; | 721 | lu = dev_get_drvdata(&ud->device); |
722 | if (!lu) | 722 | if (!lu) |
723 | return 0; | 723 | return 0; |
724 | 724 | ||
@@ -746,7 +746,7 @@ static int sbp2_remove(struct device *dev) | |||
746 | 746 | ||
747 | static int sbp2_update(struct unit_directory *ud) | 747 | static int sbp2_update(struct unit_directory *ud) |
748 | { | 748 | { |
749 | struct sbp2_lu *lu = ud->device.driver_data; | 749 | struct sbp2_lu *lu = dev_get_drvdata(&ud->device); |
750 | 750 | ||
751 | if (sbp2_reconnect_device(lu) != 0) { | 751 | if (sbp2_reconnect_device(lu) != 0) { |
752 | /* | 752 | /* |
@@ -815,7 +815,7 @@ static struct sbp2_lu *sbp2_alloc_device(struct unit_directory *ud) | |||
815 | atomic_set(&lu->state, SBP2LU_STATE_RUNNING); | 815 | atomic_set(&lu->state, SBP2LU_STATE_RUNNING); |
816 | INIT_WORK(&lu->protocol_work, NULL); | 816 | INIT_WORK(&lu->protocol_work, NULL); |
817 | 817 | ||
818 | ud->device.driver_data = lu; | 818 | dev_set_drvdata(&ud->device, lu); |
819 | 819 | ||
820 | hi = hpsb_get_hostinfo(&sbp2_highlevel, ud->ne->host); | 820 | hi = hpsb_get_hostinfo(&sbp2_highlevel, ud->ne->host); |
821 | if (!hi) { | 821 | if (!hi) { |
@@ -1051,7 +1051,7 @@ static void sbp2_remove_device(struct sbp2_lu *lu) | |||
1051 | hpsb_unregister_addrspace(&sbp2_highlevel, hi->host, | 1051 | hpsb_unregister_addrspace(&sbp2_highlevel, hi->host, |
1052 | lu->status_fifo_addr); | 1052 | lu->status_fifo_addr); |
1053 | 1053 | ||
1054 | lu->ud->device.driver_data = NULL; | 1054 | dev_set_drvdata(&lu->ud->device, NULL); |
1055 | 1055 | ||
1056 | module_put(hi->host->driver->owner); | 1056 | module_put(hi->host->driver->owner); |
1057 | no_hi: | 1057 | no_hi: |
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c index 5c04cfb54cb9..158a214da2f7 100644 --- a/drivers/infiniband/core/sysfs.c +++ b/drivers/infiniband/core/sysfs.c | |||
@@ -760,9 +760,9 @@ int ib_device_register_sysfs(struct ib_device *device) | |||
760 | int i; | 760 | int i; |
761 | 761 | ||
762 | class_dev->class = &ib_class; | 762 | class_dev->class = &ib_class; |
763 | class_dev->driver_data = device; | ||
764 | class_dev->parent = device->dma_device; | 763 | class_dev->parent = device->dma_device; |
765 | dev_set_name(class_dev, device->name); | 764 | dev_set_name(class_dev, device->name); |
765 | dev_set_drvdata(class_dev, device); | ||
766 | 766 | ||
767 | INIT_LIST_HEAD(&device->port_list); | 767 | INIT_LIST_HEAD(&device->port_list); |
768 | 768 | ||
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index 85905ab9391f..ce4e6eff4792 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c | |||
@@ -636,7 +636,7 @@ static ssize_t ehca_show_##name(struct device *dev, \ | |||
636 | struct hipz_query_hca *rblock; \ | 636 | struct hipz_query_hca *rblock; \ |
637 | int data; \ | 637 | int data; \ |
638 | \ | 638 | \ |
639 | shca = dev->driver_data; \ | 639 | shca = dev_get_drvdata(dev); \ |
640 | \ | 640 | \ |
641 | rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL); \ | 641 | rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL); \ |
642 | if (!rblock) { \ | 642 | if (!rblock) { \ |
@@ -680,7 +680,7 @@ static ssize_t ehca_show_adapter_handle(struct device *dev, | |||
680 | struct device_attribute *attr, | 680 | struct device_attribute *attr, |
681 | char *buf) | 681 | char *buf) |
682 | { | 682 | { |
683 | struct ehca_shca *shca = dev->driver_data; | 683 | struct ehca_shca *shca = dev_get_drvdata(dev); |
684 | 684 | ||
685 | return sprintf(buf, "%llx\n", shca->ipz_hca_handle.handle); | 685 | return sprintf(buf, "%llx\n", shca->ipz_hca_handle.handle); |
686 | 686 | ||
@@ -749,7 +749,7 @@ static int __devinit ehca_probe(struct of_device *dev, | |||
749 | 749 | ||
750 | shca->ofdev = dev; | 750 | shca->ofdev = dev; |
751 | shca->ipz_hca_handle.handle = *handle; | 751 | shca->ipz_hca_handle.handle = *handle; |
752 | dev->dev.driver_data = shca; | 752 | dev_set_drvdata(&dev->dev, shca); |
753 | 753 | ||
754 | ret = ehca_sense_attributes(shca); | 754 | ret = ehca_sense_attributes(shca); |
755 | if (ret < 0) { | 755 | if (ret < 0) { |
@@ -878,7 +878,7 @@ probe1: | |||
878 | 878 | ||
879 | static int __devexit ehca_remove(struct of_device *dev) | 879 | static int __devexit ehca_remove(struct of_device *dev) |
880 | { | 880 | { |
881 | struct ehca_shca *shca = dev->dev.driver_data; | 881 | struct ehca_shca *shca = dev_get_drvdata(&dev->dev); |
882 | unsigned long flags; | 882 | unsigned long flags; |
883 | int ret; | 883 | int ret; |
884 | 884 | ||
diff --git a/drivers/input/input.c b/drivers/input/input.c index 5d445f48789b..7c237e6ac711 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -1265,8 +1265,14 @@ static struct device_type input_dev_type = { | |||
1265 | .uevent = input_dev_uevent, | 1265 | .uevent = input_dev_uevent, |
1266 | }; | 1266 | }; |
1267 | 1267 | ||
1268 | static char *input_nodename(struct device *dev) | ||
1269 | { | ||
1270 | return kasprintf(GFP_KERNEL, "input/%s", dev_name(dev)); | ||
1271 | } | ||
1272 | |||
1268 | struct class input_class = { | 1273 | struct class input_class = { |
1269 | .name = "input", | 1274 | .name = "input", |
1275 | .nodename = input_nodename, | ||
1270 | }; | 1276 | }; |
1271 | EXPORT_SYMBOL_GPL(input_class); | 1277 | EXPORT_SYMBOL_GPL(input_class); |
1272 | 1278 | ||
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c index 69af8385ab14..2957d48e0045 100644 --- a/drivers/input/touchscreen/wm97xx-core.c +++ b/drivers/input/touchscreen/wm97xx-core.c | |||
@@ -569,7 +569,7 @@ static int wm97xx_probe(struct device *dev) | |||
569 | mutex_init(&wm->codec_mutex); | 569 | mutex_init(&wm->codec_mutex); |
570 | 570 | ||
571 | wm->dev = dev; | 571 | wm->dev = dev; |
572 | dev->driver_data = wm; | 572 | dev_set_drvdata(dev, wm); |
573 | wm->ac97 = to_ac97_t(dev); | 573 | wm->ac97 = to_ac97_t(dev); |
574 | 574 | ||
575 | /* check that we have a supported codec */ | 575 | /* check that we have a supported codec */ |
diff --git a/drivers/input/xen-kbdfront.c b/drivers/input/xen-kbdfront.c index 928d2ed8865f..b115726dc088 100644 --- a/drivers/input/xen-kbdfront.c +++ b/drivers/input/xen-kbdfront.c | |||
@@ -114,7 +114,7 @@ static int __devinit xenkbd_probe(struct xenbus_device *dev, | |||
114 | xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); | 114 | xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); |
115 | return -ENOMEM; | 115 | return -ENOMEM; |
116 | } | 116 | } |
117 | dev->dev.driver_data = info; | 117 | dev_set_drvdata(&dev->dev, info); |
118 | info->xbdev = dev; | 118 | info->xbdev = dev; |
119 | info->irq = -1; | 119 | info->irq = -1; |
120 | snprintf(info->phys, sizeof(info->phys), "xenbus/%s", dev->nodename); | 120 | snprintf(info->phys, sizeof(info->phys), "xenbus/%s", dev->nodename); |
@@ -186,7 +186,7 @@ static int __devinit xenkbd_probe(struct xenbus_device *dev, | |||
186 | 186 | ||
187 | static int xenkbd_resume(struct xenbus_device *dev) | 187 | static int xenkbd_resume(struct xenbus_device *dev) |
188 | { | 188 | { |
189 | struct xenkbd_info *info = dev->dev.driver_data; | 189 | struct xenkbd_info *info = dev_get_drvdata(&dev->dev); |
190 | 190 | ||
191 | xenkbd_disconnect_backend(info); | 191 | xenkbd_disconnect_backend(info); |
192 | memset(info->page, 0, PAGE_SIZE); | 192 | memset(info->page, 0, PAGE_SIZE); |
@@ -195,7 +195,7 @@ static int xenkbd_resume(struct xenbus_device *dev) | |||
195 | 195 | ||
196 | static int xenkbd_remove(struct xenbus_device *dev) | 196 | static int xenkbd_remove(struct xenbus_device *dev) |
197 | { | 197 | { |
198 | struct xenkbd_info *info = dev->dev.driver_data; | 198 | struct xenkbd_info *info = dev_get_drvdata(&dev->dev); |
199 | 199 | ||
200 | xenkbd_disconnect_backend(info); | 200 | xenkbd_disconnect_backend(info); |
201 | if (info->kbd) | 201 | if (info->kbd) |
@@ -266,7 +266,7 @@ static void xenkbd_disconnect_backend(struct xenkbd_info *info) | |||
266 | static void xenkbd_backend_changed(struct xenbus_device *dev, | 266 | static void xenkbd_backend_changed(struct xenbus_device *dev, |
267 | enum xenbus_state backend_state) | 267 | enum xenbus_state backend_state) |
268 | { | 268 | { |
269 | struct xenkbd_info *info = dev->dev.driver_data; | 269 | struct xenkbd_info *info = dev_get_drvdata(&dev->dev); |
270 | int ret, val; | 270 | int ret, val; |
271 | 271 | ||
272 | switch (backend_state) { | 272 | switch (backend_state) { |
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 823ceba6efa8..1128d3fba797 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c | |||
@@ -1513,6 +1513,7 @@ static const struct file_operations _ctl_fops = { | |||
1513 | static struct miscdevice _dm_misc = { | 1513 | static struct miscdevice _dm_misc = { |
1514 | .minor = MISC_DYNAMIC_MINOR, | 1514 | .minor = MISC_DYNAMIC_MINOR, |
1515 | .name = DM_NAME, | 1515 | .name = DM_NAME, |
1516 | .devnode = "mapper/control", | ||
1516 | .fops = &_ctl_fops | 1517 | .fops = &_ctl_fops |
1517 | }; | 1518 | }; |
1518 | 1519 | ||
diff --git a/drivers/media/common/tuners/tuner-xc2028.c b/drivers/media/common/tuners/tuner-xc2028.c index 1adce9ff52ce..7636c33bc1e9 100644 --- a/drivers/media/common/tuners/tuner-xc2028.c +++ b/drivers/media/common/tuners/tuner-xc2028.c | |||
@@ -48,7 +48,7 @@ MODULE_PARM_DESC(audio_std, | |||
48 | "NICAM/A\n" | 48 | "NICAM/A\n" |
49 | "NICAM/B\n"); | 49 | "NICAM/B\n"); |
50 | 50 | ||
51 | static char firmware_name[FIRMWARE_NAME_MAX]; | 51 | static char firmware_name[30]; |
52 | module_param_string(firmware_name, firmware_name, sizeof(firmware_name), 0); | 52 | module_param_string(firmware_name, firmware_name, sizeof(firmware_name), 0); |
53 | MODULE_PARM_DESC(firmware_name, "Firmware file name. Allows overriding the " | 53 | MODULE_PARM_DESC(firmware_name, "Firmware file name. Allows overriding the " |
54 | "default firmware name\n"); | 54 | "default firmware name\n"); |
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index a454ee8f1e43..479dd05762a5 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
@@ -447,6 +447,15 @@ static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
447 | return 0; | 447 | return 0; |
448 | } | 448 | } |
449 | 449 | ||
450 | static char *dvb_nodename(struct device *dev) | ||
451 | { | ||
452 | struct dvb_device *dvbdev = dev_get_drvdata(dev); | ||
453 | |||
454 | return kasprintf(GFP_KERNEL, "dvb/adapter%d/%s%d", | ||
455 | dvbdev->adapter->num, dnames[dvbdev->type], dvbdev->id); | ||
456 | } | ||
457 | |||
458 | |||
450 | static int __init init_dvbdev(void) | 459 | static int __init init_dvbdev(void) |
451 | { | 460 | { |
452 | int retval; | 461 | int retval; |
@@ -469,6 +478,7 @@ static int __init init_dvbdev(void) | |||
469 | goto error; | 478 | goto error; |
470 | } | 479 | } |
471 | dvb_class->dev_uevent = dvb_uevent; | 480 | dvb_class->dev_uevent = dvb_uevent; |
481 | dvb_class->nodename = dvb_nodename; | ||
472 | return 0; | 482 | return 0; |
473 | 483 | ||
474 | error: | 484 | error: |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index 2d5352e54dc0..b5157518a300 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h | |||
@@ -196,7 +196,7 @@ struct dvb_usb_device_properties { | |||
196 | #define CYPRESS_FX2 3 | 196 | #define CYPRESS_FX2 3 |
197 | int usb_ctrl; | 197 | int usb_ctrl; |
198 | int (*download_firmware) (struct usb_device *, const struct firmware *); | 198 | int (*download_firmware) (struct usb_device *, const struct firmware *); |
199 | const char firmware[FIRMWARE_NAME_MAX]; | 199 | const char *firmware; |
200 | int no_reconnect; | 200 | int no_reconnect; |
201 | 201 | ||
202 | int size_of_priv; | 202 | int size_of_priv; |
diff --git a/drivers/media/dvb/firewire/firedtv-1394.c b/drivers/media/dvb/firewire/firedtv-1394.c index 4e207658c5d9..2b6eeeab5b25 100644 --- a/drivers/media/dvb/firewire/firedtv-1394.c +++ b/drivers/media/dvb/firewire/firedtv-1394.c | |||
@@ -225,7 +225,7 @@ fail_free: | |||
225 | 225 | ||
226 | static int node_remove(struct device *dev) | 226 | static int node_remove(struct device *dev) |
227 | { | 227 | { |
228 | struct firedtv *fdtv = dev->driver_data; | 228 | struct firedtv *fdtv = dev_get_drvdata(dev); |
229 | 229 | ||
230 | fdtv_dvb_unregister(fdtv); | 230 | fdtv_dvb_unregister(fdtv); |
231 | 231 | ||
@@ -242,7 +242,7 @@ static int node_remove(struct device *dev) | |||
242 | 242 | ||
243 | static int node_update(struct unit_directory *ud) | 243 | static int node_update(struct unit_directory *ud) |
244 | { | 244 | { |
245 | struct firedtv *fdtv = ud->device.driver_data; | 245 | struct firedtv *fdtv = dev_get_drvdata(&ud->device); |
246 | 246 | ||
247 | if (fdtv->isochannel >= 0) | 247 | if (fdtv->isochannel >= 0) |
248 | cmp_establish_pp_connection(fdtv, fdtv->subunit, | 248 | cmp_establish_pp_connection(fdtv, fdtv->subunit, |
diff --git a/drivers/media/dvb/firewire/firedtv-dvb.c b/drivers/media/dvb/firewire/firedtv-dvb.c index 9d308dd32a5c..5742fde79d99 100644 --- a/drivers/media/dvb/firewire/firedtv-dvb.c +++ b/drivers/media/dvb/firewire/firedtv-dvb.c | |||
@@ -268,7 +268,7 @@ struct firedtv *fdtv_alloc(struct device *dev, | |||
268 | if (!fdtv) | 268 | if (!fdtv) |
269 | return NULL; | 269 | return NULL; |
270 | 270 | ||
271 | dev->driver_data = fdtv; | 271 | dev_set_drvdata(dev, fdtv); |
272 | fdtv->device = dev; | 272 | fdtv->device = dev; |
273 | fdtv->isochannel = -1; | 273 | fdtv->isochannel = -1; |
274 | fdtv->voltage = 0xff; | 274 | fdtv->voltage = 0xff; |
diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c index ba3709bec3f0..ec2f45dde164 100644 --- a/drivers/media/video/dabusb.c +++ b/drivers/media/video/dabusb.c | |||
@@ -747,8 +747,14 @@ static const struct file_operations dabusb_fops = | |||
747 | .release = dabusb_release, | 747 | .release = dabusb_release, |
748 | }; | 748 | }; |
749 | 749 | ||
750 | static char *dabusb_nodename(struct device *dev) | ||
751 | { | ||
752 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); | ||
753 | } | ||
754 | |||
750 | static struct usb_class_driver dabusb_class = { | 755 | static struct usb_class_driver dabusb_class = { |
751 | .name = "dabusb%d", | 756 | .name = "dabusb%d", |
757 | .nodename = dabusb_nodename, | ||
752 | .fops = &dabusb_fops, | 758 | .fops = &dabusb_fops, |
753 | .minor_base = DABUSB_MINOR, | 759 | .minor_base = DABUSB_MINOR, |
754 | }; | 760 | }; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index 299c1cbc3832..6c23456e0bda 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | |||
@@ -539,7 +539,7 @@ static void class_dev_destroy(struct pvr2_sysfs *sfp) | |||
539 | &sfp->attr_unit_number); | 539 | &sfp->attr_unit_number); |
540 | } | 540 | } |
541 | pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev); | 541 | pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev); |
542 | sfp->class_dev->driver_data = NULL; | 542 | dev_set_drvdata(sfp->class_dev, NULL); |
543 | device_unregister(sfp->class_dev); | 543 | device_unregister(sfp->class_dev); |
544 | sfp->class_dev = NULL; | 544 | sfp->class_dev = NULL; |
545 | } | 545 | } |
@@ -549,7 +549,7 @@ static ssize_t v4l_minor_number_show(struct device *class_dev, | |||
549 | struct device_attribute *attr, char *buf) | 549 | struct device_attribute *attr, char *buf) |
550 | { | 550 | { |
551 | struct pvr2_sysfs *sfp; | 551 | struct pvr2_sysfs *sfp; |
552 | sfp = (struct pvr2_sysfs *)class_dev->driver_data; | 552 | sfp = dev_get_drvdata(class_dev); |
553 | if (!sfp) return -EINVAL; | 553 | if (!sfp) return -EINVAL; |
554 | return scnprintf(buf,PAGE_SIZE,"%d\n", | 554 | return scnprintf(buf,PAGE_SIZE,"%d\n", |
555 | pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw, | 555 | pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw, |
@@ -561,7 +561,7 @@ static ssize_t bus_info_show(struct device *class_dev, | |||
561 | struct device_attribute *attr, char *buf) | 561 | struct device_attribute *attr, char *buf) |
562 | { | 562 | { |
563 | struct pvr2_sysfs *sfp; | 563 | struct pvr2_sysfs *sfp; |
564 | sfp = (struct pvr2_sysfs *)class_dev->driver_data; | 564 | sfp = dev_get_drvdata(class_dev); |
565 | if (!sfp) return -EINVAL; | 565 | if (!sfp) return -EINVAL; |
566 | return scnprintf(buf,PAGE_SIZE,"%s\n", | 566 | return scnprintf(buf,PAGE_SIZE,"%s\n", |
567 | pvr2_hdw_get_bus_info(sfp->channel.hdw)); | 567 | pvr2_hdw_get_bus_info(sfp->channel.hdw)); |
@@ -572,7 +572,7 @@ static ssize_t hdw_name_show(struct device *class_dev, | |||
572 | struct device_attribute *attr, char *buf) | 572 | struct device_attribute *attr, char *buf) |
573 | { | 573 | { |
574 | struct pvr2_sysfs *sfp; | 574 | struct pvr2_sysfs *sfp; |
575 | sfp = (struct pvr2_sysfs *)class_dev->driver_data; | 575 | sfp = dev_get_drvdata(class_dev); |
576 | if (!sfp) return -EINVAL; | 576 | if (!sfp) return -EINVAL; |
577 | return scnprintf(buf,PAGE_SIZE,"%s\n", | 577 | return scnprintf(buf,PAGE_SIZE,"%s\n", |
578 | pvr2_hdw_get_type(sfp->channel.hdw)); | 578 | pvr2_hdw_get_type(sfp->channel.hdw)); |
@@ -583,7 +583,7 @@ static ssize_t hdw_desc_show(struct device *class_dev, | |||
583 | struct device_attribute *attr, char *buf) | 583 | struct device_attribute *attr, char *buf) |
584 | { | 584 | { |
585 | struct pvr2_sysfs *sfp; | 585 | struct pvr2_sysfs *sfp; |
586 | sfp = (struct pvr2_sysfs *)class_dev->driver_data; | 586 | sfp = dev_get_drvdata(class_dev); |
587 | if (!sfp) return -EINVAL; | 587 | if (!sfp) return -EINVAL; |
588 | return scnprintf(buf,PAGE_SIZE,"%s\n", | 588 | return scnprintf(buf,PAGE_SIZE,"%s\n", |
589 | pvr2_hdw_get_desc(sfp->channel.hdw)); | 589 | pvr2_hdw_get_desc(sfp->channel.hdw)); |
@@ -595,7 +595,7 @@ static ssize_t v4l_radio_minor_number_show(struct device *class_dev, | |||
595 | char *buf) | 595 | char *buf) |
596 | { | 596 | { |
597 | struct pvr2_sysfs *sfp; | 597 | struct pvr2_sysfs *sfp; |
598 | sfp = (struct pvr2_sysfs *)class_dev->driver_data; | 598 | sfp = dev_get_drvdata(class_dev); |
599 | if (!sfp) return -EINVAL; | 599 | if (!sfp) return -EINVAL; |
600 | return scnprintf(buf,PAGE_SIZE,"%d\n", | 600 | return scnprintf(buf,PAGE_SIZE,"%d\n", |
601 | pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw, | 601 | pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw, |
@@ -607,7 +607,7 @@ static ssize_t unit_number_show(struct device *class_dev, | |||
607 | struct device_attribute *attr, char *buf) | 607 | struct device_attribute *attr, char *buf) |
608 | { | 608 | { |
609 | struct pvr2_sysfs *sfp; | 609 | struct pvr2_sysfs *sfp; |
610 | sfp = (struct pvr2_sysfs *)class_dev->driver_data; | 610 | sfp = dev_get_drvdata(class_dev); |
611 | if (!sfp) return -EINVAL; | 611 | if (!sfp) return -EINVAL; |
612 | return scnprintf(buf,PAGE_SIZE,"%d\n", | 612 | return scnprintf(buf,PAGE_SIZE,"%d\n", |
613 | pvr2_hdw_get_unit_number(sfp->channel.hdw)); | 613 | pvr2_hdw_get_unit_number(sfp->channel.hdw)); |
@@ -635,7 +635,7 @@ static void class_dev_create(struct pvr2_sysfs *sfp, | |||
635 | class_dev->parent = &usb_dev->dev; | 635 | class_dev->parent = &usb_dev->dev; |
636 | 636 | ||
637 | sfp->class_dev = class_dev; | 637 | sfp->class_dev = class_dev; |
638 | class_dev->driver_data = sfp; | 638 | dev_set_drvdata(class_dev, sfp); |
639 | ret = device_register(class_dev); | 639 | ret = device_register(class_dev); |
640 | if (ret) { | 640 | if (ret) { |
641 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, | 641 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
@@ -792,7 +792,7 @@ static ssize_t debuginfo_show(struct device *class_dev, | |||
792 | struct device_attribute *attr, char *buf) | 792 | struct device_attribute *attr, char *buf) |
793 | { | 793 | { |
794 | struct pvr2_sysfs *sfp; | 794 | struct pvr2_sysfs *sfp; |
795 | sfp = (struct pvr2_sysfs *)class_dev->driver_data; | 795 | sfp = dev_get_drvdata(class_dev); |
796 | if (!sfp) return -EINVAL; | 796 | if (!sfp) return -EINVAL; |
797 | pvr2_hdw_trigger_module_log(sfp->channel.hdw); | 797 | pvr2_hdw_trigger_module_log(sfp->channel.hdw); |
798 | return pvr2_debugifc_print_info(sfp->channel.hdw,buf,PAGE_SIZE); | 798 | return pvr2_debugifc_print_info(sfp->channel.hdw,buf,PAGE_SIZE); |
@@ -803,7 +803,7 @@ static ssize_t debugcmd_show(struct device *class_dev, | |||
803 | struct device_attribute *attr, char *buf) | 803 | struct device_attribute *attr, char *buf) |
804 | { | 804 | { |
805 | struct pvr2_sysfs *sfp; | 805 | struct pvr2_sysfs *sfp; |
806 | sfp = (struct pvr2_sysfs *)class_dev->driver_data; | 806 | sfp = dev_get_drvdata(class_dev); |
807 | if (!sfp) return -EINVAL; | 807 | if (!sfp) return -EINVAL; |
808 | return pvr2_debugifc_print_status(sfp->channel.hdw,buf,PAGE_SIZE); | 808 | return pvr2_debugifc_print_status(sfp->channel.hdw,buf,PAGE_SIZE); |
809 | } | 809 | } |
@@ -816,7 +816,7 @@ static ssize_t debugcmd_store(struct device *class_dev, | |||
816 | struct pvr2_sysfs *sfp; | 816 | struct pvr2_sysfs *sfp; |
817 | int ret; | 817 | int ret; |
818 | 818 | ||
819 | sfp = (struct pvr2_sysfs *)class_dev->driver_data; | 819 | sfp = dev_get_drvdata(class_dev); |
820 | if (!sfp) return -EINVAL; | 820 | if (!sfp) return -EINVAL; |
821 | 821 | ||
822 | ret = pvr2_debugifc_docmd(sfp->channel.hdw,buf,count); | 822 | ret = pvr2_debugifc_docmd(sfp->channel.hdw,buf,count); |
diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c index 386da1566fcc..cb73051e43db 100644 --- a/drivers/mfd/htc-pasic3.c +++ b/drivers/mfd/htc-pasic3.c | |||
@@ -35,7 +35,7 @@ struct pasic3_data { | |||
35 | */ | 35 | */ |
36 | void pasic3_write_register(struct device *dev, u32 reg, u8 val) | 36 | void pasic3_write_register(struct device *dev, u32 reg, u8 val) |
37 | { | 37 | { |
38 | struct pasic3_data *asic = dev->driver_data; | 38 | struct pasic3_data *asic = dev_get_drvdata(dev); |
39 | int bus_shift = asic->bus_shift; | 39 | int bus_shift = asic->bus_shift; |
40 | void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift); | 40 | void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift); |
41 | void __iomem *data = asic->mapping + (REG_DATA << bus_shift); | 41 | void __iomem *data = asic->mapping + (REG_DATA << bus_shift); |
@@ -50,7 +50,7 @@ EXPORT_SYMBOL(pasic3_write_register); /* for leds-pasic3 */ | |||
50 | */ | 50 | */ |
51 | u8 pasic3_read_register(struct device *dev, u32 reg) | 51 | u8 pasic3_read_register(struct device *dev, u32 reg) |
52 | { | 52 | { |
53 | struct pasic3_data *asic = dev->driver_data; | 53 | struct pasic3_data *asic = dev_get_drvdata(dev); |
54 | int bus_shift = asic->bus_shift; | 54 | int bus_shift = asic->bus_shift; |
55 | void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift); | 55 | void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift); |
56 | void __iomem *data = asic->mapping + (REG_DATA << bus_shift); | 56 | void __iomem *data = asic->mapping + (REG_DATA << bus_shift); |
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index 11a6248cc1c1..082c197ab9b8 100644 --- a/drivers/mfd/pcf50633-core.c +++ b/drivers/mfd/pcf50633-core.c | |||
@@ -618,7 +618,7 @@ static int __devinit pcf50633_probe(struct i2c_client *client, | |||
618 | 618 | ||
619 | pdev->dev.parent = pcf->dev; | 619 | pdev->dev.parent = pcf->dev; |
620 | pdev->dev.platform_data = &pdata->reg_init_data[i]; | 620 | pdev->dev.platform_data = &pdata->reg_init_data[i]; |
621 | pdev->dev.driver_data = pcf; | 621 | dev_set_drvdata(&pdev->dev, pcf); |
622 | pcf->regulator_pdev[i] = pdev; | 622 | pcf->regulator_pdev[i] = pdev; |
623 | 623 | ||
624 | platform_device_add(pdev); | 624 | platform_device_add(pdev); |
diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c index cf30d06a0104..7c21bf791569 100644 --- a/drivers/mfd/wm8400-core.c +++ b/drivers/mfd/wm8400-core.c | |||
@@ -265,7 +265,7 @@ static int wm8400_init(struct wm8400 *wm8400, | |||
265 | 265 | ||
266 | mutex_init(&wm8400->io_lock); | 266 | mutex_init(&wm8400->io_lock); |
267 | 267 | ||
268 | wm8400->dev->driver_data = wm8400; | 268 | dev_set_drvdata(wm8400->dev, wm8400); |
269 | 269 | ||
270 | /* Check that this is actually a WM8400 */ | 270 | /* Check that this is actually a WM8400 */ |
271 | ret = wm8400->read_dev(wm8400->io_data, WM8400_RESET_ID, 1, ®); | 271 | ret = wm8400->read_dev(wm8400->io_data, WM8400_RESET_ID, 1, ®); |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 01f282cd0989..3b6383168c69 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -2206,7 +2206,7 @@ config SKGE_DEBUG | |||
2206 | depends on SKGE && DEBUG_FS | 2206 | depends on SKGE && DEBUG_FS |
2207 | help | 2207 | help |
2208 | This option adds the ability to dump driver state for debugging. | 2208 | This option adds the ability to dump driver state for debugging. |
2209 | The file debugfs/skge/ethX displays the state of the internal | 2209 | The file /sys/kernel/debug/skge/ethX displays the state of the internal |
2210 | transmit and receive rings. | 2210 | transmit and receive rings. |
2211 | 2211 | ||
2212 | If unsure, say N. | 2212 | If unsure, say N. |
@@ -2232,7 +2232,7 @@ config SKY2_DEBUG | |||
2232 | depends on SKY2 && DEBUG_FS | 2232 | depends on SKY2 && DEBUG_FS |
2233 | help | 2233 | help |
2234 | This option adds the ability to dump driver state for debugging. | 2234 | This option adds the ability to dump driver state for debugging. |
2235 | The file debugfs/sky2/ethX displays the state of the internal | 2235 | The file /sys/kernel/debug/sky2/ethX displays the state of the internal |
2236 | transmit and receive rings. | 2236 | transmit and receive rings. |
2237 | 2237 | ||
2238 | If unsure, say N. | 2238 | If unsure, say N. |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 811d3517fce0..11a0ba47b677 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -1366,6 +1366,7 @@ static const struct file_operations tun_fops = { | |||
1366 | static struct miscdevice tun_miscdev = { | 1366 | static struct miscdevice tun_miscdev = { |
1367 | .minor = TUN_MINOR, | 1367 | .minor = TUN_MINOR, |
1368 | .name = "tun", | 1368 | .name = "tun", |
1369 | .devnode = "net/tun", | ||
1369 | .fops = &tun_fops, | 1370 | .fops = &tun_fops, |
1370 | }; | 1371 | }; |
1371 | 1372 | ||
diff --git a/drivers/net/wimax/i2400m/i2400m.h b/drivers/net/wimax/i2400m/i2400m.h index 1fe5da4cf0a0..60330f313f27 100644 --- a/drivers/net/wimax/i2400m/i2400m.h +++ b/drivers/net/wimax/i2400m/i2400m.h | |||
@@ -432,7 +432,7 @@ struct i2400m { | |||
432 | unsigned ready:1; /* all probing steps done */ | 432 | unsigned ready:1; /* all probing steps done */ |
433 | unsigned rx_reorder:1; /* RX reorder is enabled */ | 433 | unsigned rx_reorder:1; /* RX reorder is enabled */ |
434 | u8 trace_msg_from_user; /* echo rx msgs to 'trace' pipe */ | 434 | u8 trace_msg_from_user; /* echo rx msgs to 'trace' pipe */ |
435 | /* typed u8 so debugfs/u8 can tweak */ | 435 | /* typed u8 so /sys/kernel/debug/u8 can tweak */ |
436 | enum i2400m_system_state state; | 436 | enum i2400m_system_state state; |
437 | wait_queue_head_t state_wq; /* Woken up when on state updates */ | 437 | wait_queue_head_t state_wq; /* Woken up when on state updates */ |
438 | 438 | ||
diff --git a/drivers/net/wireless/ath/ath5k/Kconfig b/drivers/net/wireless/ath/ath5k/Kconfig index 509b6f94f73b..daf0c83527d8 100644 --- a/drivers/net/wireless/ath/ath5k/Kconfig +++ b/drivers/net/wireless/ath/ath5k/Kconfig | |||
@@ -28,11 +28,10 @@ config ATH5K_DEBUG | |||
28 | Say Y, if and you will get debug options for ath5k. | 28 | Say Y, if and you will get debug options for ath5k. |
29 | To use this, you need to mount debugfs: | 29 | To use this, you need to mount debugfs: |
30 | 30 | ||
31 | mkdir /debug/ | 31 | mount -t debugfs debug /sys/kernel/debug |
32 | mount -t debugfs debug /debug/ | ||
33 | 32 | ||
34 | You will get access to files under: | 33 | You will get access to files under: |
35 | /debug/ath5k/phy0/ | 34 | /sys/kernel/debug/ath5k/phy0/ |
36 | 35 | ||
37 | To enable debug, pass the debug level to the debug module | 36 | To enable debug, pass the debug level to the debug module |
38 | parameter. For example: | 37 | parameter. For example: |
diff --git a/drivers/net/wireless/libertas/README b/drivers/net/wireless/libertas/README index d860fc375752..ab6a2d518af0 100644 --- a/drivers/net/wireless/libertas/README +++ b/drivers/net/wireless/libertas/README | |||
@@ -72,7 +72,7 @@ rdrf | |||
72 | location that is to be read. This parameter must be specified in | 72 | location that is to be read. This parameter must be specified in |
73 | hexadecimal (its possible to preceed preceding the number with a "0x"). | 73 | hexadecimal (its possible to preceed preceding the number with a "0x"). |
74 | 74 | ||
75 | Path: /debugfs/libertas_wireless/ethX/registers/ | 75 | Path: /sys/kernel/debug/libertas_wireless/ethX/registers/ |
76 | 76 | ||
77 | Usage: | 77 | Usage: |
78 | echo "0xa123" > rdmac ; cat rdmac | 78 | echo "0xa123" > rdmac ; cat rdmac |
@@ -95,7 +95,7 @@ wrrf | |||
95 | sleepparams | 95 | sleepparams |
96 | This command is used to set the sleepclock configurations | 96 | This command is used to set the sleepclock configurations |
97 | 97 | ||
98 | Path: /debugfs/libertas_wireless/ethX/ | 98 | Path: /sys/kernel/debug/libertas_wireless/ethX/ |
99 | 99 | ||
100 | Usage: | 100 | Usage: |
101 | cat sleepparams: reads the current sleepclock configuration | 101 | cat sleepparams: reads the current sleepclock configuration |
@@ -115,7 +115,7 @@ subscribed_events | |||
115 | The subscribed_events directory contains the interface for the | 115 | The subscribed_events directory contains the interface for the |
116 | subscribed events API. | 116 | subscribed events API. |
117 | 117 | ||
118 | Path: /debugfs/libertas_wireless/ethX/subscribed_events/ | 118 | Path: /sys/kernel/debug/libertas_wireless/ethX/subscribed_events/ |
119 | 119 | ||
120 | Each event is represented by a filename. Each filename consists of the | 120 | Each event is represented by a filename. Each filename consists of the |
121 | following three fields: | 121 | following three fields: |
@@ -165,7 +165,7 @@ subscribed_events | |||
165 | extscan | 165 | extscan |
166 | This command is used to do a specific scan. | 166 | This command is used to do a specific scan. |
167 | 167 | ||
168 | Path: /debugfs/libertas_wireless/ethX/ | 168 | Path: /sys/kernel/debug/libertas_wireless/ethX/ |
169 | 169 | ||
170 | Usage: echo "SSID" > extscan | 170 | Usage: echo "SSID" > extscan |
171 | 171 | ||
@@ -179,7 +179,7 @@ getscantable | |||
179 | Display the current contents of the driver scan table (ie. get the | 179 | Display the current contents of the driver scan table (ie. get the |
180 | scan results). | 180 | scan results). |
181 | 181 | ||
182 | Path: /debugfs/libertas_wireless/ethX/ | 182 | Path: /sys/kernel/debug/libertas_wireless/ethX/ |
183 | 183 | ||
184 | Usage: | 184 | Usage: |
185 | cat getscantable | 185 | cat getscantable |
@@ -188,7 +188,7 @@ setuserscan | |||
188 | Initiate a customized scan and retrieve the results | 188 | Initiate a customized scan and retrieve the results |
189 | 189 | ||
190 | 190 | ||
191 | Path: /debugfs/libertas_wireless/ethX/ | 191 | Path: /sys/kernel/debug/libertas_wireless/ethX/ |
192 | 192 | ||
193 | Usage: | 193 | Usage: |
194 | echo "[ARGS]" > setuserscan | 194 | echo "[ARGS]" > setuserscan |
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c index f8c2898d82b0..06a46d7b3d6c 100644 --- a/drivers/net/wireless/libertas/if_spi.c +++ b/drivers/net/wireless/libertas/if_spi.c | |||
@@ -43,8 +43,8 @@ struct if_spi_card { | |||
43 | struct lbs_private *priv; | 43 | struct lbs_private *priv; |
44 | struct libertas_spi_platform_data *pdata; | 44 | struct libertas_spi_platform_data *pdata; |
45 | 45 | ||
46 | char helper_fw_name[FIRMWARE_NAME_MAX]; | 46 | char helper_fw_name[IF_SPI_FW_NAME_MAX]; |
47 | char main_fw_name[FIRMWARE_NAME_MAX]; | 47 | char main_fw_name[IF_SPI_FW_NAME_MAX]; |
48 | 48 | ||
49 | /* The card ID and card revision, as reported by the hardware. */ | 49 | /* The card ID and card revision, as reported by the hardware. */ |
50 | u16 card_id; | 50 | u16 card_id; |
@@ -1019,9 +1019,9 @@ static int if_spi_calculate_fw_names(u16 card_id, | |||
1019 | lbs_pr_err("Unsupported chip_id: 0x%02x\n", card_id); | 1019 | lbs_pr_err("Unsupported chip_id: 0x%02x\n", card_id); |
1020 | return -EAFNOSUPPORT; | 1020 | return -EAFNOSUPPORT; |
1021 | } | 1021 | } |
1022 | snprintf(helper_fw, FIRMWARE_NAME_MAX, "libertas/gspi%d_hlp.bin", | 1022 | snprintf(helper_fw, IF_SPI_FW_NAME_MAX, "libertas/gspi%d_hlp.bin", |
1023 | chip_id_to_device_name[i].name); | 1023 | chip_id_to_device_name[i].name); |
1024 | snprintf(main_fw, FIRMWARE_NAME_MAX, "libertas/gspi%d.bin", | 1024 | snprintf(main_fw, IF_SPI_FW_NAME_MAX, "libertas/gspi%d.bin", |
1025 | chip_id_to_device_name[i].name); | 1025 | chip_id_to_device_name[i].name); |
1026 | return 0; | 1026 | return 0; |
1027 | } | 1027 | } |
diff --git a/drivers/net/wireless/libertas/if_spi.h b/drivers/net/wireless/libertas/if_spi.h index 2103869cc5b0..f87eec410848 100644 --- a/drivers/net/wireless/libertas/if_spi.h +++ b/drivers/net/wireless/libertas/if_spi.h | |||
@@ -22,6 +22,9 @@ | |||
22 | #define IF_SPI_CMD_BUF_SIZE 2400 | 22 | #define IF_SPI_CMD_BUF_SIZE 2400 |
23 | 23 | ||
24 | /***************** Firmware *****************/ | 24 | /***************** Firmware *****************/ |
25 | |||
26 | #define IF_SPI_FW_NAME_MAX 30 | ||
27 | |||
25 | struct chip_ident { | 28 | struct chip_ident { |
26 | u16 chip_id; | 29 | u16 chip_id; |
27 | u16 name; | 30 | u16 name; |
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index d649caebf08a..1844c5adf6e9 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c | |||
@@ -61,11 +61,9 @@ static ssize_t if_usb_firmware_set(struct device *dev, | |||
61 | { | 61 | { |
62 | struct lbs_private *priv = to_net_dev(dev)->ml_priv; | 62 | struct lbs_private *priv = to_net_dev(dev)->ml_priv; |
63 | struct if_usb_card *cardp = priv->card; | 63 | struct if_usb_card *cardp = priv->card; |
64 | char fwname[FIRMWARE_NAME_MAX]; | ||
65 | int ret; | 64 | int ret; |
66 | 65 | ||
67 | sscanf(buf, "%29s", fwname); /* FIRMWARE_NAME_MAX - 1 = 29 */ | 66 | ret = if_usb_prog_firmware(cardp, buf, BOOT_CMD_UPDATE_FW); |
68 | ret = if_usb_prog_firmware(cardp, fwname, BOOT_CMD_UPDATE_FW); | ||
69 | if (ret == 0) | 67 | if (ret == 0) |
70 | return count; | 68 | return count; |
71 | 69 | ||
@@ -88,11 +86,9 @@ static ssize_t if_usb_boot2_set(struct device *dev, | |||
88 | { | 86 | { |
89 | struct lbs_private *priv = to_net_dev(dev)->ml_priv; | 87 | struct lbs_private *priv = to_net_dev(dev)->ml_priv; |
90 | struct if_usb_card *cardp = priv->card; | 88 | struct if_usb_card *cardp = priv->card; |
91 | char fwname[FIRMWARE_NAME_MAX]; | ||
92 | int ret; | 89 | int ret; |
93 | 90 | ||
94 | sscanf(buf, "%29s", fwname); /* FIRMWARE_NAME_MAX - 1 = 29 */ | 91 | ret = if_usb_prog_firmware(cardp, buf, BOOT_CMD_UPDATE_BOOT2); |
95 | ret = if_usb_prog_firmware(cardp, fwname, BOOT_CMD_UPDATE_BOOT2); | ||
96 | if (ret == 0) | 92 | if (ret == 0) |
97 | return count; | 93 | return count; |
98 | 94 | ||
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index f67325387902..8d88daeed0c6 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -1212,7 +1212,7 @@ static int __devinit netfront_probe(struct xenbus_device *dev, | |||
1212 | } | 1212 | } |
1213 | 1213 | ||
1214 | info = netdev_priv(netdev); | 1214 | info = netdev_priv(netdev); |
1215 | dev->dev.driver_data = info; | 1215 | dev_set_drvdata(&dev->dev, info); |
1216 | 1216 | ||
1217 | err = register_netdev(info->netdev); | 1217 | err = register_netdev(info->netdev); |
1218 | if (err) { | 1218 | if (err) { |
@@ -1233,7 +1233,7 @@ static int __devinit netfront_probe(struct xenbus_device *dev, | |||
1233 | 1233 | ||
1234 | fail: | 1234 | fail: |
1235 | free_netdev(netdev); | 1235 | free_netdev(netdev); |
1236 | dev->dev.driver_data = NULL; | 1236 | dev_set_drvdata(&dev->dev, NULL); |
1237 | return err; | 1237 | return err; |
1238 | } | 1238 | } |
1239 | 1239 | ||
@@ -1275,7 +1275,7 @@ static void xennet_disconnect_backend(struct netfront_info *info) | |||
1275 | */ | 1275 | */ |
1276 | static int netfront_resume(struct xenbus_device *dev) | 1276 | static int netfront_resume(struct xenbus_device *dev) |
1277 | { | 1277 | { |
1278 | struct netfront_info *info = dev->dev.driver_data; | 1278 | struct netfront_info *info = dev_get_drvdata(&dev->dev); |
1279 | 1279 | ||
1280 | dev_dbg(&dev->dev, "%s\n", dev->nodename); | 1280 | dev_dbg(&dev->dev, "%s\n", dev->nodename); |
1281 | 1281 | ||
@@ -1600,7 +1600,7 @@ static int xennet_connect(struct net_device *dev) | |||
1600 | static void backend_changed(struct xenbus_device *dev, | 1600 | static void backend_changed(struct xenbus_device *dev, |
1601 | enum xenbus_state backend_state) | 1601 | enum xenbus_state backend_state) |
1602 | { | 1602 | { |
1603 | struct netfront_info *np = dev->dev.driver_data; | 1603 | struct netfront_info *np = dev_get_drvdata(&dev->dev); |
1604 | struct net_device *netdev = np->netdev; | 1604 | struct net_device *netdev = np->netdev; |
1605 | 1605 | ||
1606 | dev_dbg(&dev->dev, "%s\n", xenbus_strstate(backend_state)); | 1606 | dev_dbg(&dev->dev, "%s\n", xenbus_strstate(backend_state)); |
@@ -1774,7 +1774,7 @@ static struct xenbus_device_id netfront_ids[] = { | |||
1774 | 1774 | ||
1775 | static int __devexit xennet_remove(struct xenbus_device *dev) | 1775 | static int __devexit xennet_remove(struct xenbus_device *dev) |
1776 | { | 1776 | { |
1777 | struct netfront_info *info = dev->dev.driver_data; | 1777 | struct netfront_info *info = dev_get_drvdata(&dev->dev); |
1778 | 1778 | ||
1779 | dev_dbg(&dev->dev, "%s\n", dev->nodename); | 1779 | dev_dbg(&dev->dev, "%s\n", dev->nodename); |
1780 | 1780 | ||
diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c index f415fdd9a885..5b89f404e668 100644 --- a/drivers/parisc/eisa.c +++ b/drivers/parisc/eisa.c | |||
@@ -373,7 +373,7 @@ static int __init eisa_probe(struct parisc_device *dev) | |||
373 | if (result >= 0) { | 373 | if (result >= 0) { |
374 | /* FIXME : Don't enumerate the bus twice. */ | 374 | /* FIXME : Don't enumerate the bus twice. */ |
375 | eisa_dev.root.dev = &dev->dev; | 375 | eisa_dev.root.dev = &dev->dev; |
376 | dev->dev.driver_data = &eisa_dev.root; | 376 | dev_set_drvdata(&dev->dev, &eisa_dev.root); |
377 | eisa_dev.root.bus_base_addr = 0; | 377 | eisa_dev.root.bus_base_addr = 0; |
378 | eisa_dev.root.res = &eisa_dev.hba.io_space; | 378 | eisa_dev.root.res = &eisa_dev.hba.io_space; |
379 | eisa_dev.root.slots = result; | 379 | eisa_dev.root.slots = result; |
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index e5999c4cedc8..d46dd57450ac 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c | |||
@@ -2010,7 +2010,7 @@ void __init sba_init(void) | |||
2010 | void * sba_get_iommu(struct parisc_device *pci_hba) | 2010 | void * sba_get_iommu(struct parisc_device *pci_hba) |
2011 | { | 2011 | { |
2012 | struct parisc_device *sba_dev = parisc_parent(pci_hba); | 2012 | struct parisc_device *sba_dev = parisc_parent(pci_hba); |
2013 | struct sba_device *sba = sba_dev->dev.driver_data; | 2013 | struct sba_device *sba = dev_get_drvdata(&sba_dev->dev); |
2014 | char t = sba_dev->id.hw_type; | 2014 | char t = sba_dev->id.hw_type; |
2015 | int iocnum = (pci_hba->hw_path >> 3); /* rope # */ | 2015 | int iocnum = (pci_hba->hw_path >> 3); /* rope # */ |
2016 | 2016 | ||
@@ -2031,7 +2031,7 @@ void * sba_get_iommu(struct parisc_device *pci_hba) | |||
2031 | void sba_directed_lmmio(struct parisc_device *pci_hba, struct resource *r) | 2031 | void sba_directed_lmmio(struct parisc_device *pci_hba, struct resource *r) |
2032 | { | 2032 | { |
2033 | struct parisc_device *sba_dev = parisc_parent(pci_hba); | 2033 | struct parisc_device *sba_dev = parisc_parent(pci_hba); |
2034 | struct sba_device *sba = sba_dev->dev.driver_data; | 2034 | struct sba_device *sba = dev_get_drvdata(&sba_dev->dev); |
2035 | char t = sba_dev->id.hw_type; | 2035 | char t = sba_dev->id.hw_type; |
2036 | int i; | 2036 | int i; |
2037 | int rope = (pci_hba->hw_path & (ROPES_PER_IOC-1)); /* rope # */ | 2037 | int rope = (pci_hba->hw_path & (ROPES_PER_IOC-1)); /* rope # */ |
@@ -2073,7 +2073,7 @@ void sba_directed_lmmio(struct parisc_device *pci_hba, struct resource *r) | |||
2073 | void sba_distributed_lmmio(struct parisc_device *pci_hba, struct resource *r ) | 2073 | void sba_distributed_lmmio(struct parisc_device *pci_hba, struct resource *r ) |
2074 | { | 2074 | { |
2075 | struct parisc_device *sba_dev = parisc_parent(pci_hba); | 2075 | struct parisc_device *sba_dev = parisc_parent(pci_hba); |
2076 | struct sba_device *sba = sba_dev->dev.driver_data; | 2076 | struct sba_device *sba = dev_get_drvdata(&sba_dev->dev); |
2077 | char t = sba_dev->id.hw_type; | 2077 | char t = sba_dev->id.hw_type; |
2078 | int base, size; | 2078 | int base, size; |
2079 | int rope = (pci_hba->hw_path & (ROPES_PER_IOC-1)); /* rope # */ | 2079 | int rope = (pci_hba->hw_path & (ROPES_PER_IOC-1)); /* rope # */ |
diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index ea31a452b153..5d6de380e42b 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c | |||
@@ -376,14 +376,14 @@ static int __devinit parport_init_chip(struct parisc_device *dev) | |||
376 | /* PARPORT_IRQ_NONE */ PARPORT_DMA_NONE, NULL); | 376 | /* PARPORT_IRQ_NONE */ PARPORT_DMA_NONE, NULL); |
377 | if (p) | 377 | if (p) |
378 | parport_count++; | 378 | parport_count++; |
379 | dev->dev.driver_data = p; | 379 | dev_set_drvdata(&dev->dev, p); |
380 | 380 | ||
381 | return 0; | 381 | return 0; |
382 | } | 382 | } |
383 | 383 | ||
384 | static int __devexit parport_remove_chip(struct parisc_device *dev) | 384 | static int __devexit parport_remove_chip(struct parisc_device *dev) |
385 | { | 385 | { |
386 | struct parport *p = dev->dev.driver_data; | 386 | struct parport *p = dev_get_drvdata(&dev->dev); |
387 | if (p) { | 387 | if (p) { |
388 | struct parport_gsc_private *priv = p->private_data; | 388 | struct parport_gsc_private *priv = p->private_data; |
389 | struct parport_operations *ops = p->ops; | 389 | struct parport_operations *ops = p->ops; |
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index e39982503863..13ffdc35ea0e 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c | |||
@@ -275,7 +275,7 @@ static void pcie_device_init(struct pci_dev *parent, struct pcie_device *dev, | |||
275 | memset(device, 0, sizeof(struct device)); | 275 | memset(device, 0, sizeof(struct device)); |
276 | device->bus = &pcie_port_bus_type; | 276 | device->bus = &pcie_port_bus_type; |
277 | device->driver = NULL; | 277 | device->driver = NULL; |
278 | device->driver_data = NULL; | 278 | dev_set_drvdata(device, NULL); |
279 | device->release = release_pcie_device; /* callback to free pcie dev */ | 279 | device->release = release_pcie_device; /* callback to free pcie dev */ |
280 | dev_set_name(device, "%s:pcie%02x", | 280 | dev_set_name(device, "%s:pcie%02x", |
281 | pci_name(parent), get_descriptor_id(port_type, service_type)); | 281 | pci_name(parent), get_descriptor_id(port_type, service_type)); |
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 47cab31ff6e4..304ff6d5cf3b 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -394,7 +394,7 @@ static int pcmcia_device_probe(struct device * dev) | |||
394 | p_drv = to_pcmcia_drv(dev->driver); | 394 | p_drv = to_pcmcia_drv(dev->driver); |
395 | s = p_dev->socket; | 395 | s = p_dev->socket; |
396 | 396 | ||
397 | /* The PCMCIA code passes the match data in via dev->driver_data | 397 | /* The PCMCIA code passes the match data in via dev_set_drvdata(dev) |
398 | * which is an ugly hack. Once the driver probe is called it may | 398 | * which is an ugly hack. Once the driver probe is called it may |
399 | * and often will overwrite the match data so we must save it first | 399 | * and often will overwrite the match data so we must save it first |
400 | * | 400 | * |
@@ -404,7 +404,7 @@ static int pcmcia_device_probe(struct device * dev) | |||
404 | * call which will then check whether there are two | 404 | * call which will then check whether there are two |
405 | * pseudo devices, and if not, add the second one. | 405 | * pseudo devices, and if not, add the second one. |
406 | */ | 406 | */ |
407 | did = p_dev->dev.driver_data; | 407 | did = dev_get_drvdata(&p_dev->dev); |
408 | 408 | ||
409 | ds_dev_dbg(1, dev, "trying to bind to %s\n", p_drv->drv.name); | 409 | ds_dev_dbg(1, dev, "trying to bind to %s\n", p_drv->drv.name); |
410 | 410 | ||
@@ -499,7 +499,7 @@ static int pcmcia_device_remove(struct device * dev) | |||
499 | * pseudo multi-function card, we need to unbind | 499 | * pseudo multi-function card, we need to unbind |
500 | * all devices | 500 | * all devices |
501 | */ | 501 | */ |
502 | did = p_dev->dev.driver_data; | 502 | did = dev_get_drvdata(&p_dev->dev); |
503 | if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && | 503 | if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && |
504 | (p_dev->socket->device_count != 0) && | 504 | (p_dev->socket->device_count != 0) && |
505 | (p_dev->device_no == 0)) | 505 | (p_dev->device_no == 0)) |
@@ -828,7 +828,6 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename) | |||
828 | { | 828 | { |
829 | struct pcmcia_socket *s = dev->socket; | 829 | struct pcmcia_socket *s = dev->socket; |
830 | const struct firmware *fw; | 830 | const struct firmware *fw; |
831 | char path[FIRMWARE_NAME_MAX]; | ||
832 | int ret = -ENOMEM; | 831 | int ret = -ENOMEM; |
833 | int no_funcs; | 832 | int no_funcs; |
834 | int old_funcs; | 833 | int old_funcs; |
@@ -839,16 +838,7 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename) | |||
839 | 838 | ||
840 | ds_dev_dbg(1, &dev->dev, "trying to load CIS file %s\n", filename); | 839 | ds_dev_dbg(1, &dev->dev, "trying to load CIS file %s\n", filename); |
841 | 840 | ||
842 | if (strlen(filename) > (FIRMWARE_NAME_MAX - 1)) { | 841 | if (request_firmware(&fw, filename, &dev->dev) == 0) { |
843 | dev_printk(KERN_WARNING, &dev->dev, | ||
844 | "pcmcia: CIS filename is too long [%s]\n", | ||
845 | filename); | ||
846 | return -EINVAL; | ||
847 | } | ||
848 | |||
849 | snprintf(path, sizeof(path), "%s", filename); | ||
850 | |||
851 | if (request_firmware(&fw, path, &dev->dev) == 0) { | ||
852 | if (fw->size >= CISTPL_MAX_CIS_SIZE) { | 842 | if (fw->size >= CISTPL_MAX_CIS_SIZE) { |
853 | ret = -EINVAL; | 843 | ret = -EINVAL; |
854 | dev_printk(KERN_ERR, &dev->dev, | 844 | dev_printk(KERN_ERR, &dev->dev, |
@@ -988,7 +978,7 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev, | |||
988 | return 0; | 978 | return 0; |
989 | } | 979 | } |
990 | 980 | ||
991 | dev->dev.driver_data = (void *) did; | 981 | dev_set_drvdata(&dev->dev, did); |
992 | 982 | ||
993 | return 1; | 983 | return 1; |
994 | } | 984 | } |
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index b79f31add39c..04dc734805c6 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c | |||
@@ -364,7 +364,7 @@ static void raw3215_irq(struct ccw_device *cdev, unsigned long intparm, | |||
364 | int cstat, dstat; | 364 | int cstat, dstat; |
365 | int count; | 365 | int count; |
366 | 366 | ||
367 | raw = cdev->dev.driver_data; | 367 | raw = dev_get_drvdata(&cdev->dev); |
368 | req = (struct raw3215_req *) intparm; | 368 | req = (struct raw3215_req *) intparm; |
369 | cstat = irb->scsw.cmd.cstat; | 369 | cstat = irb->scsw.cmd.cstat; |
370 | dstat = irb->scsw.cmd.dstat; | 370 | dstat = irb->scsw.cmd.dstat; |
@@ -652,7 +652,7 @@ static int raw3215_probe (struct ccw_device *cdev) | |||
652 | int line; | 652 | int line; |
653 | 653 | ||
654 | /* Console is special. */ | 654 | /* Console is special. */ |
655 | if (raw3215[0] && (cdev->dev.driver_data == raw3215[0])) | 655 | if (raw3215[0] && (raw3215[0] == dev_get_drvdata(&cdev->dev))) |
656 | return 0; | 656 | return 0; |
657 | raw = kmalloc(sizeof(struct raw3215_info) + | 657 | raw = kmalloc(sizeof(struct raw3215_info) + |
658 | RAW3215_INBUF_SIZE, GFP_KERNEL|GFP_DMA); | 658 | RAW3215_INBUF_SIZE, GFP_KERNEL|GFP_DMA); |
@@ -686,7 +686,7 @@ static int raw3215_probe (struct ccw_device *cdev) | |||
686 | } | 686 | } |
687 | init_waitqueue_head(&raw->empty_wait); | 687 | init_waitqueue_head(&raw->empty_wait); |
688 | 688 | ||
689 | cdev->dev.driver_data = raw; | 689 | dev_set_drvdata(&cdev->dev, raw); |
690 | cdev->handler = raw3215_irq; | 690 | cdev->handler = raw3215_irq; |
691 | 691 | ||
692 | return 0; | 692 | return 0; |
@@ -697,9 +697,9 @@ static void raw3215_remove (struct ccw_device *cdev) | |||
697 | struct raw3215_info *raw; | 697 | struct raw3215_info *raw; |
698 | 698 | ||
699 | ccw_device_set_offline(cdev); | 699 | ccw_device_set_offline(cdev); |
700 | raw = cdev->dev.driver_data; | 700 | raw = dev_get_drvdata(&cdev->dev); |
701 | if (raw) { | 701 | if (raw) { |
702 | cdev->dev.driver_data = NULL; | 702 | dev_set_drvdata(&cdev->dev, NULL); |
703 | kfree(raw->buffer); | 703 | kfree(raw->buffer); |
704 | kfree(raw); | 704 | kfree(raw); |
705 | } | 705 | } |
@@ -709,7 +709,7 @@ static int raw3215_set_online (struct ccw_device *cdev) | |||
709 | { | 709 | { |
710 | struct raw3215_info *raw; | 710 | struct raw3215_info *raw; |
711 | 711 | ||
712 | raw = cdev->dev.driver_data; | 712 | raw = dev_get_drvdata(&cdev->dev); |
713 | if (!raw) | 713 | if (!raw) |
714 | return -ENODEV; | 714 | return -ENODEV; |
715 | 715 | ||
@@ -720,7 +720,7 @@ static int raw3215_set_offline (struct ccw_device *cdev) | |||
720 | { | 720 | { |
721 | struct raw3215_info *raw; | 721 | struct raw3215_info *raw; |
722 | 722 | ||
723 | raw = cdev->dev.driver_data; | 723 | raw = dev_get_drvdata(&cdev->dev); |
724 | if (!raw) | 724 | if (!raw) |
725 | return -ENODEV; | 725 | return -ENODEV; |
726 | 726 | ||
@@ -898,7 +898,7 @@ static int __init con3215_init(void) | |||
898 | raw->buffer = (char *) alloc_bootmem_low(RAW3215_BUFFER_SIZE); | 898 | raw->buffer = (char *) alloc_bootmem_low(RAW3215_BUFFER_SIZE); |
899 | raw->inbuf = (char *) alloc_bootmem_low(RAW3215_INBUF_SIZE); | 899 | raw->inbuf = (char *) alloc_bootmem_low(RAW3215_INBUF_SIZE); |
900 | raw->cdev = cdev; | 900 | raw->cdev = cdev; |
901 | cdev->dev.driver_data = raw; | 901 | dev_set_drvdata(&cdev->dev, raw); |
902 | cdev->handler = raw3215_irq; | 902 | cdev->handler = raw3215_irq; |
903 | 903 | ||
904 | raw->flags |= RAW3215_FIXED; | 904 | raw->flags |= RAW3215_FIXED; |
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c index 81c151b5f0ac..acab7b2dfe8a 100644 --- a/drivers/s390/char/raw3270.c +++ b/drivers/s390/char/raw3270.c | |||
@@ -357,7 +357,7 @@ raw3270_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
357 | struct raw3270_request *rq; | 357 | struct raw3270_request *rq; |
358 | int rc; | 358 | int rc; |
359 | 359 | ||
360 | rp = (struct raw3270 *) cdev->dev.driver_data; | 360 | rp = dev_get_drvdata(&cdev->dev); |
361 | if (!rp) | 361 | if (!rp) |
362 | return; | 362 | return; |
363 | rq = (struct raw3270_request *) intparm; | 363 | rq = (struct raw3270_request *) intparm; |
@@ -831,7 +831,7 @@ raw3270_setup_device(struct ccw_device *cdev, struct raw3270 *rp, char *ascebc) | |||
831 | if (rp->minor == -1) | 831 | if (rp->minor == -1) |
832 | return -EUSERS; | 832 | return -EUSERS; |
833 | rp->cdev = cdev; | 833 | rp->cdev = cdev; |
834 | cdev->dev.driver_data = rp; | 834 | dev_set_drvdata(&cdev->dev, rp); |
835 | cdev->handler = raw3270_irq; | 835 | cdev->handler = raw3270_irq; |
836 | return 0; | 836 | return 0; |
837 | } | 837 | } |
@@ -1112,7 +1112,7 @@ raw3270_delete_device(struct raw3270 *rp) | |||
1112 | /* Disconnect from ccw_device. */ | 1112 | /* Disconnect from ccw_device. */ |
1113 | cdev = rp->cdev; | 1113 | cdev = rp->cdev; |
1114 | rp->cdev = NULL; | 1114 | rp->cdev = NULL; |
1115 | cdev->dev.driver_data = NULL; | 1115 | dev_set_drvdata(&cdev->dev, NULL); |
1116 | cdev->handler = NULL; | 1116 | cdev->handler = NULL; |
1117 | 1117 | ||
1118 | /* Put ccw_device structure. */ | 1118 | /* Put ccw_device structure. */ |
@@ -1136,7 +1136,7 @@ static ssize_t | |||
1136 | raw3270_model_show(struct device *dev, struct device_attribute *attr, char *buf) | 1136 | raw3270_model_show(struct device *dev, struct device_attribute *attr, char *buf) |
1137 | { | 1137 | { |
1138 | return snprintf(buf, PAGE_SIZE, "%i\n", | 1138 | return snprintf(buf, PAGE_SIZE, "%i\n", |
1139 | ((struct raw3270 *) dev->driver_data)->model); | 1139 | ((struct raw3270 *) dev_get_drvdata(dev))->model); |
1140 | } | 1140 | } |
1141 | static DEVICE_ATTR(model, 0444, raw3270_model_show, NULL); | 1141 | static DEVICE_ATTR(model, 0444, raw3270_model_show, NULL); |
1142 | 1142 | ||
@@ -1144,7 +1144,7 @@ static ssize_t | |||
1144 | raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf) | 1144 | raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf) |
1145 | { | 1145 | { |
1146 | return snprintf(buf, PAGE_SIZE, "%i\n", | 1146 | return snprintf(buf, PAGE_SIZE, "%i\n", |
1147 | ((struct raw3270 *) dev->driver_data)->rows); | 1147 | ((struct raw3270 *) dev_get_drvdata(dev))->rows); |
1148 | } | 1148 | } |
1149 | static DEVICE_ATTR(rows, 0444, raw3270_rows_show, NULL); | 1149 | static DEVICE_ATTR(rows, 0444, raw3270_rows_show, NULL); |
1150 | 1150 | ||
@@ -1152,7 +1152,7 @@ static ssize_t | |||
1152 | raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *buf) | 1152 | raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *buf) |
1153 | { | 1153 | { |
1154 | return snprintf(buf, PAGE_SIZE, "%i\n", | 1154 | return snprintf(buf, PAGE_SIZE, "%i\n", |
1155 | ((struct raw3270 *) dev->driver_data)->cols); | 1155 | ((struct raw3270 *) dev_get_drvdata(dev))->cols); |
1156 | } | 1156 | } |
1157 | static DEVICE_ATTR(columns, 0444, raw3270_columns_show, NULL); | 1157 | static DEVICE_ATTR(columns, 0444, raw3270_columns_show, NULL); |
1158 | 1158 | ||
@@ -1289,7 +1289,7 @@ raw3270_remove (struct ccw_device *cdev) | |||
1289 | struct raw3270_view *v; | 1289 | struct raw3270_view *v; |
1290 | struct raw3270_notifier *np; | 1290 | struct raw3270_notifier *np; |
1291 | 1291 | ||
1292 | rp = cdev->dev.driver_data; | 1292 | rp = dev_get_drvdata(&cdev->dev); |
1293 | /* | 1293 | /* |
1294 | * _remove is the opposite of _probe; it's probe that | 1294 | * _remove is the opposite of _probe; it's probe that |
1295 | * should set up rp. raw3270_remove gets entered for | 1295 | * should set up rp. raw3270_remove gets entered for |
@@ -1337,7 +1337,7 @@ raw3270_set_offline (struct ccw_device *cdev) | |||
1337 | { | 1337 | { |
1338 | struct raw3270 *rp; | 1338 | struct raw3270 *rp; |
1339 | 1339 | ||
1340 | rp = cdev->dev.driver_data; | 1340 | rp = dev_get_drvdata(&cdev->dev); |
1341 | if (test_bit(RAW3270_FLAGS_CONSOLE, &rp->flags)) | 1341 | if (test_bit(RAW3270_FLAGS_CONSOLE, &rp->flags)) |
1342 | return -EBUSY; | 1342 | return -EBUSY; |
1343 | raw3270_remove(cdev); | 1343 | raw3270_remove(cdev); |
diff --git a/drivers/s390/char/tape_34xx.c b/drivers/s390/char/tape_34xx.c index 144d2a5e1a92..5a519fac37b7 100644 --- a/drivers/s390/char/tape_34xx.c +++ b/drivers/s390/char/tape_34xx.c | |||
@@ -1289,7 +1289,7 @@ static int | |||
1289 | tape_34xx_online(struct ccw_device *cdev) | 1289 | tape_34xx_online(struct ccw_device *cdev) |
1290 | { | 1290 | { |
1291 | return tape_generic_online( | 1291 | return tape_generic_online( |
1292 | cdev->dev.driver_data, | 1292 | dev_get_drvdata(&cdev->dev), |
1293 | &tape_discipline_34xx | 1293 | &tape_discipline_34xx |
1294 | ); | 1294 | ); |
1295 | } | 1295 | } |
diff --git a/drivers/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c index 23e6598bc4b5..418f72dd39b4 100644 --- a/drivers/s390/char/tape_3590.c +++ b/drivers/s390/char/tape_3590.c | |||
@@ -1703,7 +1703,7 @@ static struct ccw_device_id tape_3590_ids[] = { | |||
1703 | static int | 1703 | static int |
1704 | tape_3590_online(struct ccw_device *cdev) | 1704 | tape_3590_online(struct ccw_device *cdev) |
1705 | { | 1705 | { |
1706 | return tape_generic_online(cdev->dev.driver_data, | 1706 | return tape_generic_online(dev_get_drvdata(&cdev->dev), |
1707 | &tape_discipline_3590); | 1707 | &tape_discipline_3590); |
1708 | } | 1708 | } |
1709 | 1709 | ||
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c index 3ebaa8eb5c86..595aa04cfd01 100644 --- a/drivers/s390/char/tape_core.c +++ b/drivers/s390/char/tape_core.c | |||
@@ -92,7 +92,7 @@ tape_medium_state_show(struct device *dev, struct device_attribute *attr, char * | |||
92 | { | 92 | { |
93 | struct tape_device *tdev; | 93 | struct tape_device *tdev; |
94 | 94 | ||
95 | tdev = (struct tape_device *) dev->driver_data; | 95 | tdev = dev_get_drvdata(dev); |
96 | return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->medium_state); | 96 | return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->medium_state); |
97 | } | 97 | } |
98 | 98 | ||
@@ -104,7 +104,7 @@ tape_first_minor_show(struct device *dev, struct device_attribute *attr, char *b | |||
104 | { | 104 | { |
105 | struct tape_device *tdev; | 105 | struct tape_device *tdev; |
106 | 106 | ||
107 | tdev = (struct tape_device *) dev->driver_data; | 107 | tdev = dev_get_drvdata(dev); |
108 | return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->first_minor); | 108 | return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->first_minor); |
109 | } | 109 | } |
110 | 110 | ||
@@ -116,7 +116,7 @@ tape_state_show(struct device *dev, struct device_attribute *attr, char *buf) | |||
116 | { | 116 | { |
117 | struct tape_device *tdev; | 117 | struct tape_device *tdev; |
118 | 118 | ||
119 | tdev = (struct tape_device *) dev->driver_data; | 119 | tdev = dev_get_drvdata(dev); |
120 | return scnprintf(buf, PAGE_SIZE, "%s\n", (tdev->first_minor < 0) ? | 120 | return scnprintf(buf, PAGE_SIZE, "%s\n", (tdev->first_minor < 0) ? |
121 | "OFFLINE" : tape_state_verbose[tdev->tape_state]); | 121 | "OFFLINE" : tape_state_verbose[tdev->tape_state]); |
122 | } | 122 | } |
@@ -130,7 +130,7 @@ tape_operation_show(struct device *dev, struct device_attribute *attr, char *buf | |||
130 | struct tape_device *tdev; | 130 | struct tape_device *tdev; |
131 | ssize_t rc; | 131 | ssize_t rc; |
132 | 132 | ||
133 | tdev = (struct tape_device *) dev->driver_data; | 133 | tdev = dev_get_drvdata(dev); |
134 | if (tdev->first_minor < 0) | 134 | if (tdev->first_minor < 0) |
135 | return scnprintf(buf, PAGE_SIZE, "N/A\n"); | 135 | return scnprintf(buf, PAGE_SIZE, "N/A\n"); |
136 | 136 | ||
@@ -156,7 +156,7 @@ tape_blocksize_show(struct device *dev, struct device_attribute *attr, char *buf | |||
156 | { | 156 | { |
157 | struct tape_device *tdev; | 157 | struct tape_device *tdev; |
158 | 158 | ||
159 | tdev = (struct tape_device *) dev->driver_data; | 159 | tdev = dev_get_drvdata(dev); |
160 | 160 | ||
161 | return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->char_data.block_size); | 161 | return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->char_data.block_size); |
162 | } | 162 | } |
@@ -440,7 +440,7 @@ tape_generic_offline(struct ccw_device *cdev) | |||
440 | { | 440 | { |
441 | struct tape_device *device; | 441 | struct tape_device *device; |
442 | 442 | ||
443 | device = cdev->dev.driver_data; | 443 | device = dev_get_drvdata(&cdev->dev); |
444 | if (!device) { | 444 | if (!device) { |
445 | return -ENODEV; | 445 | return -ENODEV; |
446 | } | 446 | } |
@@ -583,7 +583,7 @@ tape_generic_probe(struct ccw_device *cdev) | |||
583 | tape_put_device(device); | 583 | tape_put_device(device); |
584 | return ret; | 584 | return ret; |
585 | } | 585 | } |
586 | cdev->dev.driver_data = device; | 586 | dev_set_drvdata(&cdev->dev, device); |
587 | cdev->handler = __tape_do_irq; | 587 | cdev->handler = __tape_do_irq; |
588 | device->cdev = cdev; | 588 | device->cdev = cdev; |
589 | ccw_device_get_id(cdev, &dev_id); | 589 | ccw_device_get_id(cdev, &dev_id); |
@@ -622,7 +622,7 @@ tape_generic_remove(struct ccw_device *cdev) | |||
622 | { | 622 | { |
623 | struct tape_device * device; | 623 | struct tape_device * device; |
624 | 624 | ||
625 | device = cdev->dev.driver_data; | 625 | device = dev_get_drvdata(&cdev->dev); |
626 | if (!device) { | 626 | if (!device) { |
627 | return; | 627 | return; |
628 | } | 628 | } |
@@ -662,9 +662,9 @@ tape_generic_remove(struct ccw_device *cdev) | |||
662 | tape_cleanup_device(device); | 662 | tape_cleanup_device(device); |
663 | } | 663 | } |
664 | 664 | ||
665 | if (cdev->dev.driver_data != NULL) { | 665 | if (!dev_get_drvdata(&cdev->dev)) { |
666 | sysfs_remove_group(&cdev->dev.kobj, &tape_attr_group); | 666 | sysfs_remove_group(&cdev->dev.kobj, &tape_attr_group); |
667 | cdev->dev.driver_data = tape_put_device(cdev->dev.driver_data); | 667 | dev_set_drvdata(&cdev->dev, tape_put_device(dev_get_drvdata(&cdev->dev))); |
668 | } | 668 | } |
669 | } | 669 | } |
670 | 670 | ||
@@ -1060,7 +1060,7 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
1060 | struct tape_request *request; | 1060 | struct tape_request *request; |
1061 | int rc; | 1061 | int rc; |
1062 | 1062 | ||
1063 | device = (struct tape_device *) cdev->dev.driver_data; | 1063 | device = dev_get_drvdata(&cdev->dev); |
1064 | if (device == NULL) { | 1064 | if (device == NULL) { |
1065 | return; | 1065 | return; |
1066 | } | 1066 | } |
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c index e925808c2149..411cfa3c7719 100644 --- a/drivers/s390/char/vmlogrdr.c +++ b/drivers/s390/char/vmlogrdr.c | |||
@@ -504,7 +504,7 @@ static ssize_t vmlogrdr_autopurge_store(struct device * dev, | |||
504 | struct device_attribute *attr, | 504 | struct device_attribute *attr, |
505 | const char * buf, size_t count) | 505 | const char * buf, size_t count) |
506 | { | 506 | { |
507 | struct vmlogrdr_priv_t *priv = dev->driver_data; | 507 | struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); |
508 | ssize_t ret = count; | 508 | ssize_t ret = count; |
509 | 509 | ||
510 | switch (buf[0]) { | 510 | switch (buf[0]) { |
@@ -525,7 +525,7 @@ static ssize_t vmlogrdr_autopurge_show(struct device *dev, | |||
525 | struct device_attribute *attr, | 525 | struct device_attribute *attr, |
526 | char *buf) | 526 | char *buf) |
527 | { | 527 | { |
528 | struct vmlogrdr_priv_t *priv = dev->driver_data; | 528 | struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); |
529 | return sprintf(buf, "%u\n", priv->autopurge); | 529 | return sprintf(buf, "%u\n", priv->autopurge); |
530 | } | 530 | } |
531 | 531 | ||
@@ -541,7 +541,7 @@ static ssize_t vmlogrdr_purge_store(struct device * dev, | |||
541 | 541 | ||
542 | char cp_command[80]; | 542 | char cp_command[80]; |
543 | char cp_response[80]; | 543 | char cp_response[80]; |
544 | struct vmlogrdr_priv_t *priv = dev->driver_data; | 544 | struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); |
545 | 545 | ||
546 | if (buf[0] != '1') | 546 | if (buf[0] != '1') |
547 | return -EINVAL; | 547 | return -EINVAL; |
@@ -578,7 +578,7 @@ static ssize_t vmlogrdr_autorecording_store(struct device *dev, | |||
578 | struct device_attribute *attr, | 578 | struct device_attribute *attr, |
579 | const char *buf, size_t count) | 579 | const char *buf, size_t count) |
580 | { | 580 | { |
581 | struct vmlogrdr_priv_t *priv = dev->driver_data; | 581 | struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); |
582 | ssize_t ret = count; | 582 | ssize_t ret = count; |
583 | 583 | ||
584 | switch (buf[0]) { | 584 | switch (buf[0]) { |
@@ -599,7 +599,7 @@ static ssize_t vmlogrdr_autorecording_show(struct device *dev, | |||
599 | struct device_attribute *attr, | 599 | struct device_attribute *attr, |
600 | char *buf) | 600 | char *buf) |
601 | { | 601 | { |
602 | struct vmlogrdr_priv_t *priv = dev->driver_data; | 602 | struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); |
603 | return sprintf(buf, "%u\n", priv->autorecording); | 603 | return sprintf(buf, "%u\n", priv->autorecording); |
604 | } | 604 | } |
605 | 605 | ||
@@ -612,7 +612,7 @@ static ssize_t vmlogrdr_recording_store(struct device * dev, | |||
612 | struct device_attribute *attr, | 612 | struct device_attribute *attr, |
613 | const char * buf, size_t count) | 613 | const char * buf, size_t count) |
614 | { | 614 | { |
615 | struct vmlogrdr_priv_t *priv = dev->driver_data; | 615 | struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev); |
616 | ssize_t ret; | 616 | ssize_t ret; |
617 | 617 | ||
618 | switch (buf[0]) { | 618 | switch (buf[0]) { |
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c index 92458219a9e9..7d9e67cb6471 100644 --- a/drivers/s390/char/vmur.c +++ b/drivers/s390/char/vmur.c | |||
@@ -80,11 +80,11 @@ static DEFINE_MUTEX(vmur_mutex); | |||
80 | * | 80 | * |
81 | * Each ur device (urd) contains a reference to its corresponding ccw device | 81 | * Each ur device (urd) contains a reference to its corresponding ccw device |
82 | * (cdev) using the urd->cdev pointer. Each ccw device has a reference to the | 82 | * (cdev) using the urd->cdev pointer. Each ccw device has a reference to the |
83 | * ur device using the cdev->dev.driver_data pointer. | 83 | * ur device using dev_get_drvdata(&cdev->dev) pointer. |
84 | * | 84 | * |
85 | * urd references: | 85 | * urd references: |
86 | * - ur_probe gets a urd reference, ur_remove drops the reference | 86 | * - ur_probe gets a urd reference, ur_remove drops the reference |
87 | * (cdev->dev.driver_data) | 87 | * dev_get_drvdata(&cdev->dev) |
88 | * - ur_open gets a urd reference, ur_relase drops the reference | 88 | * - ur_open gets a urd reference, ur_relase drops the reference |
89 | * (urf->urd) | 89 | * (urf->urd) |
90 | * | 90 | * |
@@ -92,7 +92,7 @@ static DEFINE_MUTEX(vmur_mutex); | |||
92 | * - urdev_alloc get a cdev reference (urd->cdev) | 92 | * - urdev_alloc get a cdev reference (urd->cdev) |
93 | * - urdev_free drops the cdev reference (urd->cdev) | 93 | * - urdev_free drops the cdev reference (urd->cdev) |
94 | * | 94 | * |
95 | * Setting and clearing of cdev->dev.driver_data is protected by the ccwdev lock | 95 | * Setting and clearing of dev_get_drvdata(&cdev->dev) is protected by the ccwdev lock |
96 | */ | 96 | */ |
97 | static struct urdev *urdev_alloc(struct ccw_device *cdev) | 97 | static struct urdev *urdev_alloc(struct ccw_device *cdev) |
98 | { | 98 | { |
@@ -131,7 +131,7 @@ static struct urdev *urdev_get_from_cdev(struct ccw_device *cdev) | |||
131 | unsigned long flags; | 131 | unsigned long flags; |
132 | 132 | ||
133 | spin_lock_irqsave(get_ccwdev_lock(cdev), flags); | 133 | spin_lock_irqsave(get_ccwdev_lock(cdev), flags); |
134 | urd = cdev->dev.driver_data; | 134 | urd = dev_get_drvdata(&cdev->dev); |
135 | if (urd) | 135 | if (urd) |
136 | urdev_get(urd); | 136 | urdev_get(urd); |
137 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); | 137 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); |
@@ -310,7 +310,7 @@ static void ur_int_handler(struct ccw_device *cdev, unsigned long intparm, | |||
310 | TRACE("ur_int_handler: unsolicited interrupt\n"); | 310 | TRACE("ur_int_handler: unsolicited interrupt\n"); |
311 | return; | 311 | return; |
312 | } | 312 | } |
313 | urd = cdev->dev.driver_data; | 313 | urd = dev_get_drvdata(&cdev->dev); |
314 | BUG_ON(!urd); | 314 | BUG_ON(!urd); |
315 | /* On special conditions irb is an error pointer */ | 315 | /* On special conditions irb is an error pointer */ |
316 | if (IS_ERR(irb)) | 316 | if (IS_ERR(irb)) |
@@ -856,7 +856,7 @@ static int ur_probe(struct ccw_device *cdev) | |||
856 | goto fail_remove_attr; | 856 | goto fail_remove_attr; |
857 | } | 857 | } |
858 | spin_lock_irq(get_ccwdev_lock(cdev)); | 858 | spin_lock_irq(get_ccwdev_lock(cdev)); |
859 | cdev->dev.driver_data = urd; | 859 | dev_set_drvdata(&cdev->dev, urd); |
860 | spin_unlock_irq(get_ccwdev_lock(cdev)); | 860 | spin_unlock_irq(get_ccwdev_lock(cdev)); |
861 | 861 | ||
862 | mutex_unlock(&vmur_mutex); | 862 | mutex_unlock(&vmur_mutex); |
@@ -996,8 +996,8 @@ static void ur_remove(struct ccw_device *cdev) | |||
996 | ur_remove_attributes(&cdev->dev); | 996 | ur_remove_attributes(&cdev->dev); |
997 | 997 | ||
998 | spin_lock_irqsave(get_ccwdev_lock(cdev), flags); | 998 | spin_lock_irqsave(get_ccwdev_lock(cdev), flags); |
999 | urdev_put(cdev->dev.driver_data); | 999 | urdev_put(dev_get_drvdata(&cdev->dev)); |
1000 | cdev->dev.driver_data = NULL; | 1000 | dev_set_drvdata(&cdev->dev, NULL); |
1001 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); | 1001 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); |
1002 | 1002 | ||
1003 | mutex_unlock(&vmur_mutex); | 1003 | mutex_unlock(&vmur_mutex); |
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index d40f7a934f94..f370f8d460a7 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c | |||
@@ -290,7 +290,7 @@ claw_probe(struct ccwgroup_device *cgdev) | |||
290 | if (!get_device(&cgdev->dev)) | 290 | if (!get_device(&cgdev->dev)) |
291 | return -ENODEV; | 291 | return -ENODEV; |
292 | privptr = kzalloc(sizeof(struct claw_privbk), GFP_KERNEL); | 292 | privptr = kzalloc(sizeof(struct claw_privbk), GFP_KERNEL); |
293 | cgdev->dev.driver_data = privptr; | 293 | dev_set_drvdata(&cgdev->dev, privptr); |
294 | if (privptr == NULL) { | 294 | if (privptr == NULL) { |
295 | probe_error(cgdev); | 295 | probe_error(cgdev); |
296 | put_device(&cgdev->dev); | 296 | put_device(&cgdev->dev); |
@@ -597,14 +597,14 @@ claw_irq_handler(struct ccw_device *cdev, | |||
597 | 597 | ||
598 | CLAW_DBF_TEXT(4, trace, "clawirq"); | 598 | CLAW_DBF_TEXT(4, trace, "clawirq"); |
599 | /* Bypass all 'unsolicited interrupts' */ | 599 | /* Bypass all 'unsolicited interrupts' */ |
600 | if (!cdev->dev.driver_data) { | 600 | privptr = dev_get_drvdata(&cdev->dev); |
601 | if (!privptr) { | ||
601 | dev_warn(&cdev->dev, "An uninitialized CLAW device received an" | 602 | dev_warn(&cdev->dev, "An uninitialized CLAW device received an" |
602 | " IRQ, c-%02x d-%02x\n", | 603 | " IRQ, c-%02x d-%02x\n", |
603 | irb->scsw.cmd.cstat, irb->scsw.cmd.dstat); | 604 | irb->scsw.cmd.cstat, irb->scsw.cmd.dstat); |
604 | CLAW_DBF_TEXT(2, trace, "badirq"); | 605 | CLAW_DBF_TEXT(2, trace, "badirq"); |
605 | return; | 606 | return; |
606 | } | 607 | } |
607 | privptr = (struct claw_privbk *)cdev->dev.driver_data; | ||
608 | 608 | ||
609 | /* Try to extract channel from driver data. */ | 609 | /* Try to extract channel from driver data. */ |
610 | if (privptr->channel[READ].cdev == cdev) | 610 | if (privptr->channel[READ].cdev == cdev) |
@@ -1986,9 +1986,9 @@ probe_error( struct ccwgroup_device *cgdev) | |||
1986 | struct claw_privbk *privptr; | 1986 | struct claw_privbk *privptr; |
1987 | 1987 | ||
1988 | CLAW_DBF_TEXT(4, trace, "proberr"); | 1988 | CLAW_DBF_TEXT(4, trace, "proberr"); |
1989 | privptr = (struct claw_privbk *) cgdev->dev.driver_data; | 1989 | privptr = dev_get_drvdata(&cgdev->dev); |
1990 | if (privptr != NULL) { | 1990 | if (privptr != NULL) { |
1991 | cgdev->dev.driver_data = NULL; | 1991 | dev_set_drvdata(&cgdev->dev, NULL); |
1992 | kfree(privptr->p_env); | 1992 | kfree(privptr->p_env); |
1993 | kfree(privptr->p_mtc_envelope); | 1993 | kfree(privptr->p_mtc_envelope); |
1994 | kfree(privptr); | 1994 | kfree(privptr); |
@@ -2917,9 +2917,9 @@ claw_new_device(struct ccwgroup_device *cgdev) | |||
2917 | dev_info(&cgdev->dev, "add for %s\n", | 2917 | dev_info(&cgdev->dev, "add for %s\n", |
2918 | dev_name(&cgdev->cdev[READ]->dev)); | 2918 | dev_name(&cgdev->cdev[READ]->dev)); |
2919 | CLAW_DBF_TEXT(2, setup, "new_dev"); | 2919 | CLAW_DBF_TEXT(2, setup, "new_dev"); |
2920 | privptr = cgdev->dev.driver_data; | 2920 | privptr = dev_get_drvdata(&cgdev->dev); |
2921 | cgdev->cdev[READ]->dev.driver_data = privptr; | 2921 | dev_set_drvdata(&cgdev->cdev[READ]->dev, privptr); |
2922 | cgdev->cdev[WRITE]->dev.driver_data = privptr; | 2922 | dev_set_drvdata(&cgdev->cdev[WRITE]->dev, privptr); |
2923 | if (!privptr) | 2923 | if (!privptr) |
2924 | return -ENODEV; | 2924 | return -ENODEV; |
2925 | p_env = privptr->p_env; | 2925 | p_env = privptr->p_env; |
@@ -2956,9 +2956,9 @@ claw_new_device(struct ccwgroup_device *cgdev) | |||
2956 | goto out; | 2956 | goto out; |
2957 | } | 2957 | } |
2958 | dev->ml_priv = privptr; | 2958 | dev->ml_priv = privptr; |
2959 | cgdev->dev.driver_data = privptr; | 2959 | dev_set_drvdata(&cgdev->dev, privptr); |
2960 | cgdev->cdev[READ]->dev.driver_data = privptr; | 2960 | dev_set_drvdata(&cgdev->cdev[READ]->dev, privptr); |
2961 | cgdev->cdev[WRITE]->dev.driver_data = privptr; | 2961 | dev_set_drvdata(&cgdev->cdev[WRITE]->dev, privptr); |
2962 | /* sysfs magic */ | 2962 | /* sysfs magic */ |
2963 | SET_NETDEV_DEV(dev, &cgdev->dev); | 2963 | SET_NETDEV_DEV(dev, &cgdev->dev); |
2964 | if (register_netdev(dev) != 0) { | 2964 | if (register_netdev(dev) != 0) { |
@@ -3024,7 +3024,7 @@ claw_shutdown_device(struct ccwgroup_device *cgdev) | |||
3024 | int ret; | 3024 | int ret; |
3025 | 3025 | ||
3026 | CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev)); | 3026 | CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev)); |
3027 | priv = cgdev->dev.driver_data; | 3027 | priv = dev_get_drvdata(&cgdev->dev); |
3028 | if (!priv) | 3028 | if (!priv) |
3029 | return -ENODEV; | 3029 | return -ENODEV; |
3030 | ndev = priv->channel[READ].ndev; | 3030 | ndev = priv->channel[READ].ndev; |
@@ -3054,7 +3054,7 @@ claw_remove_device(struct ccwgroup_device *cgdev) | |||
3054 | 3054 | ||
3055 | BUG_ON(!cgdev); | 3055 | BUG_ON(!cgdev); |
3056 | CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev)); | 3056 | CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev)); |
3057 | priv = cgdev->dev.driver_data; | 3057 | priv = dev_get_drvdata(&cgdev->dev); |
3058 | BUG_ON(!priv); | 3058 | BUG_ON(!priv); |
3059 | dev_info(&cgdev->dev, " will be removed.\n"); | 3059 | dev_info(&cgdev->dev, " will be removed.\n"); |
3060 | if (cgdev->state == CCWGROUP_ONLINE) | 3060 | if (cgdev->state == CCWGROUP_ONLINE) |
@@ -3069,9 +3069,9 @@ claw_remove_device(struct ccwgroup_device *cgdev) | |||
3069 | kfree(priv->channel[1].irb); | 3069 | kfree(priv->channel[1].irb); |
3070 | priv->channel[1].irb=NULL; | 3070 | priv->channel[1].irb=NULL; |
3071 | kfree(priv); | 3071 | kfree(priv); |
3072 | cgdev->dev.driver_data=NULL; | 3072 | dev_set_drvdata(&cgdev->dev, NULL); |
3073 | cgdev->cdev[READ]->dev.driver_data = NULL; | 3073 | dev_set_drvdata(&cgdev->cdev[READ]->dev, NULL); |
3074 | cgdev->cdev[WRITE]->dev.driver_data = NULL; | 3074 | dev_set_drvdata(&cgdev->cdev[WRITE]->dev, NULL); |
3075 | put_device(&cgdev->dev); | 3075 | put_device(&cgdev->dev); |
3076 | 3076 | ||
3077 | return; | 3077 | return; |
@@ -3087,7 +3087,7 @@ claw_hname_show(struct device *dev, struct device_attribute *attr, char *buf) | |||
3087 | struct claw_privbk *priv; | 3087 | struct claw_privbk *priv; |
3088 | struct claw_env * p_env; | 3088 | struct claw_env * p_env; |
3089 | 3089 | ||
3090 | priv = dev->driver_data; | 3090 | priv = dev_get_drvdata(dev); |
3091 | if (!priv) | 3091 | if (!priv) |
3092 | return -ENODEV; | 3092 | return -ENODEV; |
3093 | p_env = priv->p_env; | 3093 | p_env = priv->p_env; |
@@ -3101,7 +3101,7 @@ claw_hname_write(struct device *dev, struct device_attribute *attr, | |||
3101 | struct claw_privbk *priv; | 3101 | struct claw_privbk *priv; |
3102 | struct claw_env * p_env; | 3102 | struct claw_env * p_env; |
3103 | 3103 | ||
3104 | priv = dev->driver_data; | 3104 | priv = dev_get_drvdata(dev); |
3105 | if (!priv) | 3105 | if (!priv) |
3106 | return -ENODEV; | 3106 | return -ENODEV; |
3107 | p_env = priv->p_env; | 3107 | p_env = priv->p_env; |
@@ -3125,7 +3125,7 @@ claw_adname_show(struct device *dev, struct device_attribute *attr, char *buf) | |||
3125 | struct claw_privbk *priv; | 3125 | struct claw_privbk *priv; |
3126 | struct claw_env * p_env; | 3126 | struct claw_env * p_env; |
3127 | 3127 | ||
3128 | priv = dev->driver_data; | 3128 | priv = dev_get_drvdata(dev); |
3129 | if (!priv) | 3129 | if (!priv) |
3130 | return -ENODEV; | 3130 | return -ENODEV; |
3131 | p_env = priv->p_env; | 3131 | p_env = priv->p_env; |
@@ -3139,7 +3139,7 @@ claw_adname_write(struct device *dev, struct device_attribute *attr, | |||
3139 | struct claw_privbk *priv; | 3139 | struct claw_privbk *priv; |
3140 | struct claw_env * p_env; | 3140 | struct claw_env * p_env; |
3141 | 3141 | ||
3142 | priv = dev->driver_data; | 3142 | priv = dev_get_drvdata(dev); |
3143 | if (!priv) | 3143 | if (!priv) |
3144 | return -ENODEV; | 3144 | return -ENODEV; |
3145 | p_env = priv->p_env; | 3145 | p_env = priv->p_env; |
@@ -3163,7 +3163,7 @@ claw_apname_show(struct device *dev, struct device_attribute *attr, char *buf) | |||
3163 | struct claw_privbk *priv; | 3163 | struct claw_privbk *priv; |
3164 | struct claw_env * p_env; | 3164 | struct claw_env * p_env; |
3165 | 3165 | ||
3166 | priv = dev->driver_data; | 3166 | priv = dev_get_drvdata(dev); |
3167 | if (!priv) | 3167 | if (!priv) |
3168 | return -ENODEV; | 3168 | return -ENODEV; |
3169 | p_env = priv->p_env; | 3169 | p_env = priv->p_env; |
@@ -3178,7 +3178,7 @@ claw_apname_write(struct device *dev, struct device_attribute *attr, | |||
3178 | struct claw_privbk *priv; | 3178 | struct claw_privbk *priv; |
3179 | struct claw_env * p_env; | 3179 | struct claw_env * p_env; |
3180 | 3180 | ||
3181 | priv = dev->driver_data; | 3181 | priv = dev_get_drvdata(dev); |
3182 | if (!priv) | 3182 | if (!priv) |
3183 | return -ENODEV; | 3183 | return -ENODEV; |
3184 | p_env = priv->p_env; | 3184 | p_env = priv->p_env; |
@@ -3212,7 +3212,7 @@ claw_wbuff_show(struct device *dev, struct device_attribute *attr, char *buf) | |||
3212 | struct claw_privbk *priv; | 3212 | struct claw_privbk *priv; |
3213 | struct claw_env * p_env; | 3213 | struct claw_env * p_env; |
3214 | 3214 | ||
3215 | priv = dev->driver_data; | 3215 | priv = dev_get_drvdata(dev); |
3216 | if (!priv) | 3216 | if (!priv) |
3217 | return -ENODEV; | 3217 | return -ENODEV; |
3218 | p_env = priv->p_env; | 3218 | p_env = priv->p_env; |
@@ -3227,7 +3227,7 @@ claw_wbuff_write(struct device *dev, struct device_attribute *attr, | |||
3227 | struct claw_env * p_env; | 3227 | struct claw_env * p_env; |
3228 | int nnn,max; | 3228 | int nnn,max; |
3229 | 3229 | ||
3230 | priv = dev->driver_data; | 3230 | priv = dev_get_drvdata(dev); |
3231 | if (!priv) | 3231 | if (!priv) |
3232 | return -ENODEV; | 3232 | return -ENODEV; |
3233 | p_env = priv->p_env; | 3233 | p_env = priv->p_env; |
@@ -3254,7 +3254,7 @@ claw_rbuff_show(struct device *dev, struct device_attribute *attr, char *buf) | |||
3254 | struct claw_privbk *priv; | 3254 | struct claw_privbk *priv; |
3255 | struct claw_env * p_env; | 3255 | struct claw_env * p_env; |
3256 | 3256 | ||
3257 | priv = dev->driver_data; | 3257 | priv = dev_get_drvdata(dev); |
3258 | if (!priv) | 3258 | if (!priv) |
3259 | return -ENODEV; | 3259 | return -ENODEV; |
3260 | p_env = priv->p_env; | 3260 | p_env = priv->p_env; |
@@ -3269,7 +3269,7 @@ claw_rbuff_write(struct device *dev, struct device_attribute *attr, | |||
3269 | struct claw_env *p_env; | 3269 | struct claw_env *p_env; |
3270 | int nnn,max; | 3270 | int nnn,max; |
3271 | 3271 | ||
3272 | priv = dev->driver_data; | 3272 | priv = dev_get_drvdata(dev); |
3273 | if (!priv) | 3273 | if (!priv) |
3274 | return -ENODEV; | 3274 | return -ENODEV; |
3275 | p_env = priv->p_env; | 3275 | p_env = priv->p_env; |
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index 07a25c3f94b6..8c675905448b 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c | |||
@@ -1936,7 +1936,7 @@ lcs_portno_show (struct device *dev, struct device_attribute *attr, char *buf) | |||
1936 | { | 1936 | { |
1937 | struct lcs_card *card; | 1937 | struct lcs_card *card; |
1938 | 1938 | ||
1939 | card = (struct lcs_card *)dev->driver_data; | 1939 | card = dev_get_drvdata(dev); |
1940 | 1940 | ||
1941 | if (!card) | 1941 | if (!card) |
1942 | return 0; | 1942 | return 0; |
@@ -1953,7 +1953,7 @@ lcs_portno_store (struct device *dev, struct device_attribute *attr, const char | |||
1953 | struct lcs_card *card; | 1953 | struct lcs_card *card; |
1954 | int value; | 1954 | int value; |
1955 | 1955 | ||
1956 | card = (struct lcs_card *)dev->driver_data; | 1956 | card = dev_get_drvdata(dev); |
1957 | 1957 | ||
1958 | if (!card) | 1958 | if (!card) |
1959 | return 0; | 1959 | return 0; |
@@ -1987,7 +1987,7 @@ lcs_timeout_show(struct device *dev, struct device_attribute *attr, char *buf) | |||
1987 | { | 1987 | { |
1988 | struct lcs_card *card; | 1988 | struct lcs_card *card; |
1989 | 1989 | ||
1990 | card = (struct lcs_card *)dev->driver_data; | 1990 | card = dev_get_drvdata(dev); |
1991 | 1991 | ||
1992 | return card ? sprintf(buf, "%u\n", card->lancmd_timeout) : 0; | 1992 | return card ? sprintf(buf, "%u\n", card->lancmd_timeout) : 0; |
1993 | } | 1993 | } |
@@ -1998,7 +1998,7 @@ lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char | |||
1998 | struct lcs_card *card; | 1998 | struct lcs_card *card; |
1999 | int value; | 1999 | int value; |
2000 | 2000 | ||
2001 | card = (struct lcs_card *)dev->driver_data; | 2001 | card = dev_get_drvdata(dev); |
2002 | 2002 | ||
2003 | if (!card) | 2003 | if (!card) |
2004 | return 0; | 2004 | return 0; |
@@ -2017,7 +2017,7 @@ static ssize_t | |||
2017 | lcs_dev_recover_store(struct device *dev, struct device_attribute *attr, | 2017 | lcs_dev_recover_store(struct device *dev, struct device_attribute *attr, |
2018 | const char *buf, size_t count) | 2018 | const char *buf, size_t count) |
2019 | { | 2019 | { |
2020 | struct lcs_card *card = dev->driver_data; | 2020 | struct lcs_card *card = dev_get_drvdata(dev); |
2021 | char *tmp; | 2021 | char *tmp; |
2022 | int i; | 2022 | int i; |
2023 | 2023 | ||
@@ -2070,7 +2070,7 @@ lcs_probe_device(struct ccwgroup_device *ccwgdev) | |||
2070 | put_device(&ccwgdev->dev); | 2070 | put_device(&ccwgdev->dev); |
2071 | return ret; | 2071 | return ret; |
2072 | } | 2072 | } |
2073 | ccwgdev->dev.driver_data = card; | 2073 | dev_set_drvdata(&ccwgdev->dev, card); |
2074 | ccwgdev->cdev[0]->handler = lcs_irq; | 2074 | ccwgdev->cdev[0]->handler = lcs_irq; |
2075 | ccwgdev->cdev[1]->handler = lcs_irq; | 2075 | ccwgdev->cdev[1]->handler = lcs_irq; |
2076 | card->gdev = ccwgdev; | 2076 | card->gdev = ccwgdev; |
@@ -2087,7 +2087,7 @@ lcs_register_netdev(struct ccwgroup_device *ccwgdev) | |||
2087 | struct lcs_card *card; | 2087 | struct lcs_card *card; |
2088 | 2088 | ||
2089 | LCS_DBF_TEXT(2, setup, "regnetdv"); | 2089 | LCS_DBF_TEXT(2, setup, "regnetdv"); |
2090 | card = (struct lcs_card *)ccwgdev->dev.driver_data; | 2090 | card = dev_get_drvdata(&ccwgdev->dev); |
2091 | if (card->dev->reg_state != NETREG_UNINITIALIZED) | 2091 | if (card->dev->reg_state != NETREG_UNINITIALIZED) |
2092 | return 0; | 2092 | return 0; |
2093 | SET_NETDEV_DEV(card->dev, &ccwgdev->dev); | 2093 | SET_NETDEV_DEV(card->dev, &ccwgdev->dev); |
@@ -2120,7 +2120,7 @@ lcs_new_device(struct ccwgroup_device *ccwgdev) | |||
2120 | enum lcs_dev_states recover_state; | 2120 | enum lcs_dev_states recover_state; |
2121 | int rc; | 2121 | int rc; |
2122 | 2122 | ||
2123 | card = (struct lcs_card *)ccwgdev->dev.driver_data; | 2123 | card = dev_get_drvdata(&ccwgdev->dev); |
2124 | if (!card) | 2124 | if (!card) |
2125 | return -ENODEV; | 2125 | return -ENODEV; |
2126 | 2126 | ||
@@ -2226,7 +2226,7 @@ __lcs_shutdown_device(struct ccwgroup_device *ccwgdev, int recovery_mode) | |||
2226 | int ret; | 2226 | int ret; |
2227 | 2227 | ||
2228 | LCS_DBF_TEXT(3, setup, "shtdndev"); | 2228 | LCS_DBF_TEXT(3, setup, "shtdndev"); |
2229 | card = (struct lcs_card *)ccwgdev->dev.driver_data; | 2229 | card = dev_get_drvdata(&ccwgdev->dev); |
2230 | if (!card) | 2230 | if (!card) |
2231 | return -ENODEV; | 2231 | return -ENODEV; |
2232 | if (recovery_mode == 0) { | 2232 | if (recovery_mode == 0) { |
@@ -2293,7 +2293,7 @@ lcs_remove_device(struct ccwgroup_device *ccwgdev) | |||
2293 | { | 2293 | { |
2294 | struct lcs_card *card; | 2294 | struct lcs_card *card; |
2295 | 2295 | ||
2296 | card = (struct lcs_card *)ccwgdev->dev.driver_data; | 2296 | card = dev_get_drvdata(&ccwgdev->dev); |
2297 | if (!card) | 2297 | if (!card) |
2298 | return; | 2298 | return; |
2299 | 2299 | ||
diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h index d58fea52557d..6d668642af27 100644 --- a/drivers/s390/net/lcs.h +++ b/drivers/s390/net/lcs.h | |||
@@ -34,8 +34,8 @@ static inline int lcs_dbf_passes(debug_info_t *dbf_grp, int level) | |||
34 | * sysfs related stuff | 34 | * sysfs related stuff |
35 | */ | 35 | */ |
36 | #define CARD_FROM_DEV(cdev) \ | 36 | #define CARD_FROM_DEV(cdev) \ |
37 | (struct lcs_card *) \ | 37 | (struct lcs_card *) dev_get_drvdata( \ |
38 | ((struct ccwgroup_device *)cdev->dev.driver_data)->dev.driver_data; | 38 | &((struct ccwgroup_device *)dev_get_drvdata(&cdev->dev))->dev); |
39 | /** | 39 | /** |
40 | * CCW commands used in this driver | 40 | * CCW commands used in this driver |
41 | */ | 41 | */ |
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index fdb02d043d3e..52574ce797b2 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c | |||
@@ -1452,7 +1452,7 @@ static int netiucv_change_mtu(struct net_device * dev, int new_mtu) | |||
1452 | static ssize_t user_show(struct device *dev, struct device_attribute *attr, | 1452 | static ssize_t user_show(struct device *dev, struct device_attribute *attr, |
1453 | char *buf) | 1453 | char *buf) |
1454 | { | 1454 | { |
1455 | struct netiucv_priv *priv = dev->driver_data; | 1455 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1456 | 1456 | ||
1457 | IUCV_DBF_TEXT(trace, 5, __func__); | 1457 | IUCV_DBF_TEXT(trace, 5, __func__); |
1458 | return sprintf(buf, "%s\n", netiucv_printname(priv->conn->userid)); | 1458 | return sprintf(buf, "%s\n", netiucv_printname(priv->conn->userid)); |
@@ -1461,7 +1461,7 @@ static ssize_t user_show(struct device *dev, struct device_attribute *attr, | |||
1461 | static ssize_t user_write(struct device *dev, struct device_attribute *attr, | 1461 | static ssize_t user_write(struct device *dev, struct device_attribute *attr, |
1462 | const char *buf, size_t count) | 1462 | const char *buf, size_t count) |
1463 | { | 1463 | { |
1464 | struct netiucv_priv *priv = dev->driver_data; | 1464 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1465 | struct net_device *ndev = priv->conn->netdev; | 1465 | struct net_device *ndev = priv->conn->netdev; |
1466 | char *p; | 1466 | char *p; |
1467 | char *tmp; | 1467 | char *tmp; |
@@ -1518,7 +1518,8 @@ static DEVICE_ATTR(user, 0644, user_show, user_write); | |||
1518 | 1518 | ||
1519 | static ssize_t buffer_show (struct device *dev, struct device_attribute *attr, | 1519 | static ssize_t buffer_show (struct device *dev, struct device_attribute *attr, |
1520 | char *buf) | 1520 | char *buf) |
1521 | { struct netiucv_priv *priv = dev->driver_data; | 1521 | { |
1522 | struct netiucv_priv *priv = dev_get_drvdata(dev); | ||
1522 | 1523 | ||
1523 | IUCV_DBF_TEXT(trace, 5, __func__); | 1524 | IUCV_DBF_TEXT(trace, 5, __func__); |
1524 | return sprintf(buf, "%d\n", priv->conn->max_buffsize); | 1525 | return sprintf(buf, "%d\n", priv->conn->max_buffsize); |
@@ -1527,7 +1528,7 @@ static ssize_t buffer_show (struct device *dev, struct device_attribute *attr, | |||
1527 | static ssize_t buffer_write (struct device *dev, struct device_attribute *attr, | 1528 | static ssize_t buffer_write (struct device *dev, struct device_attribute *attr, |
1528 | const char *buf, size_t count) | 1529 | const char *buf, size_t count) |
1529 | { | 1530 | { |
1530 | struct netiucv_priv *priv = dev->driver_data; | 1531 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1531 | struct net_device *ndev = priv->conn->netdev; | 1532 | struct net_device *ndev = priv->conn->netdev; |
1532 | char *e; | 1533 | char *e; |
1533 | int bs1; | 1534 | int bs1; |
@@ -1575,7 +1576,7 @@ static DEVICE_ATTR(buffer, 0644, buffer_show, buffer_write); | |||
1575 | static ssize_t dev_fsm_show (struct device *dev, struct device_attribute *attr, | 1576 | static ssize_t dev_fsm_show (struct device *dev, struct device_attribute *attr, |
1576 | char *buf) | 1577 | char *buf) |
1577 | { | 1578 | { |
1578 | struct netiucv_priv *priv = dev->driver_data; | 1579 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1579 | 1580 | ||
1580 | IUCV_DBF_TEXT(trace, 5, __func__); | 1581 | IUCV_DBF_TEXT(trace, 5, __func__); |
1581 | return sprintf(buf, "%s\n", fsm_getstate_str(priv->fsm)); | 1582 | return sprintf(buf, "%s\n", fsm_getstate_str(priv->fsm)); |
@@ -1586,7 +1587,7 @@ static DEVICE_ATTR(device_fsm_state, 0444, dev_fsm_show, NULL); | |||
1586 | static ssize_t conn_fsm_show (struct device *dev, | 1587 | static ssize_t conn_fsm_show (struct device *dev, |
1587 | struct device_attribute *attr, char *buf) | 1588 | struct device_attribute *attr, char *buf) |
1588 | { | 1589 | { |
1589 | struct netiucv_priv *priv = dev->driver_data; | 1590 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1590 | 1591 | ||
1591 | IUCV_DBF_TEXT(trace, 5, __func__); | 1592 | IUCV_DBF_TEXT(trace, 5, __func__); |
1592 | return sprintf(buf, "%s\n", fsm_getstate_str(priv->conn->fsm)); | 1593 | return sprintf(buf, "%s\n", fsm_getstate_str(priv->conn->fsm)); |
@@ -1597,7 +1598,7 @@ static DEVICE_ATTR(connection_fsm_state, 0444, conn_fsm_show, NULL); | |||
1597 | static ssize_t maxmulti_show (struct device *dev, | 1598 | static ssize_t maxmulti_show (struct device *dev, |
1598 | struct device_attribute *attr, char *buf) | 1599 | struct device_attribute *attr, char *buf) |
1599 | { | 1600 | { |
1600 | struct netiucv_priv *priv = dev->driver_data; | 1601 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1601 | 1602 | ||
1602 | IUCV_DBF_TEXT(trace, 5, __func__); | 1603 | IUCV_DBF_TEXT(trace, 5, __func__); |
1603 | return sprintf(buf, "%ld\n", priv->conn->prof.maxmulti); | 1604 | return sprintf(buf, "%ld\n", priv->conn->prof.maxmulti); |
@@ -1607,7 +1608,7 @@ static ssize_t maxmulti_write (struct device *dev, | |||
1607 | struct device_attribute *attr, | 1608 | struct device_attribute *attr, |
1608 | const char *buf, size_t count) | 1609 | const char *buf, size_t count) |
1609 | { | 1610 | { |
1610 | struct netiucv_priv *priv = dev->driver_data; | 1611 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1611 | 1612 | ||
1612 | IUCV_DBF_TEXT(trace, 4, __func__); | 1613 | IUCV_DBF_TEXT(trace, 4, __func__); |
1613 | priv->conn->prof.maxmulti = 0; | 1614 | priv->conn->prof.maxmulti = 0; |
@@ -1619,7 +1620,7 @@ static DEVICE_ATTR(max_tx_buffer_used, 0644, maxmulti_show, maxmulti_write); | |||
1619 | static ssize_t maxcq_show (struct device *dev, struct device_attribute *attr, | 1620 | static ssize_t maxcq_show (struct device *dev, struct device_attribute *attr, |
1620 | char *buf) | 1621 | char *buf) |
1621 | { | 1622 | { |
1622 | struct netiucv_priv *priv = dev->driver_data; | 1623 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1623 | 1624 | ||
1624 | IUCV_DBF_TEXT(trace, 5, __func__); | 1625 | IUCV_DBF_TEXT(trace, 5, __func__); |
1625 | return sprintf(buf, "%ld\n", priv->conn->prof.maxcqueue); | 1626 | return sprintf(buf, "%ld\n", priv->conn->prof.maxcqueue); |
@@ -1628,7 +1629,7 @@ static ssize_t maxcq_show (struct device *dev, struct device_attribute *attr, | |||
1628 | static ssize_t maxcq_write (struct device *dev, struct device_attribute *attr, | 1629 | static ssize_t maxcq_write (struct device *dev, struct device_attribute *attr, |
1629 | const char *buf, size_t count) | 1630 | const char *buf, size_t count) |
1630 | { | 1631 | { |
1631 | struct netiucv_priv *priv = dev->driver_data; | 1632 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1632 | 1633 | ||
1633 | IUCV_DBF_TEXT(trace, 4, __func__); | 1634 | IUCV_DBF_TEXT(trace, 4, __func__); |
1634 | priv->conn->prof.maxcqueue = 0; | 1635 | priv->conn->prof.maxcqueue = 0; |
@@ -1640,7 +1641,7 @@ static DEVICE_ATTR(max_chained_skbs, 0644, maxcq_show, maxcq_write); | |||
1640 | static ssize_t sdoio_show (struct device *dev, struct device_attribute *attr, | 1641 | static ssize_t sdoio_show (struct device *dev, struct device_attribute *attr, |
1641 | char *buf) | 1642 | char *buf) |
1642 | { | 1643 | { |
1643 | struct netiucv_priv *priv = dev->driver_data; | 1644 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1644 | 1645 | ||
1645 | IUCV_DBF_TEXT(trace, 5, __func__); | 1646 | IUCV_DBF_TEXT(trace, 5, __func__); |
1646 | return sprintf(buf, "%ld\n", priv->conn->prof.doios_single); | 1647 | return sprintf(buf, "%ld\n", priv->conn->prof.doios_single); |
@@ -1649,7 +1650,7 @@ static ssize_t sdoio_show (struct device *dev, struct device_attribute *attr, | |||
1649 | static ssize_t sdoio_write (struct device *dev, struct device_attribute *attr, | 1650 | static ssize_t sdoio_write (struct device *dev, struct device_attribute *attr, |
1650 | const char *buf, size_t count) | 1651 | const char *buf, size_t count) |
1651 | { | 1652 | { |
1652 | struct netiucv_priv *priv = dev->driver_data; | 1653 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1653 | 1654 | ||
1654 | IUCV_DBF_TEXT(trace, 4, __func__); | 1655 | IUCV_DBF_TEXT(trace, 4, __func__); |
1655 | priv->conn->prof.doios_single = 0; | 1656 | priv->conn->prof.doios_single = 0; |
@@ -1661,7 +1662,7 @@ static DEVICE_ATTR(tx_single_write_ops, 0644, sdoio_show, sdoio_write); | |||
1661 | static ssize_t mdoio_show (struct device *dev, struct device_attribute *attr, | 1662 | static ssize_t mdoio_show (struct device *dev, struct device_attribute *attr, |
1662 | char *buf) | 1663 | char *buf) |
1663 | { | 1664 | { |
1664 | struct netiucv_priv *priv = dev->driver_data; | 1665 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1665 | 1666 | ||
1666 | IUCV_DBF_TEXT(trace, 5, __func__); | 1667 | IUCV_DBF_TEXT(trace, 5, __func__); |
1667 | return sprintf(buf, "%ld\n", priv->conn->prof.doios_multi); | 1668 | return sprintf(buf, "%ld\n", priv->conn->prof.doios_multi); |
@@ -1670,7 +1671,7 @@ static ssize_t mdoio_show (struct device *dev, struct device_attribute *attr, | |||
1670 | static ssize_t mdoio_write (struct device *dev, struct device_attribute *attr, | 1671 | static ssize_t mdoio_write (struct device *dev, struct device_attribute *attr, |
1671 | const char *buf, size_t count) | 1672 | const char *buf, size_t count) |
1672 | { | 1673 | { |
1673 | struct netiucv_priv *priv = dev->driver_data; | 1674 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1674 | 1675 | ||
1675 | IUCV_DBF_TEXT(trace, 5, __func__); | 1676 | IUCV_DBF_TEXT(trace, 5, __func__); |
1676 | priv->conn->prof.doios_multi = 0; | 1677 | priv->conn->prof.doios_multi = 0; |
@@ -1682,7 +1683,7 @@ static DEVICE_ATTR(tx_multi_write_ops, 0644, mdoio_show, mdoio_write); | |||
1682 | static ssize_t txlen_show (struct device *dev, struct device_attribute *attr, | 1683 | static ssize_t txlen_show (struct device *dev, struct device_attribute *attr, |
1683 | char *buf) | 1684 | char *buf) |
1684 | { | 1685 | { |
1685 | struct netiucv_priv *priv = dev->driver_data; | 1686 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1686 | 1687 | ||
1687 | IUCV_DBF_TEXT(trace, 5, __func__); | 1688 | IUCV_DBF_TEXT(trace, 5, __func__); |
1688 | return sprintf(buf, "%ld\n", priv->conn->prof.txlen); | 1689 | return sprintf(buf, "%ld\n", priv->conn->prof.txlen); |
@@ -1691,7 +1692,7 @@ static ssize_t txlen_show (struct device *dev, struct device_attribute *attr, | |||
1691 | static ssize_t txlen_write (struct device *dev, struct device_attribute *attr, | 1692 | static ssize_t txlen_write (struct device *dev, struct device_attribute *attr, |
1692 | const char *buf, size_t count) | 1693 | const char *buf, size_t count) |
1693 | { | 1694 | { |
1694 | struct netiucv_priv *priv = dev->driver_data; | 1695 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1695 | 1696 | ||
1696 | IUCV_DBF_TEXT(trace, 4, __func__); | 1697 | IUCV_DBF_TEXT(trace, 4, __func__); |
1697 | priv->conn->prof.txlen = 0; | 1698 | priv->conn->prof.txlen = 0; |
@@ -1703,7 +1704,7 @@ static DEVICE_ATTR(netto_bytes, 0644, txlen_show, txlen_write); | |||
1703 | static ssize_t txtime_show (struct device *dev, struct device_attribute *attr, | 1704 | static ssize_t txtime_show (struct device *dev, struct device_attribute *attr, |
1704 | char *buf) | 1705 | char *buf) |
1705 | { | 1706 | { |
1706 | struct netiucv_priv *priv = dev->driver_data; | 1707 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1707 | 1708 | ||
1708 | IUCV_DBF_TEXT(trace, 5, __func__); | 1709 | IUCV_DBF_TEXT(trace, 5, __func__); |
1709 | return sprintf(buf, "%ld\n", priv->conn->prof.tx_time); | 1710 | return sprintf(buf, "%ld\n", priv->conn->prof.tx_time); |
@@ -1712,7 +1713,7 @@ static ssize_t txtime_show (struct device *dev, struct device_attribute *attr, | |||
1712 | static ssize_t txtime_write (struct device *dev, struct device_attribute *attr, | 1713 | static ssize_t txtime_write (struct device *dev, struct device_attribute *attr, |
1713 | const char *buf, size_t count) | 1714 | const char *buf, size_t count) |
1714 | { | 1715 | { |
1715 | struct netiucv_priv *priv = dev->driver_data; | 1716 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1716 | 1717 | ||
1717 | IUCV_DBF_TEXT(trace, 4, __func__); | 1718 | IUCV_DBF_TEXT(trace, 4, __func__); |
1718 | priv->conn->prof.tx_time = 0; | 1719 | priv->conn->prof.tx_time = 0; |
@@ -1724,7 +1725,7 @@ static DEVICE_ATTR(max_tx_io_time, 0644, txtime_show, txtime_write); | |||
1724 | static ssize_t txpend_show (struct device *dev, struct device_attribute *attr, | 1725 | static ssize_t txpend_show (struct device *dev, struct device_attribute *attr, |
1725 | char *buf) | 1726 | char *buf) |
1726 | { | 1727 | { |
1727 | struct netiucv_priv *priv = dev->driver_data; | 1728 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1728 | 1729 | ||
1729 | IUCV_DBF_TEXT(trace, 5, __func__); | 1730 | IUCV_DBF_TEXT(trace, 5, __func__); |
1730 | return sprintf(buf, "%ld\n", priv->conn->prof.tx_pending); | 1731 | return sprintf(buf, "%ld\n", priv->conn->prof.tx_pending); |
@@ -1733,7 +1734,7 @@ static ssize_t txpend_show (struct device *dev, struct device_attribute *attr, | |||
1733 | static ssize_t txpend_write (struct device *dev, struct device_attribute *attr, | 1734 | static ssize_t txpend_write (struct device *dev, struct device_attribute *attr, |
1734 | const char *buf, size_t count) | 1735 | const char *buf, size_t count) |
1735 | { | 1736 | { |
1736 | struct netiucv_priv *priv = dev->driver_data; | 1737 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1737 | 1738 | ||
1738 | IUCV_DBF_TEXT(trace, 4, __func__); | 1739 | IUCV_DBF_TEXT(trace, 4, __func__); |
1739 | priv->conn->prof.tx_pending = 0; | 1740 | priv->conn->prof.tx_pending = 0; |
@@ -1745,7 +1746,7 @@ static DEVICE_ATTR(tx_pending, 0644, txpend_show, txpend_write); | |||
1745 | static ssize_t txmpnd_show (struct device *dev, struct device_attribute *attr, | 1746 | static ssize_t txmpnd_show (struct device *dev, struct device_attribute *attr, |
1746 | char *buf) | 1747 | char *buf) |
1747 | { | 1748 | { |
1748 | struct netiucv_priv *priv = dev->driver_data; | 1749 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1749 | 1750 | ||
1750 | IUCV_DBF_TEXT(trace, 5, __func__); | 1751 | IUCV_DBF_TEXT(trace, 5, __func__); |
1751 | return sprintf(buf, "%ld\n", priv->conn->prof.tx_max_pending); | 1752 | return sprintf(buf, "%ld\n", priv->conn->prof.tx_max_pending); |
@@ -1754,7 +1755,7 @@ static ssize_t txmpnd_show (struct device *dev, struct device_attribute *attr, | |||
1754 | static ssize_t txmpnd_write (struct device *dev, struct device_attribute *attr, | 1755 | static ssize_t txmpnd_write (struct device *dev, struct device_attribute *attr, |
1755 | const char *buf, size_t count) | 1756 | const char *buf, size_t count) |
1756 | { | 1757 | { |
1757 | struct netiucv_priv *priv = dev->driver_data; | 1758 | struct netiucv_priv *priv = dev_get_drvdata(dev); |
1758 | 1759 | ||
1759 | IUCV_DBF_TEXT(trace, 4, __func__); | 1760 | IUCV_DBF_TEXT(trace, 4, __func__); |
1760 | priv->conn->prof.tx_max_pending = 0; | 1761 | priv->conn->prof.tx_max_pending = 0; |
@@ -1845,7 +1846,7 @@ static int netiucv_register_device(struct net_device *ndev) | |||
1845 | if (ret) | 1846 | if (ret) |
1846 | goto out_unreg; | 1847 | goto out_unreg; |
1847 | priv->dev = dev; | 1848 | priv->dev = dev; |
1848 | dev->driver_data = priv; | 1849 | dev_set_drvdata(dev, priv); |
1849 | return 0; | 1850 | return 0; |
1850 | 1851 | ||
1851 | out_unreg: | 1852 | out_unreg: |
diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c index ed0e3e55652a..538135783aab 100644 --- a/drivers/scsi/aha1740.c +++ b/drivers/scsi/aha1740.c | |||
@@ -646,7 +646,7 @@ static int aha1740_probe (struct device *dev) | |||
646 | 646 | ||
647 | static __devexit int aha1740_remove (struct device *dev) | 647 | static __devexit int aha1740_remove (struct device *dev) |
648 | { | 648 | { |
649 | struct Scsi_Host *shpnt = dev->driver_data; | 649 | struct Scsi_Host *shpnt = dev_get_drvdata(dev); |
650 | struct aha1740_hostdata *host = HOSTDATA (shpnt); | 650 | struct aha1740_hostdata *host = HOSTDATA (shpnt); |
651 | 651 | ||
652 | scsi_remove_host(shpnt); | 652 | scsi_remove_host(shpnt); |
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 11d2602ae88e..869a11bdccbd 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -1877,7 +1877,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) | |||
1877 | unsigned long wait_switch = 0; | 1877 | unsigned long wait_switch = 0; |
1878 | int rc; | 1878 | int rc; |
1879 | 1879 | ||
1880 | vdev->dev.driver_data = NULL; | 1880 | dev_set_drvdata(&vdev->dev, NULL); |
1881 | 1881 | ||
1882 | host = scsi_host_alloc(&driver_template, sizeof(*hostdata)); | 1882 | host = scsi_host_alloc(&driver_template, sizeof(*hostdata)); |
1883 | if (!host) { | 1883 | if (!host) { |
@@ -1949,7 +1949,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) | |||
1949 | scsi_scan_host(host); | 1949 | scsi_scan_host(host); |
1950 | } | 1950 | } |
1951 | 1951 | ||
1952 | vdev->dev.driver_data = hostdata; | 1952 | dev_set_drvdata(&vdev->dev, hostdata); |
1953 | return 0; | 1953 | return 0; |
1954 | 1954 | ||
1955 | add_srp_port_failed: | 1955 | add_srp_port_failed: |
@@ -1968,7 +1968,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) | |||
1968 | 1968 | ||
1969 | static int ibmvscsi_remove(struct vio_dev *vdev) | 1969 | static int ibmvscsi_remove(struct vio_dev *vdev) |
1970 | { | 1970 | { |
1971 | struct ibmvscsi_host_data *hostdata = vdev->dev.driver_data; | 1971 | struct ibmvscsi_host_data *hostdata = dev_get_drvdata(&vdev->dev); |
1972 | unmap_persist_bufs(hostdata); | 1972 | unmap_persist_bufs(hostdata); |
1973 | release_event_pool(&hostdata->pool, hostdata); | 1973 | release_event_pool(&hostdata->pool, hostdata); |
1974 | ibmvscsi_ops->release_crq_queue(&hostdata->queue, hostdata, | 1974 | ibmvscsi_ops->release_crq_queue(&hostdata->queue, hostdata, |
diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c index e2dd6a45924a..d5eaf9727109 100644 --- a/drivers/scsi/ibmvscsi/ibmvstgt.c +++ b/drivers/scsi/ibmvscsi/ibmvstgt.c | |||
@@ -892,7 +892,7 @@ free_vport: | |||
892 | 892 | ||
893 | static int ibmvstgt_remove(struct vio_dev *dev) | 893 | static int ibmvstgt_remove(struct vio_dev *dev) |
894 | { | 894 | { |
895 | struct srp_target *target = (struct srp_target *) dev->dev.driver_data; | 895 | struct srp_target *target = dev_get_drvdata(&dev->dev); |
896 | struct Scsi_Host *shost = target->shost; | 896 | struct Scsi_Host *shost = target->shost; |
897 | struct vio_port *vport = target->ldata; | 897 | struct vio_port *vport = target->ldata; |
898 | 898 | ||
diff --git a/drivers/scsi/libsrp.c b/drivers/scsi/libsrp.c index 15e2d132e8b9..2742ae8a3d09 100644 --- a/drivers/scsi/libsrp.c +++ b/drivers/scsi/libsrp.c | |||
@@ -135,7 +135,7 @@ int srp_target_alloc(struct srp_target *target, struct device *dev, | |||
135 | INIT_LIST_HEAD(&target->cmd_queue); | 135 | INIT_LIST_HEAD(&target->cmd_queue); |
136 | 136 | ||
137 | target->dev = dev; | 137 | target->dev = dev; |
138 | target->dev->driver_data = target; | 138 | dev_set_drvdata(target->dev, target); |
139 | 139 | ||
140 | target->srp_iu_size = iu_size; | 140 | target->srp_iu_size = iu_size; |
141 | target->rx_ring_size = nr; | 141 | target->rx_ring_size = nr; |
diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index 2b02b1fb39a0..8d0f0de76b63 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c | |||
@@ -53,8 +53,7 @@ | |||
53 | * debugfs interface | 53 | * debugfs interface |
54 | * | 54 | * |
55 | * To access this interface the user should: | 55 | * To access this interface the user should: |
56 | * # mkdir /debug | 56 | * # mount -t debugfs none /sys/kernel/debug |
57 | * # mount -t debugfs none /debug | ||
58 | * | 57 | * |
59 | * The lpfc debugfs directory hierarchy is: | 58 | * The lpfc debugfs directory hierarchy is: |
60 | * lpfc/lpfcX/vportY | 59 | * lpfc/lpfcX/vportY |
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c index 14f8fa9135be..54483cd3529e 100644 --- a/drivers/serial/of_serial.c +++ b/drivers/serial/of_serial.c | |||
@@ -122,7 +122,7 @@ static int __devinit of_platform_serial_probe(struct of_device *ofdev, | |||
122 | 122 | ||
123 | info->type = port_type; | 123 | info->type = port_type; |
124 | info->line = ret; | 124 | info->line = ret; |
125 | ofdev->dev.driver_data = info; | 125 | dev_set_drvdata(&ofdev->dev, info); |
126 | return 0; | 126 | return 0; |
127 | out: | 127 | out: |
128 | kfree(info); | 128 | kfree(info); |
@@ -135,7 +135,7 @@ out: | |||
135 | */ | 135 | */ |
136 | static int of_platform_serial_remove(struct of_device *ofdev) | 136 | static int of_platform_serial_remove(struct of_device *ofdev) |
137 | { | 137 | { |
138 | struct of_serial_info *info = ofdev->dev.driver_data; | 138 | struct of_serial_info *info = dev_get_drvdata(&ofdev->dev); |
139 | switch (info->type) { | 139 | switch (info->type) { |
140 | #ifdef CONFIG_SERIAL_8250 | 140 | #ifdef CONFIG_SERIAL_8250 |
141 | case PORT_8250 ... PORT_MAX_8250: | 141 | case PORT_8250 ... PORT_MAX_8250: |
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 5e38ba10a3a9..0a69672097a8 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c | |||
@@ -417,7 +417,7 @@ static LIST_HEAD(thermal_hwmon_list); | |||
417 | static ssize_t | 417 | static ssize_t |
418 | name_show(struct device *dev, struct device_attribute *attr, char *buf) | 418 | name_show(struct device *dev, struct device_attribute *attr, char *buf) |
419 | { | 419 | { |
420 | struct thermal_hwmon_device *hwmon = dev->driver_data; | 420 | struct thermal_hwmon_device *hwmon = dev_get_drvdata(dev); |
421 | return sprintf(buf, "%s\n", hwmon->type); | 421 | return sprintf(buf, "%s\n", hwmon->type); |
422 | } | 422 | } |
423 | static DEVICE_ATTR(name, 0444, name_show, NULL); | 423 | static DEVICE_ATTR(name, 0444, name_show, NULL); |
@@ -488,7 +488,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) | |||
488 | result = PTR_ERR(hwmon->device); | 488 | result = PTR_ERR(hwmon->device); |
489 | goto free_mem; | 489 | goto free_mem; |
490 | } | 490 | } |
491 | hwmon->device->driver_data = hwmon; | 491 | dev_set_drvdata(hwmon->device, hwmon); |
492 | result = device_create_file(hwmon->device, &dev_attr_name); | 492 | result = device_create_file(hwmon->device, &dev_attr_name); |
493 | if (result) | 493 | if (result) |
494 | goto unregister_hwmon_device; | 494 | goto unregister_hwmon_device; |
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index 9cf9ff69e3e3..d171b563e94c 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c | |||
@@ -306,6 +306,7 @@ enum { | |||
306 | #define FW_GET_BYTE(p) *((__u8 *) (p)) | 306 | #define FW_GET_BYTE(p) *((__u8 *) (p)) |
307 | 307 | ||
308 | #define FW_DIR "ueagle-atm/" | 308 | #define FW_DIR "ueagle-atm/" |
309 | #define UEA_FW_NAME_MAX 30 | ||
309 | #define NB_MODEM 4 | 310 | #define NB_MODEM 4 |
310 | 311 | ||
311 | #define BULK_TIMEOUT 300 | 312 | #define BULK_TIMEOUT 300 |
@@ -1564,9 +1565,9 @@ static void cmvs_file_name(struct uea_softc *sc, char *const cmv_name, int ver) | |||
1564 | file = cmv_file[sc->modem_index]; | 1565 | file = cmv_file[sc->modem_index]; |
1565 | 1566 | ||
1566 | strcpy(cmv_name, FW_DIR); | 1567 | strcpy(cmv_name, FW_DIR); |
1567 | strlcat(cmv_name, file, FIRMWARE_NAME_MAX); | 1568 | strlcat(cmv_name, file, UEA_FW_NAME_MAX); |
1568 | if (ver == 2) | 1569 | if (ver == 2) |
1569 | strlcat(cmv_name, ".v2", FIRMWARE_NAME_MAX); | 1570 | strlcat(cmv_name, ".v2", UEA_FW_NAME_MAX); |
1570 | } | 1571 | } |
1571 | 1572 | ||
1572 | static int request_cmvs_old(struct uea_softc *sc, | 1573 | static int request_cmvs_old(struct uea_softc *sc, |
@@ -1574,7 +1575,7 @@ static int request_cmvs_old(struct uea_softc *sc, | |||
1574 | { | 1575 | { |
1575 | int ret, size; | 1576 | int ret, size; |
1576 | u8 *data; | 1577 | u8 *data; |
1577 | char cmv_name[FIRMWARE_NAME_MAX]; /* 30 bytes stack variable */ | 1578 | char cmv_name[UEA_FW_NAME_MAX]; /* 30 bytes stack variable */ |
1578 | 1579 | ||
1579 | cmvs_file_name(sc, cmv_name, 1); | 1580 | cmvs_file_name(sc, cmv_name, 1); |
1580 | ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev); | 1581 | ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev); |
@@ -1608,7 +1609,7 @@ static int request_cmvs(struct uea_softc *sc, | |||
1608 | int ret, size; | 1609 | int ret, size; |
1609 | u32 crc; | 1610 | u32 crc; |
1610 | u8 *data; | 1611 | u8 *data; |
1611 | char cmv_name[FIRMWARE_NAME_MAX]; /* 30 bytes stack variable */ | 1612 | char cmv_name[UEA_FW_NAME_MAX]; /* 30 bytes stack variable */ |
1612 | 1613 | ||
1613 | cmvs_file_name(sc, cmv_name, 2); | 1614 | cmvs_file_name(sc, cmv_name, 2); |
1614 | ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev); | 1615 | ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev); |
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index d2747a49b974..26c09f0257db 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c | |||
@@ -1057,8 +1057,14 @@ static const struct file_operations usblp_fops = { | |||
1057 | .release = usblp_release, | 1057 | .release = usblp_release, |
1058 | }; | 1058 | }; |
1059 | 1059 | ||
1060 | static char *usblp_nodename(struct device *dev) | ||
1061 | { | ||
1062 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); | ||
1063 | } | ||
1064 | |||
1060 | static struct usb_class_driver usblp_class = { | 1065 | static struct usb_class_driver usblp_class = { |
1061 | .name = "lp%d", | 1066 | .name = "lp%d", |
1067 | .nodename = usblp_nodename, | ||
1062 | .fops = &usblp_fops, | 1068 | .fops = &usblp_fops, |
1063 | .minor_base = USBLP_MINOR_BASE, | 1069 | .minor_base = USBLP_MINOR_BASE, |
1064 | }; | 1070 | }; |
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index 997e659ff693..5cef88929b3e 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c | |||
@@ -67,6 +67,16 @@ static struct usb_class { | |||
67 | struct class *class; | 67 | struct class *class; |
68 | } *usb_class; | 68 | } *usb_class; |
69 | 69 | ||
70 | static char *usb_nodename(struct device *dev) | ||
71 | { | ||
72 | struct usb_class_driver *drv; | ||
73 | |||
74 | drv = dev_get_drvdata(dev); | ||
75 | if (!drv || !drv->nodename) | ||
76 | return NULL; | ||
77 | return drv->nodename(dev); | ||
78 | } | ||
79 | |||
70 | static int init_usb_class(void) | 80 | static int init_usb_class(void) |
71 | { | 81 | { |
72 | int result = 0; | 82 | int result = 0; |
@@ -90,6 +100,7 @@ static int init_usb_class(void) | |||
90 | kfree(usb_class); | 100 | kfree(usb_class); |
91 | usb_class = NULL; | 101 | usb_class = NULL; |
92 | } | 102 | } |
103 | usb_class->class->nodename = usb_nodename; | ||
93 | 104 | ||
94 | exit: | 105 | exit: |
95 | return result; | 106 | return result; |
@@ -198,7 +209,7 @@ int usb_register_dev(struct usb_interface *intf, | |||
198 | else | 209 | else |
199 | temp = name; | 210 | temp = name; |
200 | intf->usb_dev = device_create(usb_class->class, &intf->dev, | 211 | intf->usb_dev = device_create(usb_class->class, &intf->dev, |
201 | MKDEV(USB_MAJOR, minor), NULL, | 212 | MKDEV(USB_MAJOR, minor), class_driver, |
202 | "%s", temp); | 213 | "%s", temp); |
203 | if (IS_ERR(intf->usb_dev)) { | 214 | if (IS_ERR(intf->usb_dev)) { |
204 | down_write(&minor_rwsem); | 215 | down_write(&minor_rwsem); |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 7eee400d3e32..927a27dd2f85 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -305,10 +305,21 @@ static struct dev_pm_ops usb_device_pm_ops = { | |||
305 | 305 | ||
306 | #endif /* CONFIG_PM */ | 306 | #endif /* CONFIG_PM */ |
307 | 307 | ||
308 | |||
309 | static char *usb_nodename(struct device *dev) | ||
310 | { | ||
311 | struct usb_device *usb_dev; | ||
312 | |||
313 | usb_dev = to_usb_device(dev); | ||
314 | return kasprintf(GFP_KERNEL, "bus/usb/%03d/%03d", | ||
315 | usb_dev->bus->busnum, usb_dev->devnum); | ||
316 | } | ||
317 | |||
308 | struct device_type usb_device_type = { | 318 | struct device_type usb_device_type = { |
309 | .name = "usb_device", | 319 | .name = "usb_device", |
310 | .release = usb_release_dev, | 320 | .release = usb_release_dev, |
311 | .uevent = usb_dev_uevent, | 321 | .uevent = usb_dev_uevent, |
322 | .nodename = usb_nodename, | ||
312 | .pm = &usb_device_pm_ops, | 323 | .pm = &usb_device_pm_ops, |
313 | }; | 324 | }; |
314 | 325 | ||
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 0b2bb8f0706d..53bcdd2f8282 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
@@ -1574,7 +1574,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver) | |||
1574 | 1574 | ||
1575 | udc->driver = driver; | 1575 | udc->driver = driver; |
1576 | udc->gadget.dev.driver = &driver->driver; | 1576 | udc->gadget.dev.driver = &driver->driver; |
1577 | udc->gadget.dev.driver_data = &driver->driver; | 1577 | dev_set_drvdata(&udc->gadget.dev, &driver->driver); |
1578 | udc->enabled = 1; | 1578 | udc->enabled = 1; |
1579 | udc->selfpowered = 1; | 1579 | udc->selfpowered = 1; |
1580 | 1580 | ||
@@ -1583,7 +1583,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver) | |||
1583 | DBG("driver->bind() returned %d\n", retval); | 1583 | DBG("driver->bind() returned %d\n", retval); |
1584 | udc->driver = NULL; | 1584 | udc->driver = NULL; |
1585 | udc->gadget.dev.driver = NULL; | 1585 | udc->gadget.dev.driver = NULL; |
1586 | udc->gadget.dev.driver_data = NULL; | 1586 | dev_set_drvdata(&udc->gadget.dev, NULL); |
1587 | udc->enabled = 0; | 1587 | udc->enabled = 0; |
1588 | udc->selfpowered = 0; | 1588 | udc->selfpowered = 0; |
1589 | return retval; | 1589 | return retval; |
@@ -1613,7 +1613,7 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver) | |||
1613 | 1613 | ||
1614 | driver->unbind(&udc->gadget); | 1614 | driver->unbind(&udc->gadget); |
1615 | udc->gadget.dev.driver = NULL; | 1615 | udc->gadget.dev.driver = NULL; |
1616 | udc->gadget.dev.driver_data = NULL; | 1616 | dev_set_drvdata(&udc->gadget.dev, NULL); |
1617 | udc->driver = NULL; | 1617 | udc->driver = NULL; |
1618 | 1618 | ||
1619 | DBG("unbound from %s\n", driver->driver.name); | 1619 | DBG("unbound from %s\n", driver->driver.name); |
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index a4ef77ef917d..3c5fe5cee05a 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c | |||
@@ -726,12 +726,18 @@ static const struct file_operations iowarrior_fops = { | |||
726 | .poll = iowarrior_poll, | 726 | .poll = iowarrior_poll, |
727 | }; | 727 | }; |
728 | 728 | ||
729 | static char *iowarrior_nodename(struct device *dev) | ||
730 | { | ||
731 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); | ||
732 | } | ||
733 | |||
729 | /* | 734 | /* |
730 | * usb class driver info in order to get a minor number from the usb core, | 735 | * usb class driver info in order to get a minor number from the usb core, |
731 | * and to have the device registered with devfs and the driver core | 736 | * and to have the device registered with devfs and the driver core |
732 | */ | 737 | */ |
733 | static struct usb_class_driver iowarrior_class = { | 738 | static struct usb_class_driver iowarrior_class = { |
734 | .name = "iowarrior%d", | 739 | .name = "iowarrior%d", |
740 | .nodename = iowarrior_nodename, | ||
735 | .fops = &iowarrior_fops, | 741 | .fops = &iowarrior_fops, |
736 | .minor_base = IOWARRIOR_MINOR_BASE, | 742 | .minor_base = IOWARRIOR_MINOR_BASE, |
737 | }; | 743 | }; |
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index ab0f3226158b..c1e2433f640d 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c | |||
@@ -266,12 +266,18 @@ static const struct file_operations tower_fops = { | |||
266 | .llseek = tower_llseek, | 266 | .llseek = tower_llseek, |
267 | }; | 267 | }; |
268 | 268 | ||
269 | static char *legousbtower_nodename(struct device *dev) | ||
270 | { | ||
271 | return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); | ||
272 | } | ||
273 | |||
269 | /* | 274 | /* |
270 | * usb class driver info in order to get a minor number from the usb core, | 275 | * usb class driver info in order to get a minor number from the usb core, |
271 | * and to have the device registered with the driver core | 276 | * and to have the device registered with the driver core |
272 | */ | 277 | */ |
273 | static struct usb_class_driver tower_class = { | 278 | static struct usb_class_driver tower_class = { |
274 | .name = "legousbtower%d", | 279 | .name = "legousbtower%d", |
280 | .nodename = legousbtower_nodename, | ||
275 | .fops = &tower_fops, | 281 | .fops = &tower_fops, |
276 | .minor_base = LEGO_USB_TOWER_MINOR_BASE, | 282 | .minor_base = LEGO_USB_TOWER_MINOR_BASE, |
277 | }; | 283 | }; |
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c index 2493f05e9f61..15502d5e3641 100644 --- a/drivers/video/xen-fbfront.c +++ b/drivers/video/xen-fbfront.c | |||
@@ -384,7 +384,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev, | |||
384 | fb_size = XENFB_DEFAULT_FB_LEN; | 384 | fb_size = XENFB_DEFAULT_FB_LEN; |
385 | } | 385 | } |
386 | 386 | ||
387 | dev->dev.driver_data = info; | 387 | dev_set_drvdata(&dev->dev, info); |
388 | info->xbdev = dev; | 388 | info->xbdev = dev; |
389 | info->irq = -1; | 389 | info->irq = -1; |
390 | info->x1 = info->y1 = INT_MAX; | 390 | info->x1 = info->y1 = INT_MAX; |
@@ -503,7 +503,7 @@ xenfb_make_preferred_console(void) | |||
503 | 503 | ||
504 | static int xenfb_resume(struct xenbus_device *dev) | 504 | static int xenfb_resume(struct xenbus_device *dev) |
505 | { | 505 | { |
506 | struct xenfb_info *info = dev->dev.driver_data; | 506 | struct xenfb_info *info = dev_get_drvdata(&dev->dev); |
507 | 507 | ||
508 | xenfb_disconnect_backend(info); | 508 | xenfb_disconnect_backend(info); |
509 | xenfb_init_shared_page(info, info->fb_info); | 509 | xenfb_init_shared_page(info, info->fb_info); |
@@ -512,7 +512,7 @@ static int xenfb_resume(struct xenbus_device *dev) | |||
512 | 512 | ||
513 | static int xenfb_remove(struct xenbus_device *dev) | 513 | static int xenfb_remove(struct xenbus_device *dev) |
514 | { | 514 | { |
515 | struct xenfb_info *info = dev->dev.driver_data; | 515 | struct xenfb_info *info = dev_get_drvdata(&dev->dev); |
516 | 516 | ||
517 | xenfb_disconnect_backend(info); | 517 | xenfb_disconnect_backend(info); |
518 | if (info->fb_info) { | 518 | if (info->fb_info) { |
@@ -621,7 +621,7 @@ static void xenfb_disconnect_backend(struct xenfb_info *info) | |||
621 | static void xenfb_backend_changed(struct xenbus_device *dev, | 621 | static void xenfb_backend_changed(struct xenbus_device *dev, |
622 | enum xenbus_state backend_state) | 622 | enum xenbus_state backend_state) |
623 | { | 623 | { |
624 | struct xenfb_info *info = dev->dev.driver_data; | 624 | struct xenfb_info *info = dev_get_drvdata(&dev->dev); |
625 | int val; | 625 | int val; |
626 | 626 | ||
627 | switch (backend_state) { | 627 | switch (backend_state) { |