aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2005-11-16 03:00:00 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-04 19:18:08 -0500
commit312c004d36ce6c739512bac83b452f4c20ab1f62 (patch)
treee61e8331680a0da29557fe21414d3b31e62c9293 /drivers/base
parent5f123fbd80f4f788554636f02bf73e40f914e0d6 (diff)
[PATCH] driver core: replace "hotplug" by "uevent"
Leave the overloaded "hotplug" word to susbsystems which are handling real devices. The driver core does not "plug" anything, it just exports the state to userspace and generates events. Signed-off-by: Kay Sievers <kay.sievers@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/Kconfig4
-rw-r--r--drivers/base/class.c66
-rw-r--r--drivers/base/core.c42
-rw-r--r--drivers/base/cpu.c4
-rw-r--r--drivers/base/firmware_class.c45
-rw-r--r--drivers/base/memory.c12
6 files changed, 86 insertions, 87 deletions
diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
index 934149c1512b..f0eff3dac58d 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -19,11 +19,11 @@ config PREVENT_FIRMWARE_BUILD
19 If unsure say Y here. 19 If unsure say Y here.
20 20
21config FW_LOADER 21config FW_LOADER
22 tristate "Hotplug firmware loading support" 22 tristate "Userspace firmware loading support"
23 select HOTPLUG 23 select HOTPLUG
24 ---help--- 24 ---help---
25 This option is provided for the case where no in-kernel-tree modules 25 This option is provided for the case where no in-kernel-tree modules
26 require hotplug firmware loading support, but a module built outside 26 require userspace firmware loading support, but a module built outside
27 the kernel tree does. 27 the kernel tree does.
28 28
29config DEBUG_DRIVER 29config DEBUG_DRIVER
diff --git a/drivers/base/class.c b/drivers/base/class.c
index db65fd0babe9..df7fdabd0730 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -178,7 +178,7 @@ static void class_device_create_release(struct class_device *class_dev)
178} 178}
179 179
180/* needed to allow these devices to have parent class devices */ 180/* needed to allow these devices to have parent class devices */
181static int class_device_create_hotplug(struct class_device *class_dev, 181static int class_device_create_uevent(struct class_device *class_dev,
182 char **envp, int num_envp, 182 char **envp, int num_envp,
183 char *buffer, int buffer_size) 183 char *buffer, int buffer_size)
184{ 184{
@@ -331,7 +331,7 @@ static struct kobj_type ktype_class_device = {
331 .release = class_dev_release, 331 .release = class_dev_release,
332}; 332};
333 333
334static int class_hotplug_filter(struct kset *kset, struct kobject *kobj) 334static int class_uevent_filter(struct kset *kset, struct kobject *kobj)
335{ 335{
336 struct kobj_type *ktype = get_ktype(kobj); 336 struct kobj_type *ktype = get_ktype(kobj);
337 337
@@ -343,14 +343,14 @@ static int class_hotplug_filter(struct kset *kset, struct kobject *kobj)
343 return 0; 343 return 0;
344} 344}
345 345
346static const char *class_hotplug_name(struct kset *kset, struct kobject *kobj) 346static const char *class_uevent_name(struct kset *kset, struct kobject *kobj)
347{ 347{
348 struct class_device *class_dev = to_class_dev(kobj); 348 struct class_device *class_dev = to_class_dev(kobj);
349 349
350 return class_dev->class->name; 350 return class_dev->class->name;
351} 351}
352 352
353static int class_hotplug(struct kset *kset, struct kobject *kobj, char **envp, 353static int class_uevent(struct kset *kset, struct kobject *kobj, char **envp,
354 int num_envp, char *buffer, int buffer_size) 354 int num_envp, char *buffer, int buffer_size)
355{ 355{
356 struct class_device *class_dev = to_class_dev(kobj); 356 struct class_device *class_dev = to_class_dev(kobj);
@@ -365,29 +365,29 @@ static int class_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
365 struct device *dev = class_dev->dev; 365 struct device *dev = class_dev->dev;
366 char *path = kobject_get_path(&dev->kobj, GFP_KERNEL); 366 char *path = kobject_get_path(&dev->kobj, GFP_KERNEL);
367 367
368 add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, 368 add_uevent_var(envp, num_envp, &i, buffer, buffer_size,
369 &length, "PHYSDEVPATH=%s", path); 369 &length, "PHYSDEVPATH=%s", path);
370 kfree(path); 370 kfree(path);
371 371
372 if (dev->bus) 372 if (dev->bus)
373 add_hotplug_env_var(envp, num_envp, &i, 373 add_uevent_var(envp, num_envp, &i,
374 buffer, buffer_size, &length, 374 buffer, buffer_size, &length,
375 "PHYSDEVBUS=%s", dev->bus->name); 375 "PHYSDEVBUS=%s", dev->bus->name);
376 376
377 if (dev->driver) 377 if (dev->driver)
378 add_hotplug_env_var(envp, num_envp, &i, 378 add_uevent_var(envp, num_envp, &i,
379 buffer, buffer_size, &length, 379 buffer, buffer_size, &length,
380 "PHYSDEVDRIVER=%s", dev->driver->name); 380 "PHYSDEVDRIVER=%s", dev->driver->name);
381 } 381 }
382 382
383 if (MAJOR(class_dev->devt)) { 383 if (MAJOR(class_dev->devt)) {
384 add_hotplug_env_var(envp, num_envp, &i, 384 add_uevent_var(envp, num_envp, &i,
385 buffer, buffer_size, &length, 385 buffer, buffer_size, &length,
386 "MAJOR=%u", MAJOR(class_dev->devt)); 386 "MAJOR=%u", MAJOR(class_dev->devt));
387 387
388 add_hotplug_env_var(envp, num_envp, &i, 388 add_uevent_var(envp, num_envp, &i,
389 buffer, buffer_size, &length, 389 buffer, buffer_size, &length,
390 "MINOR=%u", MINOR(class_dev->devt)); 390 "MINOR=%u", MINOR(class_dev->devt));
391 } 391 }
392 392
393 /* terminate, set to next free slot, shrink available space */ 393 /* terminate, set to next free slot, shrink available space */
@@ -397,30 +397,30 @@ static int class_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
397 buffer = &buffer[length]; 397 buffer = &buffer[length];
398 buffer_size -= length; 398 buffer_size -= length;
399 399
400 if (class_dev->hotplug) { 400 if (class_dev->uevent) {
401 /* have the class device specific function add its stuff */ 401 /* have the class device specific function add its stuff */
402 retval = class_dev->hotplug(class_dev, envp, num_envp, 402 retval = class_dev->uevent(class_dev, envp, num_envp,
403 buffer, buffer_size); 403 buffer, buffer_size);
404 if (retval) 404 if (retval)
405 pr_debug("class_dev->hotplug() returned %d\n", retval); 405 pr_debug("class_dev->uevent() returned %d\n", retval);
406 } else if (class_dev->class->hotplug) { 406 } else if (class_dev->class->uevent) {
407 /* have the class specific function add its stuff */ 407 /* have the class specific function add its stuff */
408 retval = class_dev->class->hotplug(class_dev, envp, num_envp, 408 retval = class_dev->class->uevent(class_dev, envp, num_envp,
409 buffer, buffer_size); 409 buffer, buffer_size);
410 if (retval) 410 if (retval)
411 pr_debug("class->hotplug() returned %d\n", retval); 411 pr_debug("class->uevent() returned %d\n", retval);
412 } 412 }
413 413
414 return retval; 414 return retval;
415} 415}
416 416
417static struct kset_hotplug_ops class_hotplug_ops = { 417static struct kset_uevent_ops class_uevent_ops = {
418 .filter = class_hotplug_filter, 418 .filter = class_uevent_filter,
419 .name = class_hotplug_name, 419 .name = class_uevent_name,
420 .hotplug = class_hotplug, 420 .uevent = class_uevent,
421}; 421};
422 422
423static decl_subsys(class_obj, &ktype_class_device, &class_hotplug_ops); 423static decl_subsys(class_obj, &ktype_class_device, &class_uevent_ops);
424 424
425 425
426static int class_device_add_attrs(struct class_device * cd) 426static int class_device_add_attrs(struct class_device * cd)
@@ -464,7 +464,7 @@ static ssize_t show_dev(struct class_device *class_dev, char *buf)
464static ssize_t store_uevent(struct class_device *class_dev, 464static ssize_t store_uevent(struct class_device *class_dev,
465 const char *buf, size_t count) 465 const char *buf, size_t count)
466{ 466{
467 kobject_hotplug(&class_dev->kobj, KOBJ_ADD); 467 kobject_uevent(&class_dev->kobj, KOBJ_ADD);
468 return count; 468 return count;
469} 469}
470 470
@@ -559,7 +559,7 @@ int class_device_add(struct class_device *class_dev)
559 class_name); 559 class_name);
560 } 560 }
561 561
562 kobject_hotplug(&class_dev->kobj, KOBJ_ADD); 562 kobject_uevent(&class_dev->kobj, KOBJ_ADD);
563 563
564 /* notify any interfaces this device is now here */ 564 /* notify any interfaces this device is now here */
565 if (parent_class) { 565 if (parent_class) {
@@ -632,7 +632,7 @@ struct class_device *class_device_create(struct class *cls,
632 class_dev->class = cls; 632 class_dev->class = cls;
633 class_dev->parent = parent; 633 class_dev->parent = parent;
634 class_dev->release = class_device_create_release; 634 class_dev->release = class_device_create_release;
635 class_dev->hotplug = class_device_create_hotplug; 635 class_dev->uevent = class_device_create_uevent;
636 636
637 va_start(args, fmt); 637 va_start(args, fmt);
638 vsnprintf(class_dev->class_id, BUS_ID_SIZE, fmt, args); 638 vsnprintf(class_dev->class_id, BUS_ID_SIZE, fmt, args);
@@ -674,7 +674,7 @@ void class_device_del(struct class_device *class_dev)
674 class_device_remove_file(class_dev, class_dev->devt_attr); 674 class_device_remove_file(class_dev, class_dev->devt_attr);
675 class_device_remove_attrs(class_dev); 675 class_device_remove_attrs(class_dev);
676 676
677 kobject_hotplug(&class_dev->kobj, KOBJ_REMOVE); 677 kobject_uevent(&class_dev->kobj, KOBJ_REMOVE);
678 kobject_del(&class_dev->kobj); 678 kobject_del(&class_dev->kobj);
679 679
680 class_device_put(parent_device); 680 class_device_put(parent_device);
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 8615b42b517a..fd8059920dbf 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -90,7 +90,7 @@ static struct kobj_type ktype_device = {
90}; 90};
91 91
92 92
93static int dev_hotplug_filter(struct kset *kset, struct kobject *kobj) 93static int dev_uevent_filter(struct kset *kset, struct kobject *kobj)
94{ 94{
95 struct kobj_type *ktype = get_ktype(kobj); 95 struct kobj_type *ktype = get_ktype(kobj);
96 96
@@ -102,14 +102,14 @@ static int dev_hotplug_filter(struct kset *kset, struct kobject *kobj)
102 return 0; 102 return 0;
103} 103}
104 104
105static const char *dev_hotplug_name(struct kset *kset, struct kobject *kobj) 105static const char *dev_uevent_name(struct kset *kset, struct kobject *kobj)
106{ 106{
107 struct device *dev = to_dev(kobj); 107 struct device *dev = to_dev(kobj);
108 108
109 return dev->bus->name; 109 return dev->bus->name;
110} 110}
111 111
112static int dev_hotplug(struct kset *kset, struct kobject *kobj, char **envp, 112static int dev_uevent(struct kset *kset, struct kobject *kobj, char **envp,
113 int num_envp, char *buffer, int buffer_size) 113 int num_envp, char *buffer, int buffer_size)
114{ 114{
115 struct device *dev = to_dev(kobj); 115 struct device *dev = to_dev(kobj);
@@ -119,15 +119,15 @@ static int dev_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
119 119
120 /* add bus name of physical device */ 120 /* add bus name of physical device */
121 if (dev->bus) 121 if (dev->bus)
122 add_hotplug_env_var(envp, num_envp, &i, 122 add_uevent_var(envp, num_envp, &i,
123 buffer, buffer_size, &length, 123 buffer, buffer_size, &length,
124 "PHYSDEVBUS=%s", dev->bus->name); 124 "PHYSDEVBUS=%s", dev->bus->name);
125 125
126 /* add driver name of physical device */ 126 /* add driver name of physical device */
127 if (dev->driver) 127 if (dev->driver)
128 add_hotplug_env_var(envp, num_envp, &i, 128 add_uevent_var(envp, num_envp, &i,
129 buffer, buffer_size, &length, 129 buffer, buffer_size, &length,
130 "PHYSDEVDRIVER=%s", dev->driver->name); 130 "PHYSDEVDRIVER=%s", dev->driver->name);
131 131
132 /* terminate, set to next free slot, shrink available space */ 132 /* terminate, set to next free slot, shrink available space */
133 envp[i] = NULL; 133 envp[i] = NULL;
@@ -136,11 +136,11 @@ static int dev_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
136 buffer = &buffer[length]; 136 buffer = &buffer[length];
137 buffer_size -= length; 137 buffer_size -= length;
138 138
139 if (dev->bus && dev->bus->hotplug) { 139 if (dev->bus && dev->bus->uevent) {
140 /* have the bus specific function add its stuff */ 140 /* have the bus specific function add its stuff */
141 retval = dev->bus->hotplug (dev, envp, num_envp, buffer, buffer_size); 141 retval = dev->bus->uevent(dev, envp, num_envp, buffer, buffer_size);
142 if (retval) { 142 if (retval) {
143 pr_debug ("%s - hotplug() returned %d\n", 143 pr_debug ("%s - uevent() returned %d\n",
144 __FUNCTION__, retval); 144 __FUNCTION__, retval);
145 } 145 }
146 } 146 }
@@ -148,16 +148,16 @@ static int dev_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
148 return retval; 148 return retval;
149} 149}
150 150
151static struct kset_hotplug_ops device_hotplug_ops = { 151static struct kset_uevent_ops device_uevent_ops = {
152 .filter = dev_hotplug_filter, 152 .filter = dev_uevent_filter,
153 .name = dev_hotplug_name, 153 .name = dev_uevent_name,
154 .hotplug = dev_hotplug, 154 .uevent = dev_uevent,
155}; 155};
156 156
157static ssize_t store_uevent(struct device *dev, struct device_attribute *attr, 157static ssize_t store_uevent(struct device *dev, struct device_attribute *attr,
158 const char *buf, size_t count) 158 const char *buf, size_t count)
159{ 159{
160 kobject_hotplug(&dev->kobj, KOBJ_ADD); 160 kobject_uevent(&dev->kobj, KOBJ_ADD);
161 return count; 161 return count;
162} 162}
163 163
@@ -165,7 +165,7 @@ static ssize_t store_uevent(struct device *dev, struct device_attribute *attr,
165 * device_subsys - structure to be registered with kobject core. 165 * device_subsys - structure to be registered with kobject core.
166 */ 166 */
167 167
168decl_subsys(devices, &ktype_device, &device_hotplug_ops); 168decl_subsys(devices, &ktype_device, &device_uevent_ops);
169 169
170 170
171/** 171/**
@@ -274,7 +274,7 @@ int device_add(struct device *dev)
274 dev->uevent_attr.store = store_uevent; 274 dev->uevent_attr.store = store_uevent;
275 device_create_file(dev, &dev->uevent_attr); 275 device_create_file(dev, &dev->uevent_attr);
276 276
277 kobject_hotplug(&dev->kobj, KOBJ_ADD); 277 kobject_uevent(&dev->kobj, KOBJ_ADD);
278 if ((error = device_pm_add(dev))) 278 if ((error = device_pm_add(dev)))
279 goto PMError; 279 goto PMError;
280 if ((error = bus_add_device(dev))) 280 if ((error = bus_add_device(dev)))
@@ -291,7 +291,7 @@ int device_add(struct device *dev)
291 BusError: 291 BusError:
292 device_pm_remove(dev); 292 device_pm_remove(dev);
293 PMError: 293 PMError:
294 kobject_hotplug(&dev->kobj, KOBJ_REMOVE); 294 kobject_uevent(&dev->kobj, KOBJ_REMOVE);
295 kobject_del(&dev->kobj); 295 kobject_del(&dev->kobj);
296 Error: 296 Error:
297 if (parent) 297 if (parent)
@@ -374,7 +374,7 @@ void device_del(struct device * dev)
374 platform_notify_remove(dev); 374 platform_notify_remove(dev);
375 bus_remove_device(dev); 375 bus_remove_device(dev);
376 device_pm_remove(dev); 376 device_pm_remove(dev);
377 kobject_hotplug(&dev->kobj, KOBJ_REMOVE); 377 kobject_uevent(&dev->kobj, KOBJ_REMOVE);
378 kobject_del(&dev->kobj); 378 kobject_del(&dev->kobj);
379 if (parent) 379 if (parent)
380 put_device(parent); 380 put_device(parent);
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index a95844790f7b..281d26784d25 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -41,14 +41,14 @@ static ssize_t store_online(struct sys_device *dev, const char *buf,
41 case '0': 41 case '0':
42 ret = cpu_down(cpu->sysdev.id); 42 ret = cpu_down(cpu->sysdev.id);
43 if (!ret) 43 if (!ret)
44 kobject_hotplug(&dev->kobj, KOBJ_OFFLINE); 44 kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
45 break; 45 break;
46 case '1': 46 case '1':
47 ret = smp_prepare_cpu(cpu->sysdev.id); 47 ret = smp_prepare_cpu(cpu->sysdev.id);
48 if (!ret) 48 if (!ret)
49 ret = cpu_up(cpu->sysdev.id); 49 ret = cpu_up(cpu->sysdev.id);
50 if (!ret) 50 if (!ret)
51 kobject_hotplug(&dev->kobj, KOBJ_ONLINE); 51 kobject_uevent(&dev->kobj, KOBJ_ONLINE);
52 break; 52 break;
53 default: 53 default:
54 ret = -EINVAL; 54 ret = -EINVAL;
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 59dacb6552c0..5b3d5e9ddcb6 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -85,17 +85,17 @@ firmware_timeout_store(struct class *class, const char *buf, size_t count)
85static CLASS_ATTR(timeout, 0644, firmware_timeout_show, firmware_timeout_store); 85static CLASS_ATTR(timeout, 0644, firmware_timeout_show, firmware_timeout_store);
86 86
87static void fw_class_dev_release(struct class_device *class_dev); 87static void fw_class_dev_release(struct class_device *class_dev);
88int firmware_class_hotplug(struct class_device *dev, char **envp, 88int firmware_class_uevent(struct class_device *dev, char **envp,
89 int num_envp, char *buffer, int buffer_size); 89 int num_envp, char *buffer, int buffer_size);
90 90
91static struct class firmware_class = { 91static struct class firmware_class = {
92 .name = "firmware", 92 .name = "firmware",
93 .hotplug = firmware_class_hotplug, 93 .uevent = firmware_class_uevent,
94 .release = fw_class_dev_release, 94 .release = fw_class_dev_release,
95}; 95};
96 96
97int 97int
98firmware_class_hotplug(struct class_device *class_dev, char **envp, 98firmware_class_uevent(struct class_device *class_dev, char **envp,
99 int num_envp, char *buffer, int buffer_size) 99 int num_envp, char *buffer, int buffer_size)
100{ 100{
101 struct firmware_priv *fw_priv = class_get_devdata(class_dev); 101 struct firmware_priv *fw_priv = class_get_devdata(class_dev);
@@ -104,13 +104,12 @@ firmware_class_hotplug(struct class_device *class_dev, char **envp,
104 if (!test_bit(FW_STATUS_READY, &fw_priv->status)) 104 if (!test_bit(FW_STATUS_READY, &fw_priv->status))
105 return -ENODEV; 105 return -ENODEV;
106 106
107 if (add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, &len, 107 if (add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len,
108 "FIRMWARE=%s", fw_priv->fw_id)) 108 "FIRMWARE=%s", fw_priv->fw_id))
109 return -ENOMEM; 109 return -ENOMEM;
110 if (add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, &len, 110 if (add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len,
111 "TIMEOUT=%i", loading_timeout)) 111 "TIMEOUT=%i", loading_timeout))
112 return -ENOMEM; 112 return -ENOMEM;
113
114 envp[i] = NULL; 113 envp[i] = NULL;
115 114
116 return 0; 115 return 0;
@@ -352,7 +351,7 @@ error_kfree:
352 351
353static int 352static int
354fw_setup_class_device(struct firmware *fw, struct class_device **class_dev_p, 353fw_setup_class_device(struct firmware *fw, struct class_device **class_dev_p,
355 const char *fw_name, struct device *device, int hotplug) 354 const char *fw_name, struct device *device, int uevent)
356{ 355{
357 struct class_device *class_dev; 356 struct class_device *class_dev;
358 struct firmware_priv *fw_priv; 357 struct firmware_priv *fw_priv;
@@ -384,7 +383,7 @@ fw_setup_class_device(struct firmware *fw, struct class_device **class_dev_p,
384 goto error_unreg; 383 goto error_unreg;
385 } 384 }
386 385
387 if (hotplug) 386 if (uevent)
388 set_bit(FW_STATUS_READY, &fw_priv->status); 387 set_bit(FW_STATUS_READY, &fw_priv->status);
389 else 388 else
390 set_bit(FW_STATUS_READY_NOHOTPLUG, &fw_priv->status); 389 set_bit(FW_STATUS_READY_NOHOTPLUG, &fw_priv->status);
@@ -399,7 +398,7 @@ out:
399 398
400static int 399static int
401_request_firmware(const struct firmware **firmware_p, const char *name, 400_request_firmware(const struct firmware **firmware_p, const char *name,
402 struct device *device, int hotplug) 401 struct device *device, int uevent)
403{ 402{
404 struct class_device *class_dev; 403 struct class_device *class_dev;
405 struct firmware_priv *fw_priv; 404 struct firmware_priv *fw_priv;
@@ -418,19 +417,19 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
418 } 417 }
419 418
420 retval = fw_setup_class_device(firmware, &class_dev, name, device, 419 retval = fw_setup_class_device(firmware, &class_dev, name, device,
421 hotplug); 420 uevent);
422 if (retval) 421 if (retval)
423 goto error_kfree_fw; 422 goto error_kfree_fw;
424 423
425 fw_priv = class_get_devdata(class_dev); 424 fw_priv = class_get_devdata(class_dev);
426 425
427 if (hotplug) { 426 if (uevent) {
428 if (loading_timeout > 0) { 427 if (loading_timeout > 0) {
429 fw_priv->timeout.expires = jiffies + loading_timeout * HZ; 428 fw_priv->timeout.expires = jiffies + loading_timeout * HZ;
430 add_timer(&fw_priv->timeout); 429 add_timer(&fw_priv->timeout);
431 } 430 }
432 431
433 kobject_hotplug(&class_dev->kobj, KOBJ_ADD); 432 kobject_uevent(&class_dev->kobj, KOBJ_ADD);
434 wait_for_completion(&fw_priv->completion); 433 wait_for_completion(&fw_priv->completion);
435 set_bit(FW_STATUS_DONE, &fw_priv->status); 434 set_bit(FW_STATUS_DONE, &fw_priv->status);
436 del_timer_sync(&fw_priv->timeout); 435 del_timer_sync(&fw_priv->timeout);
@@ -456,7 +455,7 @@ out:
456} 455}
457 456
458/** 457/**
459 * request_firmware: - request firmware to hotplug and wait for it 458 * request_firmware: - send firmware request and wait for it
460 * @firmware_p: pointer to firmware image 459 * @firmware_p: pointer to firmware image
461 * @name: name of firmware file 460 * @name: name of firmware file
462 * @device: device for which firmware is being loaded 461 * @device: device for which firmware is being loaded
@@ -466,7 +465,7 @@ out:
466 * 465 *
467 * Should be called from user context where sleeping is allowed. 466 * Should be called from user context where sleeping is allowed.
468 * 467 *
469 * @name will be used as $FIRMWARE in the hotplug environment and 468 * @name will be used as $FIRMWARE in the uevent environment and
470 * should be distinctive enough not to be confused with any other 469 * should be distinctive enough not to be confused with any other
471 * firmware image for this or any other device. 470 * firmware image for this or any other device.
472 **/ 471 **/
@@ -474,8 +473,8 @@ int
474request_firmware(const struct firmware **firmware_p, const char *name, 473request_firmware(const struct firmware **firmware_p, const char *name,
475 struct device *device) 474 struct device *device)
476{ 475{
477 int hotplug = 1; 476 int uevent = 1;
478 return _request_firmware(firmware_p, name, device, hotplug); 477 return _request_firmware(firmware_p, name, device, uevent);
479} 478}
480 479
481/** 480/**
@@ -518,7 +517,7 @@ struct firmware_work {
518 struct device *device; 517 struct device *device;
519 void *context; 518 void *context;
520 void (*cont)(const struct firmware *fw, void *context); 519 void (*cont)(const struct firmware *fw, void *context);
521 int hotplug; 520 int uevent;
522}; 521};
523 522
524static int 523static int
@@ -533,7 +532,7 @@ request_firmware_work_func(void *arg)
533 } 532 }
534 daemonize("%s/%s", "firmware", fw_work->name); 533 daemonize("%s/%s", "firmware", fw_work->name);
535 ret = _request_firmware(&fw, fw_work->name, fw_work->device, 534 ret = _request_firmware(&fw, fw_work->name, fw_work->device,
536 fw_work->hotplug); 535 fw_work->uevent);
537 if (ret < 0) 536 if (ret < 0)
538 fw_work->cont(NULL, fw_work->context); 537 fw_work->cont(NULL, fw_work->context);
539 else { 538 else {
@@ -548,7 +547,7 @@ request_firmware_work_func(void *arg)
548/** 547/**
549 * request_firmware_nowait: asynchronous version of request_firmware 548 * request_firmware_nowait: asynchronous version of request_firmware
550 * @module: module requesting the firmware 549 * @module: module requesting the firmware
551 * @hotplug: invokes hotplug event to copy the firmware image if this flag 550 * @uevent: sends uevent to copy the firmware image if this flag
552 * is non-zero else the firmware copy must be done manually. 551 * is non-zero else the firmware copy must be done manually.
553 * @name: name of firmware file 552 * @name: name of firmware file
554 * @device: device for which firmware is being loaded 553 * @device: device for which firmware is being loaded
@@ -562,7 +561,7 @@ request_firmware_work_func(void *arg)
562 **/ 561 **/
563int 562int
564request_firmware_nowait( 563request_firmware_nowait(
565 struct module *module, int hotplug, 564 struct module *module, int uevent,
566 const char *name, struct device *device, void *context, 565 const char *name, struct device *device, void *context,
567 void (*cont)(const struct firmware *fw, void *context)) 566 void (*cont)(const struct firmware *fw, void *context))
568{ 567{
@@ -583,7 +582,7 @@ request_firmware_nowait(
583 .device = device, 582 .device = device,
584 .context = context, 583 .context = context,
585 .cont = cont, 584 .cont = cont,
586 .hotplug = hotplug, 585 .uevent = uevent,
587 }; 586 };
588 587
589 ret = kernel_thread(request_firmware_work_func, fw_work, 588 ret = kernel_thread(request_firmware_work_func, fw_work,
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index bc3ca6a656b2..7e1d077874df 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -29,12 +29,12 @@ static struct sysdev_class memory_sysdev_class = {
29 set_kset_name(MEMORY_CLASS_NAME), 29 set_kset_name(MEMORY_CLASS_NAME),
30}; 30};
31 31
32static char *memory_hotplug_name(struct kset *kset, struct kobject *kobj) 32static const char *memory_uevent_name(struct kset *kset, struct kobject *kobj)
33{ 33{
34 return MEMORY_CLASS_NAME; 34 return MEMORY_CLASS_NAME;
35} 35}
36 36
37static int memory_hotplug(struct kset *kset, struct kobject *kobj, char **envp, 37static int memory_uevent(struct kset *kset, struct kobject *kobj, char **envp,
38 int num_envp, char *buffer, int buffer_size) 38 int num_envp, char *buffer, int buffer_size)
39{ 39{
40 int retval = 0; 40 int retval = 0;
@@ -42,9 +42,9 @@ static int memory_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
42 return retval; 42 return retval;
43} 43}
44 44
45static struct kset_hotplug_ops memory_hotplug_ops = { 45static struct kset_uevent_ops memory_uevent_ops = {
46 .name = memory_hotplug_name, 46 .name = memory_uevent_name,
47 .hotplug = memory_hotplug, 47 .uevent = memory_uevent,
48}; 48};
49 49
50static struct notifier_block *memory_chain; 50static struct notifier_block *memory_chain;
@@ -431,7 +431,7 @@ int __init memory_dev_init(void)
431 unsigned int i; 431 unsigned int i;
432 int ret; 432 int ret;
433 433
434 memory_sysdev_class.kset.hotplug_ops = &memory_hotplug_ops; 434 memory_sysdev_class.kset.uevent_ops = &memory_uevent_ops;
435 ret = sysdev_class_register(&memory_sysdev_class); 435 ret = sysdev_class_register(&memory_sysdev_class);
436 436
437 /* 437 /*