Skip to content

Commit efefc6e

Browse files
author
Linus Torvalds
committed
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (75 commits) PM: merge device power-management source files sysfs: add copyrights kobject: update the copyrights kset: add some kerneldoc to help describe what these strange things are Driver core: rename ktype_edd and ktype_efivar Driver core: rename ktype_driver Driver core: rename ktype_device Driver core: rename ktype_class driver core: remove subsystem_init() sysfs: move sysfs file poll implementation to sysfs_open_dirent sysfs: implement sysfs_open_dirent sysfs: move sysfs_dirent->s_children into sysfs_dirent->s_dir sysfs: make sysfs_root a regular directory dirent sysfs: open code sysfs_attach_dentry() sysfs: make s_elem an anonymous union sysfs: make bin attr open get active reference of parent too sysfs: kill unnecessary NULL pointer check in sysfs_release() sysfs: kill unnecessary sysfs_get() in open paths sysfs: reposition sysfs_dirent->s_mode. sysfs: kill sysfs_update_file() ...
2 parents 117494a + cd59abf commit efefc6e

114 files changed

Lines changed: 1777 additions & 2493 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/ja_JP/HOWTO‎

Lines changed: 45 additions & 39 deletions
Large diffs are not rendered by default.

‎Documentation/kernel-parameters.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,10 @@ and is between 256 and 4096 characters. It is defined in the file
14371437
pt. [PARIDE]
14381438
See Documentation/paride.txt.
14391439

1440+
pty.legacy_count=
1441+
[KNL] Number of legacy pty's. Overwrites compiled-in
1442+
default number.
1443+
14401444
quiet [KNL] Disable most log messages
14411445

14421446
r128= [HW,DRM]

‎Documentation/kobject.txt‎

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ embedded in larger data structures and replace fields they duplicate.
5454

5555
struct kobject {
5656
const char * k_name;
57-
char name[KOBJ_NAME_LEN];
5857
struct kref kref;
5958
struct list_head entry;
6059
struct kobject * parent;
@@ -223,41 +222,24 @@ decl_subsys(devices, &ktype_device, &device_uevent_ops);
223222
is equivalent to doing:
224223

225224
struct kset devices_subsys = {
226-
.kobj = {
227-
.name = "devices",
228-
},
229225
.ktype = &ktype_devices,
230226
.uevent_ops = &device_uevent_ops,
231227
};
232-
228+
kobject_set_name(&devices_subsys, name);
233229

234230
The objects that are registered with a subsystem that use the
235231
subsystem's default list must have their kset ptr set properly. These
236232
objects may have embedded kobjects or ksets. The
237-
following helpers make setting the kset easier:
233+
following helper makes setting the kset easier:
238234

239235

240236
kobj_set_kset_s(obj,subsys)
241237

242238
- Assumes that obj->kobj exists, and is a struct kobject.
243239
- Sets the kset of that kobject to the kset <subsys>.
244240

245-
246-
kset_set_kset_s(obj,subsys)
247-
248-
- Assumes that obj->kset exists, and is a struct kset.
249-
- Sets the kset of the embedded kobject to the kset <subsys>.
250-
251-
subsys_set_kset(obj,subsys)
252-
253-
- Assumes obj->subsys exists, and is a struct subsystem.
254-
- Sets obj->subsys.kset.kobj.kset to the subsystem's embedded kset.
255-
256-
void subsystem_init(struct kset *s);
257241
int subsystem_register(struct kset *s);
258242
void subsystem_unregister(struct kset *s);
259-
struct kset *subsys_get(struct kset *s);
260-
void kset_put(struct kset *s);
261243

262244
These are just wrappers around the respective kset_* functions.
263245

‎arch/ia64/sn/kernel/tiocx.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ static int tiocx_match(struct device *dev, struct device_driver *drv)
6666

6767
}
6868

69-
static int tiocx_uevent(struct device *dev, char **envp, int num_envp,
70-
char *buffer, int buffer_size)
69+
static int tiocx_uevent(struct device *dev, struct kobj_uevent_env *env)
7170
{
7271
return -ENODEV;
7372
}

‎arch/powerpc/kernel/of_device.c‎

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -57,26 +57,21 @@ ssize_t of_device_get_modalias(struct of_device *ofdev,
5757
return tsize;
5858
}
5959

