@@ -138,17 +138,6 @@ static void i2o_device_release(struct device *dev)
138138 kfree (i2o_dev );
139139}
140140
141- /**
142- * i2o_device_class_release - I2O class device release function
143- * @cd: I2O class device which is added to the I2O device class
144- *
145- * The function is just a stub - memory will be freed when
146- * associated I2O device is released.
147- */
148- static void i2o_device_class_release (struct class_device * cd )
149- {
150- /* empty */
151- }
152141
153142/**
154143 * i2o_device_class_show_class_id - Displays class id of I2O device
@@ -157,12 +146,13 @@ static void i2o_device_class_release(struct class_device *cd)
157146 *
158147 * Returns the number of bytes which are printed into the buffer.
159148 */
160- static ssize_t i2o_device_class_show_class_id (struct class_device * cd ,
161- char * buf )
149+ static ssize_t i2o_device_show_class_id (struct device * dev ,
150+ struct device_attribute * attr ,
151+ char * buf )
162152{
163- struct i2o_device * dev = to_i2o_device (cd -> dev );
153+ struct i2o_device * i2o_dev = to_i2o_device (dev );
164154
165- sprintf (buf , "0x%03x\n" , dev -> lct_data .class_id );
155+ sprintf (buf , "0x%03x\n" , i2o_dev -> lct_data .class_id );
166156 return strlen (buf ) + 1 ;
167157}
168158
@@ -173,27 +163,22 @@ static ssize_t i2o_device_class_show_class_id(struct class_device *cd,
173163 *
174164 * Returns the number of bytes which are printed into the buffer.
175165 */
176- static ssize_t i2o_device_class_show_tid (struct class_device * cd , char * buf )
166+ static ssize_t i2o_device_show_tid (struct device * dev ,
167+ struct device_attribute * attr ,
168+ char * buf )
177169{
178- struct i2o_device * dev = to_i2o_device (cd -> dev );
170+ struct i2o_device * i2o_dev = to_i2o_device (dev );
179171
180- sprintf (buf , "0x%03x\n" , dev -> lct_data .tid );
172+ sprintf (buf , "0x%03x\n" , i2o_dev -> lct_data .tid );
181173 return strlen (buf ) + 1 ;
182174}
183175
184- static struct class_device_attribute i2o_device_class_attrs [] = {
185- __ATTR (class_id , S_IRUGO , i2o_device_class_show_class_id , NULL ),
186- __ATTR (tid , S_IRUGO , i2o_device_class_show_tid , NULL ),
176+ struct device_attribute i2o_device_attrs [] = {
177+ __ATTR (class_id , S_IRUGO , i2o_device_show_class_id , NULL ),
178+ __ATTR (tid , S_IRUGO , i2o_device_show_tid , NULL ),
187179 __ATTR_NULL
188180};
189181
190- /* I2O device class */
191- static struct class i2o_device_class = {
192- .name = "i2o_device" ,
193- .release = i2o_device_class_release ,
194- .class_dev_attrs = i2o_device_class_attrs ,
195- };
196-
197182/**
198183 * i2o_device_alloc - Allocate a I2O device and initialize it
199184 *
@@ -217,8 +202,6 @@ static struct i2o_device *i2o_device_alloc(void)
217202
218203 dev -> device .bus = & i2o_bus_type ;
219204 dev -> device .release = & i2o_device_release ;
220- dev -> classdev .class = & i2o_device_class ;
221- dev -> classdev .dev = & dev -> device ;
222205
223206 return dev ;
224207}
@@ -311,17 +294,12 @@ static struct i2o_device *i2o_device_add(struct i2o_controller *c,
311294 snprintf (dev -> device .bus_id , BUS_ID_SIZE , "%d:%03x" , c -> unit ,
312295 dev -> lct_data .tid );
313296
314- snprintf (dev -> classdev .class_id , BUS_ID_SIZE , "%d:%03x" , c -> unit ,
315- dev -> lct_data .tid );
316-
317297 dev -> device .parent = & c -> device ;
318298
319299 device_register (& dev -> device );
320300
321301 list_add_tail (& dev -> list , & c -> devices );
322302
323- class_device_register (& dev -> classdev );
324-
325303 i2o_setup_sysfs_links (dev );
326304
327305 i2o_driver_notify_device_add_all (dev );
@@ -343,7 +321,6 @@ void i2o_device_remove(struct i2o_device *i2o_dev)
343321{
344322 i2o_driver_notify_device_remove_all (i2o_dev );
345323 i2o_remove_sysfs_links (i2o_dev );
346- class_device_unregister (& i2o_dev -> classdev );
347324 list_del (& i2o_dev -> list );
348325 device_unregister (& i2o_dev -> device );
349326}
@@ -598,28 +575,6 @@ int i2o_parm_table_get(struct i2o_device *dev, int oper, int group,
598575 return size ;
599576}
600577
601- /**
602- * i2o_device_init - Initialize I2O devices
603- *
604- * Registers the I2O device class.
605- *
606- * Returns 0 on success or negative error code on failure.
607- */
608- int i2o_device_init (void )
609- {
610- return class_register (& i2o_device_class );
611- }
612-
613- /**
614- * i2o_device_exit - I2O devices exit function
615- *
616- * Unregisters the I2O device class.
617- */
618- void i2o_device_exit (void )
619- {
620- class_unregister (& i2o_device_class );
621- }
622-
623578EXPORT_SYMBOL (i2o_device_claim );
624579EXPORT_SYMBOL (i2o_device_claim_release );
625580EXPORT_SYMBOL (i2o_parm_field_get );
0 commit comments