From: Dmitry Torokhov <dtor_core@ameritech.net>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@osdl.org>, Greg KH <gregkh@suse.de>,
Kay Sievers <kay.sievers@vrfy.org>,
Vojtech Pavlik <vojtech@suse.cz>, Hannes Reinecke <hare@suse.de>
Subject: [patch 02/28] I2O: remove i2o_device_class
Date: Thu, 15 Sep 2005 02:01:33 -0500 [thread overview]
Message-ID: <20050915070302.068231000.dtor_core@ameritech.net> (raw)
In-Reply-To: <20050915070131.813650000.dtor_core@ameritech.net>
[-- Attachment #1: i2o-remove-class.patch --]
[-- Type: text/plain, Size: 6820 bytes --]
I2O: cleanup - remove i2o_device_class
I2O devices reside on their own bus so there should be no reason
to also have i2c_device class that mirros i2o bus.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/message/i2o/core.h | 3 -
drivers/message/i2o/device.c | 71 +++++++------------------------------------
drivers/message/i2o/driver.c | 3 +
drivers/message/i2o/iop.c | 10 ------
include/linux/i2o.h | 2 -
5 files changed, 17 insertions(+), 72 deletions(-)
Index: work/drivers/message/i2o/device.c
===================================================================
--- work.orig/drivers/message/i2o/device.c
+++ work/drivers/message/i2o/device.c
@@ -138,17 +138,6 @@ static void i2o_device_release(struct de
kfree(i2o_dev);
}
-/**
- * i2o_device_class_release - I2O class device release function
- * @cd: I2O class device which is added to the I2O device class
- *
- * The function is just a stub - memory will be freed when
- * associated I2O device is released.
- */
-static void i2o_device_class_release(struct class_device *cd)
-{
- /* empty */
-}
/**
* i2o_device_class_show_class_id - Displays class id of I2O device
@@ -157,12 +146,13 @@ static void i2o_device_class_release(str
*
* Returns the number of bytes which are printed into the buffer.
*/
-static ssize_t i2o_device_class_show_class_id(struct class_device *cd,
- char *buf)
+static ssize_t i2o_device_show_class_id(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
{
- struct i2o_device *dev = to_i2o_device(cd->dev);
+ struct i2o_device *i2o_dev = to_i2o_device(dev);
- sprintf(buf, "0x%03x\n", dev->lct_data.class_id);
+ sprintf(buf, "0x%03x\n", i2o_dev->lct_data.class_id);
return strlen(buf) + 1;
}
@@ -173,27 +163,22 @@ static ssize_t i2o_device_class_show_cla
*
* Returns the number of bytes which are printed into the buffer.
*/
-static ssize_t i2o_device_class_show_tid(struct class_device *cd, char *buf)
+static ssize_t i2o_device_show_tid(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
{
- struct i2o_device *dev = to_i2o_device(cd->dev);
+ struct i2o_device *i2o_dev = to_i2o_device(dev);
- sprintf(buf, "0x%03x\n", dev->lct_data.tid);
+ sprintf(buf, "0x%03x\n", i2o_dev->lct_data.tid);
return strlen(buf) + 1;
}
-static struct class_device_attribute i2o_device_class_attrs[] = {
- __ATTR(class_id, S_IRUGO, i2o_device_class_show_class_id, NULL),
- __ATTR(tid, S_IRUGO, i2o_device_class_show_tid, NULL),
+struct device_attribute i2o_device_attrs[] = {
+ __ATTR(class_id, S_IRUGO, i2o_device_show_class_id, NULL),
+ __ATTR(tid, S_IRUGO, i2o_device_show_tid, NULL),
__ATTR_NULL
};
-/* I2O device class */
-static struct class i2o_device_class = {
- .name = "i2o_device",
- .release = i2o_device_class_release,
- .class_dev_attrs = i2o_device_class_attrs,
-};
-
/**
* i2o_device_alloc - Allocate a I2O device and initialize it
*
@@ -217,8 +202,6 @@ static struct i2o_device *i2o_device_all
dev->device.bus = &i2o_bus_type;
dev->device.release = &i2o_device_release;
- dev->classdev.class = &i2o_device_class;
- dev->classdev.dev = &dev->device;
return dev;
}
@@ -311,17 +294,12 @@ static struct i2o_device *i2o_device_add
snprintf(dev->device.bus_id, BUS_ID_SIZE, "%d:%03x", c->unit,
dev->lct_data.tid);
- snprintf(dev->classdev.class_id, BUS_ID_SIZE, "%d:%03x", c->unit,
- dev->lct_data.tid);
-
dev->device.parent = &c->device;
device_register(&dev->device);
list_add_tail(&dev->list, &c->devices);
- class_device_register(&dev->classdev);
-
i2o_setup_sysfs_links(dev);
i2o_driver_notify_device_add_all(dev);
@@ -343,7 +321,6 @@ void i2o_device_remove(struct i2o_device
{
i2o_driver_notify_device_remove_all(i2o_dev);
i2o_remove_sysfs_links(i2o_dev);
- class_device_unregister(&i2o_dev->classdev);
list_del(&i2o_dev->list);
device_unregister(&i2o_dev->device);
}
@@ -598,28 +575,6 @@ int i2o_parm_table_get(struct i2o_device
return size;
}
-/**
- * i2o_device_init - Initialize I2O devices
- *
- * Registers the I2O device class.
- *
- * Returns 0 on success or negative error code on failure.
- */
-int i2o_device_init(void)
-{
- return class_register(&i2o_device_class);
-}
-
-/**
- * i2o_device_exit - I2O devices exit function
- *
- * Unregisters the I2O device class.
- */
-void i2o_device_exit(void)
-{
- class_unregister(&i2o_device_class);
-}
-
EXPORT_SYMBOL(i2o_device_claim);
EXPORT_SYMBOL(i2o_device_claim_release);
EXPORT_SYMBOL(i2o_parm_field_get);
Index: work/drivers/message/i2o/driver.c
===================================================================
--- work.orig/drivers/message/i2o/driver.c
+++ work/drivers/message/i2o/driver.c
@@ -58,9 +58,12 @@ static int i2o_bus_match(struct device *
};
/* I2O bus type */
+extern struct device_attribute i2o_device_attrs[];
+
struct bus_type i2o_bus_type = {
.name = "i2o",
.match = i2o_bus_match,
+ .dev_attrs = i2o_device_attrs,
};
/**
Index: work/include/linux/i2o.h
===================================================================
--- work.orig/include/linux/i2o.h
+++ work/include/linux/i2o.h
@@ -66,8 +66,6 @@ struct i2o_device {
struct device device;
struct semaphore lock; /* device lock */
-
- struct class_device classdev; /* i2o device class */
};
/*
Index: work/drivers/message/i2o/core.h
===================================================================
--- work.orig/drivers/message/i2o/core.h
+++ work/drivers/message/i2o/core.h
@@ -36,9 +36,6 @@ extern void __exit i2o_pci_exit(void);
extern void i2o_device_remove(struct i2o_device *);
extern int i2o_device_parse_lct(struct i2o_controller *);
-extern int i2o_device_init(void);
-extern void i2o_device_exit(void);
-
/* IOP */
extern struct i2o_controller *i2o_iop_alloc(void);
extern void i2o_iop_free(struct i2o_controller *);
Index: work/drivers/message/i2o/iop.c
===================================================================
--- work.orig/drivers/message/i2o/iop.c
+++ work/drivers/message/i2o/iop.c
@@ -1246,13 +1246,9 @@ static int __init i2o_iop_init(void)
printk(KERN_INFO OSM_DESCRIPTION " v" OSM_VERSION "\n");
- rc = i2o_device_init();
- if (rc)
- goto exit;
-
if ((rc = class_register(&i2o_controller_class))) {
osm_err("can't register class i2o_controller\n");
- goto device_exit;
+ goto exit;
}
if ((rc = i2o_driver_init()))
@@ -1275,9 +1271,6 @@ static int __init i2o_iop_init(void)
class_exit:
class_unregister(&i2o_controller_class);
- device_exit:
- i2o_device_exit();
-
exit:
return rc;
}
@@ -1293,7 +1286,6 @@ static void __exit i2o_iop_exit(void)
i2o_exec_exit();
i2o_driver_exit();
class_unregister(&i2o_controller_class);
- i2o_device_exit();
};
module_init(i2o_iop_init);
next prev parent reply other threads:[~2005-09-15 7:09 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-15 7:01 [patch 00/28] RFC/RFT: Input - sysfs integration Dmitry Torokhov
2005-09-15 7:01 ` [patch 01/28] I2O: remove class interface Dmitry Torokhov
2005-09-27 0:03 ` Greg KH
2005-09-27 8:39 ` Markus Lidel
2005-09-15 7:01 ` Dmitry Torokhov [this message]
2005-09-27 0:28 ` [patch 02/28] I2O: remove i2o_device_class Greg KH
2005-09-15 7:01 ` [patch 03/28] Driver core: allow nesting classes Dmitry Torokhov
2005-09-15 7:01 ` [patch 04/28] Driver core: make parent class define subsystem Dmitry Torokhov
2005-09-15 7:01 ` [patch 05/28] Driver core: pass interface to class intreface methods Dmitry Torokhov
2005-09-15 7:01 ` [patch 06/28] Driver core: send hotplug event before adding class interfaces Dmitry Torokhov
2005-09-15 7:01 ` [patch 07/28] Input: kill devfs references Dmitry Torokhov
2005-09-15 7:01 ` [patch 08/28] Input: prepare to sysfs integration Dmitry Torokhov
2005-10-05 22:03 ` Greg KH
2005-10-05 22:17 ` Dmitry Torokhov
2005-10-05 22:55 ` Greg KH
2005-10-06 17:46 ` Dmitry Torokhov
2005-10-06 23:05 ` Vojtech Pavlik
2005-10-07 3:58 ` Dmitry Torokhov
2005-10-07 6:41 ` Al Viro
2005-10-07 6:49 ` Dmitry Torokhov
2005-09-15 7:01 ` [patch 09/28] Input: convert net/bluetooth to dynamic input_dev allocation Dmitry Torokhov
2005-09-15 7:54 ` Marcel Holtmann
2005-09-15 14:22 ` Dmitry Torokhov
2005-09-15 14:41 ` Marcel Holtmann
2005-09-15 19:07 ` Vojtech Pavlik
2005-09-15 19:22 ` Dmitry Torokhov
2005-09-15 19:31 ` Greg KH
2005-09-15 19:52 ` Dmitry Torokhov
2005-09-15 20:25 ` Vojtech Pavlik
2005-09-15 20:55 ` Dmitry Torokhov
2005-09-15 21:16 ` Vojtech Pavlik
2005-09-15 7:01 ` [patch 10/28] Input: convert drivers/macintosh " Dmitry Torokhov
2005-09-15 7:01 ` [patch 11/28] Input: convert konicawc " Dmitry Torokhov
2005-09-15 7:01 ` [patch 12/28] Input: convert onetouch " Dmitry Torokhov
2005-09-15 7:01 ` [patch 13/28] drivers/input/mouse: convert " Dmitry Torokhov
2005-09-15 7:01 ` [patch 14/28] drivers/input/keyboard: " Dmitry Torokhov
2005-09-15 7:01 ` [patch 15/28] drivers/input/touchscreen: " Dmitry Torokhov
2005-09-15 7:01 ` [patch 17/28] Input: convert ucb1x00-ts " Dmitry Torokhov
2005-09-15 7:01 ` [patch 18/28] Input: convert sound/ppc/beep " Dmitry Torokhov
2005-09-15 7:01 ` [patch 19/28] Input: convert sonypi " Dmitry Torokhov
2005-09-15 7:01 ` [patch 20/28] Input: convert driver/input/misc " Dmitry Torokhov
2005-09-15 7:01 ` [patch 22/28] drivers/media: convert " Dmitry Torokhov
2005-09-15 7:01 ` [patch 23/28] Input: show sysfs path in /proc/bus/input/devices Dmitry Torokhov
2005-09-15 7:01 ` [patch 24/28] Input: export input_dev data via sysfs attributes Dmitry Torokhov
2005-09-15 7:01 ` [patch 25/28] input core: implement class hierachy Dmitry Torokhov
2005-09-15 7:01 ` [patch 26/28] input core: remove custom-made hotplug handler Dmitry Torokhov
2005-09-15 7:01 ` [patch 27/28] Input: convert input handlers to class interfaces Dmitry Torokhov
2005-09-15 7:01 ` [patch 28/28] Input: convert to seq_file Dmitry Torokhov
2005-09-15 7:59 ` [patch 00/28] RFC/RFT: Input - sysfs integration Marcel Holtmann
2005-09-15 14:27 ` Dmitry Torokhov
[not found] ` <20050915070304.070090000.dtor_core@ameritech.net>
2005-09-16 3:53 ` [patch 16/28] drivers/usb/input: convert to dynamic input_dev allocation Andrew Morton
2005-09-16 3:59 ` Dmitry Torokhov
2005-09-16 4:18 ` Andrew Morton
2005-09-16 4:30 ` Dmitry Torokhov
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=20050915070302.068231000.dtor_core@ameritech.net \
--to=dtor_core@ameritech.net \
--cc=akpm@osdl.org \
--cc=gregkh@suse.de \
--cc=hare@suse.de \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vojtech@suse.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