60-
int of_device_uevent(struct device *dev,
61-
char **envp, int num_envp, char *buffer, int buffer_size)
60+
int of_device_uevent(struct device *dev, struct kobj_uevent_env *env)
6261
{
6362
struct of_device *ofdev;
6463
const char *compat;
65-
int i = 0, length = 0, seen = 0, cplen, sl;
64+
int seen = 0, cplen, sl;
6665

6766
if (!dev)
6867
return -ENODEV;
6968

7069
ofdev = to_of_device(dev);
7170

72-
if (add_uevent_var(envp, num_envp, &i,
73-
buffer, buffer_size, &length,
74-
"OF_NAME=%s", ofdev->node->name))
71+
if (add_uevent_var(env, "OF_NAME=%s", ofdev->node->name))
7572
return -ENOMEM;
7673

77-
if (add_uevent_var(envp, num_envp, &i,
78-
buffer, buffer_size, &length,
79-
"OF_TYPE=%s", ofdev->node->type))
74+
if (add_uevent_var(env, "OF_TYPE=%s", ofdev->node->type))
8075
return -ENOMEM;
8176

8277
/* Since the compatible field can contain pretty much anything
@@ -85,9 +80,7 @@ int of_device_uevent(struct device *dev,
8580

8681
compat = of_get_property(ofdev->node, "compatible", &cplen);
8782
while (compat && *compat && cplen > 0) {
88-
if (add_uevent_var(envp, num_envp, &i,
89-
buffer, buffer_size, &length,
90-
"OF_COMPATIBLE_%d=%s", seen, compat))
83+
if (add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat))
9184
return -ENOMEM;
9285

9386
sl = strlen (compat) + 1;
@@ -96,25 +89,17 @@ int of_device_uevent(struct device *dev,
9689
seen++;
9790
}
9891

99-
if (add_uevent_var(envp, num_envp, &i,
100-
buffer, buffer_size, &length,
101-
"OF_COMPATIBLE_N=%d", seen))
92+
if (add_uevent_var(env, "OF_COMPATIBLE_N=%d", seen))
10293
return -ENOMEM;
10394

10495
/* modalias is trickier, we add it in 2 steps */
105-
if (add_uevent_var(envp, num_envp, &i,
106-
buffer, buffer_size, &length,
107-
"MODALIAS="))
96+
if (add_uevent_var(env, "MODALIAS="))
10897
return -ENOMEM;
109-
110-
sl = of_device_get_modalias(ofdev, &buffer[length-1],
111-
buffer_size-length);
112-
if (sl >= (buffer_size-length))
98+
sl = of_device_get_modalias(ofdev, &env->buf[env->buflen-1],
99+
sizeof(env->buf) - env->buflen);
100+
if (sl >= (sizeof(env->buf) - env->buflen))
113101
return -ENOMEM;
114-
115-
length += sl;
116-
117-
envp[i] = NULL;
102+
env->buflen += sl;
118103

119104
return 0;
120105
}

‎arch/powerpc/kernel/vio.c‎

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -317,30 +317,20 @@ static int vio_bus_match(struct device *dev, struct device_driver *drv)
317317
return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL);
318318
}
319319

320-
static int vio_hotplug(struct device *dev, char **envp, int num_envp,
321-
char *buffer, int buffer_size)
320+
static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env)
322321
{
323322
const struct vio_dev *vio_dev = to_vio_dev(dev);
324323
struct device_node *dn;
325324
const char *cp;
326-
int length;
327-
328-
if (!num_envp)
329-
return -ENOMEM;
330325

331326
dn = dev->archdata.of_node;
332327
if (!dn)
333328
return -ENODEV;
334-
cp = of_get_property(dn, "compatible", &length);
329+
cp = of_get_property(dn, "compatible", NULL);
335330
if (!cp)
336331
return -ENODEV;
337332

338-
envp[0] = buffer;
339-
length = scnprintf(buffer, buffer_size, "MODALIAS=vio:T%sS%s",
340-
vio_dev->type, cp);
341-
if ((buffer_size - length) <= 0)
342-
return -ENOMEM;
343-
envp[1] = NULL;
333+
add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type, cp);
344334
return 0;
345335
}
346336

‎arch/powerpc/platforms/ps3/system-bus.c‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -437,18 +437,13 @@ static void ps3_system_bus_shutdown(struct device *_dev)
437437
dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
438438
}
439439

440-
static int ps3_system_bus_uevent(struct device *_dev, char **envp,
441-
int num_envp, char *buffer, int buffer_size)
440+
static int ps3_system_bus_uevent(struct device *_dev, struct kobj_uevent_env *env)
442441
{
443442
struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
444443
int i = 0, length = 0;
445444

446-
if (add_uevent_var(envp, num_envp, &i, buffer, buffer_size,
447-
&length, "MODALIAS=ps3:%d",
448-
dev->match_id))
445+
if (add_uevent_var(env, "MODALIAS=ps3:%d", dev->match_id))
449446
return -ENOMEM;
450-
451-
envp[i] = NULL;
452447
return 0;
453448
}
454449

‎block/bsg.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,10 +1010,7 @@ int bsg_register_queue(struct request_queue *q, struct device *gdev,
10101010
}
10111011
EXPORT_SYMBOL_GPL(bsg_register_queue);
10121012

1013-
static struct cdev bsg_cdev = {
1014-
.kobj = {.name = "bsg", },
1015-
.owner = THIS_MODULE,
1016-
};
1013+
static struct cdev bsg_cdev;
10171014

10181015
static int __init bsg_init(void)
10191016
{

‎block/elevator.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static elevator_t *elevator_alloc(struct request_queue *q,
186186
eq->ops = &e->ops;
187187
eq->elevator_type = e;
188188
kobject_init(&eq->kobj);
189-
snprintf(eq->kobj.name, KOBJ_NAME_LEN, "%s", "iosched");
189+
kobject_set_name(&eq->kobj, "%s", "iosched");
190190
eq->kobj.ktype = &elv_ktype;
191191
mutex_init(&eq->sysfs_lock);
192192

‎block/genhd.c‎

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -540,61 +540,42 @@ static int block_uevent_filter(struct kset *kset, struct kobject *kobj)
540540
return ((ktype == &ktype_block) || (ktype == &ktype_part));
541541
}
542542

543-
static int block_uevent(struct kset *kset, struct kobject *kobj, char **envp,
544-
int num_envp, char *buffer, int buffer_size)
543+
static int block_uevent(struct kset *kset, struct kobject *kobj,
544+
struct kobj_uevent_env *env)
545545
{
546546
struct kobj_type *ktype = get_ktype(kobj);
547547
struct device *physdev;
548548
struct gendisk *disk;
549549
struct hd_struct *part;
550-
int length = 0;
551-
int i = 0;
552550

553551
if (ktype == &ktype_block) {
554552
disk = container_of(kobj, struct gendisk, kobj);
555-
add_uevent_var(envp, num_envp, &i, buffer, buffer_size,
556-
&length, "MINOR=%u", disk->first_minor);
553+
add_uevent_var(env, "MINOR=%u", disk->first_minor);
557554
} else if (ktype == &ktype_part) {
558555
disk = container_of(kobj->parent, struct gendisk, kobj);
559556
part = container_of(kobj, struct hd_struct, kobj);
560-
add_uevent_var(envp, num_envp, &i, buffer, buffer_size,
561-
&length, "MINOR=%u",
557+
add_uevent_var(env, "MINOR=%u",
562558
disk->first_minor + part->partno);
563559
} else
564560
return 0;
565561

566-
add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length,
567-
"MAJOR=%u", disk->major);
562+
add_uevent_var(env, "MAJOR=%u", disk->major);
568563

569564
/* add physical device, backing this device */
570565
physdev = disk->driverfs_dev;
571566
if (physdev) {
572567
char *path = kobject_get_path(&physdev->kobj, GFP_KERNEL);
573568

574-
add_uevent_var(envp, num_envp, &i, buffer, buffer_size,
575-
&length, "PHYSDEVPATH=%s", path);
569+
add_uevent_var(env, "PHYSDEVPATH=%s", path);
576570
kfree(path);
577571

578572
if (physdev->bus)
579-
add_uevent_var(envp, num_envp, &i,
580-
buffer, buffer_size, &length,
581-
"PHYSDEVBUS=%s",
582-
physdev->bus->name);
573+
add_uevent_var(env, "PHYSDEVBUS=%s", physdev->bus->name);
583574

584575
if (physdev->driver)
585-
add_uevent_var(envp, num_envp, &i,
586-
buffer, buffer_size, &length,
587-
"PHYSDEVDRIVER=%s",
588-
physdev->driver->name);
576+
add_uevent_var(env, physdev->driver->name);
589577
}
590578

591-
/* terminate, set to next free slot, shrink available space */
592-
envp[i] = NULL;
593-
envp = &envp[i];
594-
num_envp -= i;
595-
buffer = &buffer[length];
596-
buffer_size -= length;
597-
598579
return 0;
599580
}
600581

0 commit comments

Comments
 (0)