Re: the new autosuspension of mice

Oliver Neukum <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
Am Montag, 19. Februar 2007 15:55 schrieb Jiri Kosina:
> On Thu, 15 Feb 2007, Oliver Neukum wrote:
> 
> > To allow testing I am posting the full amalgated patch against 2.6.20.
> 
> Is this patch really against 2.6.20?
> 
> > +extern int sysfs_add_file_to_group(struct kobject *kobj,
> > +		const struct attribute *attr, const char *group);
> > +extern void sysfs_remove_file_from_group(struct kobject *kobj,
> > +		const struct attribute *attr, const char *group);
> 
> I don't know where do these functions come from, and I am not able to find 
> them in v2.6.20. The patch also doesn't define them.
> 
> (besides that, putting extern declarations in the middle of a C source 
> doesn't look beautiful).

Sorry,

they come from Alan's autopm changes.

	Regards
		Oliver

----
--- linux-2.6.20/fs/sysfs/file.c	2007-02-06 14:14:52.000000000 +0100
+++ linux-stern/fs/sysfs/file.c	2007-02-15 10:29:18.000000000 +0100
@@ -468,6 +468,30 @@
 
 
 /**
+ * sysfs_add_file_to_group - add an attribute file to a pre-existing group.
+ * @kobj: object we're acting for.
+ * @attr: attribute descriptor.
+ * @group: group name.
+ */
+int sysfs_add_file_to_group(struct kobject *kobj,
+		const struct attribute *attr, const char *group)
+{
+	struct dentry *dir;
+	int error;
+
+	dir = lookup_one_len(group, kobj->dentry, strlen(group));
+	if (IS_ERR(dir))
+		error = PTR_ERR(dir);
+	else {
+		error = sysfs_add_file(dir, attr, SYSFS_KOBJ_ATTR);
+		dput(dir);
+	}
+	return error;
+}
+EXPORT_SYMBOL_GPL(sysfs_add_file_to_group);
+
+
+/**
  * sysfs_update_file - update the modified timestamp on an object attribute.
  * @kobj: object we're acting for.
  * @attr: attribute descriptor.
@@ -552,6 +576,26 @@
 }
 
 
+/**
+ * sysfs_remove_file_from_group - remove an attribute file from a group.
+ * @kobj: object we're acting for.
+ * @attr: attribute descriptor.
+ * @group: group name.
+ */
+void sysfs_remove_file_from_group(struct kobject *kobj,
+		const struct attribute *attr, const char *group)
+{
+	struct dentry *dir;
+
+	dir = lookup_one_len(group, kobj->dentry, strlen(group));
+	if (!IS_ERR(dir)) {
+		sysfs_hash_and_remove(dir, attr->name);
+		dput(dir);
+	}
+}
+EXPORT_SYMBOL_GPL(sysfs_remove_file_from_group);
+
+
 EXPORT_SYMBOL_GPL(sysfs_create_file);
 EXPORT_SYMBOL_GPL(sysfs_remove_file);
 EXPORT_SYMBOL_GPL(sysfs_update_file);

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.