mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nigel Cunningham <ncunningham@linuxmail.org>
To: Andrew Morton <akpm@digeo.com>,
	Patrick Mochel <mochel@digitalimplant.org>,
	Pavel Machek <pavel@ucw.cz>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] Suspend2 Merge: Driver model patches 2/2
Date: Thu, 16 Sep 2004 20:58:51 +1000	[thread overview]
Message-ID: <1095332331.3855.161.camel@laptop.cunninghams> (raw)

Hi.

This simple helper adds support for finding a class given its name. I
use this to locate the frame buffer drivers and move them to the
keep-alive tree while suspending other drivers.

Regards,

Nigel

diff -ruN linux-2.6.9-rc1/drivers/base/class.c software-suspend-linux-2.6.9-rc1-rev3/drivers/base/class.c
--- linux-2.6.9-rc1/drivers/base/class.c	2004-09-07 21:58:30.000000000 +1000
+++ software-suspend-linux-2.6.9-rc1-rev3/drivers/base/class.c	2004-09-09 19:36:24.000000000 +1000
@@ -460,6 +460,20 @@
 	kobject_put(&class_dev->kobj);
 }
 
+struct class * class_find(char * name)
+{
+	struct class * this_class;
+
+	if (!name)
+		return NULL;
+
+	list_for_each_entry(this_class, &class_subsys.kset.list, subsys.kset.kobj.entry) {
+		if (!(strcmp(this_class->name, name)))
+			return this_class;
+	}
+
+	return NULL;
+}
 
 int class_interface_register(struct class_interface *class_intf)
 {
@@ -542,3 +556,5 @@
 
 EXPORT_SYMBOL(class_interface_register);
 EXPORT_SYMBOL(class_interface_unregister);
+
+EXPORT_SYMBOL(class_find);
diff -ruN linux-2.6.9-rc1/include/linux/device.h software-suspend-linux-2.6.9-rc1-rev3/include/linux/device.h
--- linux-2.6.9-rc1/include/linux/device.h	2004-09-07 21:58:59.000000000 +1000
+++ software-suspend-linux-2.6.9-rc1-rev3/include/linux/device.h	2004-09-09 19:36:24.000000000 +1000
@@ -163,6 +163,7 @@
 
 extern struct class * class_get(struct class *);
 extern void class_put(struct class *);
+extern struct class * class_find(char * name);
 
 
 struct class_attribute {

-- 
Nigel Cunningham
Pastoral Worker
Christian Reformed Church of Tuggeranong
PO Box 1004, Tuggeranong, ACT 2901

Many today claim to be tolerant. True tolerance, however, can cope with others
being intolerant.


             reply	other threads:[~2004-09-16 10:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-16 10:58 Nigel Cunningham [this message]
2004-09-16 14:28 ` Greg KH
2004-09-16 22:18   ` Nigel Cunningham
2004-09-16 22:35     ` Greg KH
2004-09-16 22:49       ` Nigel Cunningham
2004-09-16 23:07         ` Greg KH
2004-09-16 23:19           ` Nigel Cunningham
2004-09-17 19:40             ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1095332331.3855.161.camel@laptop.cunninghams \
    --to=ncunningham@linuxmail.org \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@digitalimplant.org \
    --cc=pavel@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome