/**
 * dev_set_name - set a device name
 * @dev: device
 * @fmt: format string for the device's name
 */
int dev_set_name(struct device *dev, const char *fmt, ...)
{
	va_list vargs;
	int err;

	va_start(vargs, fmt);
	err = kobject_set_name_vargs(&dev->kobj, fmt, vargs);
	va_end(vargs);
	return err;
}
Beispiel #2
0
int
kobject_set_name(struct kobject *kobj, const char *fmt, ...)
{
	va_list args;
	int error;

	va_start(args, fmt);
	error = kobject_set_name_vargs(kobj, fmt, args);
	va_end(args);

	return (error);
}
Beispiel #3
0
int kobject_init_and_add(struct kobject *kobj, struct kobj_type *ktype,
		         struct kobject *parent, const char *fmt, ...)
{
	va_list args;

	va_start(args, fmt);
	kobject_set_name_vargs(kobj, fmt, args);
	va_end(args);
	kobj->parent = parent;
	kobj->ktype = ktype;
	return kobject_register(kobj);
}
Beispiel #4
0
int
kobject_add(struct kobject *kobj, struct kobject *parent, const char *fmt, ...)
{
	va_list args;
	int error;

	va_start(args, fmt);
	error = kobject_set_name_vargs(kobj, fmt, args);
	va_end(args);
	if (error)
		return (error);

	return kobject_add_complete(kobj, parent);
}