aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-20 19:00:33 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-20 19:00:33 -0400
commit1d345dac1f30af1cd9f3a1faa12f9f18f17f236e (patch)
tree42a7deda7589edf704fe60dc262046755bd3f6a8 /drivers/scsi
parentfb395884576684ebb54b19b1054f4caed589d5f0 (diff)
parent87c8a4433b608261a9becdb0ce2d2f2ed4b71d05 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/53c700.c2
-rw-r--r--drivers/scsi/arm/eesox.c4
-rw-r--r--drivers/scsi/arm/powertec.c4
-rw-r--r--drivers/scsi/ipr.c2
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.c4
-rw-r--r--drivers/scsi/osst.c10
-rw-r--r--drivers/scsi/scsi_sysfs.c42
-rw-r--r--drivers/scsi/scsi_transport_spi.c16
-rw-r--r--drivers/scsi/sg.c14
-rw-r--r--drivers/scsi/st.c28
10 files changed, 68 insertions, 58 deletions
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index d151af9a6f15..a7620fc368e7 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -2125,7 +2125,7 @@ static int NCR_700_change_queue_type(struct scsi_device *SDp, int tag_type)
2125} 2125}
2126 2126
2127static ssize_t 2127static ssize_t
2128NCR_700_show_active_tags(struct device *dev, char *buf) 2128NCR_700_show_active_tags(struct device *dev, struct device_attribute *attr, char *buf)
2129{ 2129{
2130 struct scsi_device *SDp = to_scsi_device(dev); 2130 struct scsi_device *SDp = to_scsi_device(dev);
2131 2131
diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c
index 78b7e543471b..ce711f166cfb 100644
--- a/drivers/scsi/arm/eesox.c
+++ b/drivers/scsi/arm/eesox.c
@@ -466,7 +466,7 @@ int eesoxscsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_
466 return pos; 466 return pos;
467} 467}
468 468
469static ssize_t eesoxscsi_show_term(struct device *dev, char *buf) 469static ssize_t eesoxscsi_show_term(struct device *dev, struct device_attribute *attr, char *buf)
470{ 470{
471 struct expansion_card *ec = ECARD_DEV(dev); 471 struct expansion_card *ec = ECARD_DEV(dev);
472 struct Scsi_Host *host = ecard_get_drvdata(ec); 472 struct Scsi_Host *host = ecard_get_drvdata(ec);
@@ -475,7 +475,7 @@ static ssize_t eesoxscsi_show_term(struct device *dev, char *buf)
475 return sprintf(buf, "%d\n", info->control & EESOX_TERM_ENABLE ? 1 : 0); 475 return sprintf(buf, "%d\n", info->control & EESOX_TERM_ENABLE ? 1 : 0);
476} 476}
477 477
478static ssize_t eesoxscsi_store_term(struct device *dev, const char *buf, size_t len) 478static ssize_t eesoxscsi_store_term(struct device *dev, struct device_attribute *attr, const char *buf, size_t len)
479{ 479{
480 struct expansion_card *ec = ECARD_DEV(dev); 480 struct expansion_card *ec = ECARD_DEV(dev);
481 struct Scsi_Host *host = ecard_get_drvdata(ec); 481 struct Scsi_Host *host = ecard_get_drvdata(ec);
diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c
index 54f23be6460f..abda216113f1 100644
--- a/drivers/scsi/arm/powertec.c
+++ b/drivers/scsi/arm/powertec.c
@@ -269,7 +269,7 @@ int powertecscsi_proc_info(struct Scsi_Host *host, char *buffer, char **start, o
269 return pos; 269 return pos;
270} 270}
271 271
272static ssize_t powertecscsi_show_term(struct device *dev, char *buf) 272static ssize_t powertecscsi_show_term(struct device *dev, struct device_attribute *attr, char *buf)
273{ 273{
274 struct expansion_card *ec = ECARD_DEV(dev); 274 struct expansion_card *ec = ECARD_DEV(dev);
275 struct Scsi_Host *host = ecard_get_drvdata(ec); 275 struct Scsi_Host *host = ecard_get_drvdata(ec);
@@ -279,7 +279,7 @@ static ssize_t powertecscsi_show_term(struct device *dev, char *buf)
279} 279}
280 280
281static ssize_t 281static ssize_t
282powertecscsi_store_term(struct device *dev, const char *buf, size_t len) 282powertecscsi_store_term(struct device *dev, struct device_attribute *attr, const char *buf, size_t len)
283{ 283{
284 struct expansion_card *ec = ECARD_DEV(dev); 284 struct expansion_card *ec = ECARD_DEV(dev);
285 struct Scsi_Host *host = ecard_get_drvdata(ec); 285 struct Scsi_Host *host = ecard_get_drvdata(ec);
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 17b106b79f72..80d022625c82 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -2716,7 +2716,7 @@ static int ipr_change_queue_type(struct scsi_device *sdev, int tag_type)
2716 * Return value: 2716 * Return value:
2717 * number of bytes printed to buffer 2717 * number of bytes printed to buffer
2718 **/ 2718 **/
2719static ssize_t ipr_show_adapter_handle(struct device *dev, char *buf) 2719static ssize_t ipr_show_adapter_handle(struct device *dev, struct device_attribute *attr, char *buf)
2720{ 2720{
2721 struct scsi_device *sdev = to_scsi_device(dev); 2721 struct scsi_device *sdev = to_scsi_device(dev);
2722 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)sdev->host->hostdata; 2722 struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)sdev->host->hostdata;
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index 057ed45b54b2..cbe430246276 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -124,7 +124,7 @@ static irqreturn_t megaraid_isr(int, void *, struct pt_regs *);
124static void megaraid_mbox_dpc(unsigned long); 124static void megaraid_mbox_dpc(unsigned long);
125 125
126static ssize_t megaraid_sysfs_show_app_hndl(struct class_device *, char *); 126static ssize_t megaraid_sysfs_show_app_hndl(struct class_device *, char *);
127static ssize_t megaraid_sysfs_show_ldnum(struct device *, char *); 127static ssize_t megaraid_sysfs_show_ldnum(struct device *, struct device_attribute *attr, char *);
128 128
129static int megaraid_cmm_register(adapter_t *); 129static int megaraid_cmm_register(adapter_t *);
130static int megaraid_cmm_unregister(adapter_t *); 130static int megaraid_cmm_unregister(adapter_t *);
@@ -4145,7 +4145,7 @@ megaraid_sysfs_show_app_hndl(struct class_device *cdev, char *buf)
4145 * @param buf : buffer to send data to 4145 * @param buf : buffer to send data to
4146 */ 4146 */
4147static ssize_t 4147static ssize_t
4148megaraid_sysfs_show_ldnum(struct device *dev, char *buf) 4148megaraid_sysfs_show_ldnum(struct device *dev, struct device_attribute *attr, char *buf)
4149{ 4149{
4150 struct scsi_device *sdev = to_scsi_device(dev); 4150 struct scsi_device *sdev = to_scsi_device(dev);
4151 adapter_t *adapter = (adapter_t *)SCSIHOST2ADAP(sdev->host); 4151 adapter_t *adapter = (adapter_t *)SCSIHOST2ADAP(sdev->host);
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index c585c7bef247..89a4a0615c22 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -5608,13 +5608,13 @@ static ssize_t osst_filemark_cnt_show(struct class_device *class_dev, char *buf)
5608 5608
5609CLASS_DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL); 5609CLASS_DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL);
5610 5610
5611static struct class_simple * osst_sysfs_class; 5611static struct class *osst_sysfs_class;
5612 5612
5613static int osst_sysfs_valid = 0; 5613static int osst_sysfs_valid = 0;
5614 5614
5615static void osst_sysfs_init(void) 5615static void osst_sysfs_init(void)
5616{ 5616{
5617 osst_sysfs_class = class_simple_create(THIS_MODULE, "onstream_tape"); 5617 osst_sysfs_class = class_create(THIS_MODULE, "onstream_tape");
5618 if ( IS_ERR(osst_sysfs_class) ) 5618 if ( IS_ERR(osst_sysfs_class) )
5619 printk(KERN_WARNING "osst :W: Unable to register sysfs class\n"); 5619 printk(KERN_WARNING "osst :W: Unable to register sysfs class\n");
5620 else 5620 else
@@ -5627,7 +5627,7 @@ static void osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape *
5627 5627
5628 if (!osst_sysfs_valid) return; 5628 if (!osst_sysfs_valid) return;
5629 5629
5630 osst_class_member = class_simple_device_add(osst_sysfs_class, dev, device, "%s", name); 5630 osst_class_member = class_device_create(osst_sysfs_class, dev, device, "%s", name);
5631 if (IS_ERR(osst_class_member)) { 5631 if (IS_ERR(osst_class_member)) {
5632 printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name); 5632 printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name);
5633 return; 5633 return;
@@ -5645,13 +5645,13 @@ static void osst_sysfs_destroy(dev_t dev)
5645{ 5645{
5646 if (!osst_sysfs_valid) return; 5646 if (!osst_sysfs_valid) return;
5647 5647
5648 class_simple_device_remove(dev); 5648 class_device_destroy(osst_sysfs_class, dev);
5649} 5649}
5650 5650
5651static void osst_sysfs_cleanup(void) 5651static void osst_sysfs_cleanup(void)
5652{ 5652{
5653 if (osst_sysfs_valid) { 5653 if (osst_sysfs_valid) {
5654 class_simple_destroy(osst_sysfs_class); 5654 class_destroy(osst_sysfs_class);
5655 osst_sysfs_valid = 0; 5655 osst_sysfs_valid = 0;
5656 } 5656 }
5657} 5657}
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index e75ee4671ee3..93b41100a6d8 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -230,7 +230,7 @@ void scsi_sysfs_unregister(void)
230 */ 230 */
231#define sdev_show_function(field, format_string) \ 231#define sdev_show_function(field, format_string) \
232static ssize_t \ 232static ssize_t \
233sdev_show_##field (struct device *dev, char *buf) \ 233sdev_show_##field (struct device *dev, struct device_attribute *attr, char *buf) \
234{ \ 234{ \
235 struct scsi_device *sdev; \ 235 struct scsi_device *sdev; \
236 sdev = to_scsi_device(dev); \ 236 sdev = to_scsi_device(dev); \
@@ -254,7 +254,7 @@ static DEVICE_ATTR(field, S_IRUGO, sdev_show_##field, NULL);
254 sdev_show_function(field, format_string) \ 254 sdev_show_function(field, format_string) \
255 \ 255 \
256static ssize_t \ 256static ssize_t \
257sdev_store_##field (struct device *dev, const char *buf, size_t count) \ 257sdev_store_##field (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
258{ \ 258{ \
259 struct scsi_device *sdev; \ 259 struct scsi_device *sdev; \
260 sdev = to_scsi_device(dev); \ 260 sdev = to_scsi_device(dev); \
@@ -274,7 +274,7 @@ static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, sdev_show_##field, sdev_store_##fie
274 sdev_show_function(field, "%d\n") \ 274 sdev_show_function(field, "%d\n") \
275 \ 275 \
276static ssize_t \ 276static ssize_t \
277sdev_store_##field (struct device *dev, const char *buf, size_t count) \ 277sdev_store_##field (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \
278{ \ 278{ \
279 int ret; \ 279 int ret; \
280 struct scsi_device *sdev; \ 280 struct scsi_device *sdev; \
@@ -317,7 +317,7 @@ sdev_rd_attr (model, "%.16s\n");
317sdev_rd_attr (rev, "%.4s\n"); 317sdev_rd_attr (rev, "%.4s\n");
318 318
319static ssize_t 319static ssize_t
320sdev_show_timeout (struct device *dev, char *buf) 320sdev_show_timeout (struct device *dev, struct device_attribute *attr, char *buf)
321{ 321{
322 struct scsi_device *sdev; 322 struct scsi_device *sdev;
323 sdev = to_scsi_device(dev); 323 sdev = to_scsi_device(dev);
@@ -325,7 +325,7 @@ sdev_show_timeout (struct device *dev, char *buf)
325} 325}
326 326
327static ssize_t 327static ssize_t
328sdev_store_timeout (struct device *dev, const char *buf, size_t count) 328sdev_store_timeout (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
329{ 329{
330 struct scsi_device *sdev; 330 struct scsi_device *sdev;
331 int timeout; 331 int timeout;
@@ -337,14 +337,14 @@ sdev_store_timeout (struct device *dev, const char *buf, size_t count)
337static DEVICE_ATTR(timeout, S_IRUGO | S_IWUSR, sdev_show_timeout, sdev_store_timeout); 337static DEVICE_ATTR(timeout, S_IRUGO | S_IWUSR, sdev_show_timeout, sdev_store_timeout);
338 338
339static ssize_t 339static ssize_t
340store_rescan_field (struct device *dev, const char *buf, size_t count) 340store_rescan_field (struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
341{ 341{
342 scsi_rescan_device(dev); 342 scsi_rescan_device(dev);
343 return count; 343 return count;
344} 344}
345static DEVICE_ATTR(rescan, S_IWUSR, NULL, store_rescan_field); 345static DEVICE_ATTR(rescan, S_IWUSR, NULL, store_rescan_field);
346 346
347static ssize_t sdev_store_delete(struct device *dev, const char *buf, 347static ssize_t sdev_store_delete(struct device *dev, struct device_attribute *attr, const char *buf,
348 size_t count) 348 size_t count)
349{ 349{
350 scsi_remove_device(to_scsi_device(dev)); 350 scsi_remove_device(to_scsi_device(dev));
@@ -353,7 +353,7 @@ static ssize_t sdev_store_delete(struct device *dev, const char *buf,
353static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete); 353static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete);
354 354
355static ssize_t 355static ssize_t
356store_state_field(struct device *dev, const char *buf, size_t count) 356store_state_field(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
357{ 357{
358 int i; 358 int i;
359 struct scsi_device *sdev = to_scsi_device(dev); 359 struct scsi_device *sdev = to_scsi_device(dev);
@@ -376,7 +376,7 @@ store_state_field(struct device *dev, const char *buf, size_t count)
376} 376}
377 377
378static ssize_t 378static ssize_t
379show_state_field(struct device *dev, char *buf) 379show_state_field(struct device *dev, struct device_attribute *attr, char *buf)
380{ 380{
381 struct scsi_device *sdev = to_scsi_device(dev); 381 struct scsi_device *sdev = to_scsi_device(dev);
382 const char *name = scsi_device_state_name(sdev->sdev_state); 382 const char *name = scsi_device_state_name(sdev->sdev_state);
@@ -390,7 +390,7 @@ show_state_field(struct device *dev, char *buf)
390static DEVICE_ATTR(state, S_IRUGO | S_IWUSR, show_state_field, store_state_field); 390static DEVICE_ATTR(state, S_IRUGO | S_IWUSR, show_state_field, store_state_field);
391 391
392static ssize_t 392static ssize_t
393show_queue_type_field(struct device *dev, char *buf) 393show_queue_type_field(struct device *dev, struct device_attribute *attr, char *buf)
394{ 394{
395 struct scsi_device *sdev = to_scsi_device(dev); 395 struct scsi_device *sdev = to_scsi_device(dev);
396 const char *name = "none"; 396 const char *name = "none";
@@ -406,7 +406,7 @@ show_queue_type_field(struct device *dev, char *buf)
406static DEVICE_ATTR(queue_type, S_IRUGO, show_queue_type_field, NULL); 406static DEVICE_ATTR(queue_type, S_IRUGO, show_queue_type_field, NULL);
407 407
408static ssize_t 408static ssize_t
409show_iostat_counterbits(struct device *dev, char *buf) 409show_iostat_counterbits(struct device *dev, struct device_attribute *attr, char *buf)
410{ 410{
411 return snprintf(buf, 20, "%d\n", (int)sizeof(atomic_t) * 8); 411 return snprintf(buf, 20, "%d\n", (int)sizeof(atomic_t) * 8);
412} 412}
@@ -415,7 +415,7 @@ static DEVICE_ATTR(iocounterbits, S_IRUGO, show_iostat_counterbits, NULL);
415 415
416#define show_sdev_iostat(field) \ 416#define show_sdev_iostat(field) \
417static ssize_t \ 417static ssize_t \
418show_iostat_##field(struct device *dev, char *buf) \ 418show_iostat_##field(struct device *dev, struct device_attribute *attr, char *buf) \
419{ \ 419{ \
420 struct scsi_device *sdev = to_scsi_device(dev); \ 420 struct scsi_device *sdev = to_scsi_device(dev); \
421 unsigned long long count = atomic_read(&sdev->field); \ 421 unsigned long long count = atomic_read(&sdev->field); \
@@ -449,7 +449,7 @@ static struct device_attribute *scsi_sysfs_sdev_attrs[] = {
449 NULL 449 NULL
450}; 450};
451 451
452static ssize_t sdev_store_queue_depth_rw(struct device *dev, const char *buf, 452static ssize_t sdev_store_queue_depth_rw(struct device *dev, struct device_attribute *attr, const char *buf,
453 size_t count) 453 size_t count)
454{ 454{
455 int depth, retval; 455 int depth, retval;
@@ -475,7 +475,7 @@ static struct device_attribute sdev_attr_queue_depth_rw =
475 __ATTR(queue_depth, S_IRUGO | S_IWUSR, sdev_show_queue_depth, 475 __ATTR(queue_depth, S_IRUGO | S_IWUSR, sdev_show_queue_depth,
476 sdev_store_queue_depth_rw); 476 sdev_store_queue_depth_rw);
477 477
478static ssize_t sdev_store_queue_type_rw(struct device *dev, const char *buf, 478static ssize_t sdev_store_queue_type_rw(struct device *dev, struct device_attribute *attr, const char *buf,
479 size_t count) 479 size_t count)
480{ 480{
481 struct scsi_device *sdev = to_scsi_device(dev); 481 struct scsi_device *sdev = to_scsi_device(dev);
@@ -669,6 +669,13 @@ void __scsi_remove_target(struct scsi_target *starget)
669 scsi_target_reap(starget); 669 scsi_target_reap(starget);
670} 670}
671 671
672static int __remove_child (struct device * dev, void * data)
673{
674 if (scsi_is_target_device(dev))
675 __scsi_remove_target(to_scsi_target(dev));
676 return 0;
677}
678
672/** 679/**
673 * scsi_remove_target - try to remove a target and all its devices 680 * scsi_remove_target - try to remove a target and all its devices
674 * @dev: generic starget or parent of generic stargets to be removed 681 * @dev: generic starget or parent of generic stargets to be removed
@@ -679,7 +686,7 @@ void __scsi_remove_target(struct scsi_target *starget)
679 */ 686 */
680void scsi_remove_target(struct device *dev) 687void scsi_remove_target(struct device *dev)
681{ 688{
682 struct device *rdev, *idev, *next; 689 struct device *rdev;
683 690
684 if (scsi_is_target_device(dev)) { 691 if (scsi_is_target_device(dev)) {
685 __scsi_remove_target(to_scsi_target(dev)); 692 __scsi_remove_target(to_scsi_target(dev));
@@ -687,10 +694,7 @@ void scsi_remove_target(struct device *dev)
687 } 694 }
688 695
689 rdev = get_device(dev); 696 rdev = get_device(dev);
690 list_for_each_entry_safe(idev, next, &dev->children, node) { 697 device_for_each_child(dev, NULL, __remove_child);
691 if (scsi_is_target_device(idev))
692 __scsi_remove_target(to_scsi_target(idev));
693 }
694 put_device(rdev); 698 put_device(rdev);
695} 699}
696EXPORT_SYMBOL(scsi_remove_target); 700EXPORT_SYMBOL(scsi_remove_target);
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index c87ae469d707..2918b9600db7 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -348,17 +348,21 @@ spi_transport_rd_attr(rd_strm, "%d\n");
348spi_transport_rd_attr(rti, "%d\n"); 348spi_transport_rd_attr(rti, "%d\n");
349spi_transport_rd_attr(pcomp_en, "%d\n"); 349spi_transport_rd_attr(pcomp_en, "%d\n");
350 350
351/* we only care about the first child device so we return 1 */
352static int child_iter(struct device *dev, void *data)
353{
354 struct scsi_device *sdev = to_scsi_device(dev);
355
356 spi_dv_device(sdev);
357 return 1;
358}
359
351static ssize_t 360static ssize_t
352store_spi_revalidate(struct class_device *cdev, const char *buf, size_t count) 361store_spi_revalidate(struct class_device *cdev, const char *buf, size_t count)
353{ 362{
354 struct scsi_target *starget = transport_class_to_starget(cdev); 363 struct scsi_target *starget = transport_class_to_starget(cdev);
355 364
356 /* FIXME: we're relying on an awful lot of device internals 365 device_for_each_child(&starget->dev, NULL, child_iter);
357 * here. We really need a function to get the first available
358 * child */
359 struct device *dev = container_of(starget->dev.children.next, struct device, node);
360 struct scsi_device *sdev = to_scsi_device(dev);
361 spi_dv_device(sdev);
362 return count; 366 return count;
363} 367}
364static CLASS_DEVICE_ATTR(revalidate, S_IWUSR, NULL, store_spi_revalidate); 368static CLASS_DEVICE_ATTR(revalidate, S_IWUSR, NULL, store_spi_revalidate);
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 3d1d7bff38ed..51292f269ce5 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1430,7 +1430,7 @@ static struct file_operations sg_fops = {
1430 .fasync = sg_fasync, 1430 .fasync = sg_fasync,
1431}; 1431};
1432 1432
1433static struct class_simple * sg_sysfs_class; 1433static struct class *sg_sysfs_class;
1434 1434
1435static int sg_sysfs_valid = 0; 1435static int sg_sysfs_valid = 0;
1436 1436
@@ -1551,13 +1551,13 @@ sg_add(struct class_device *cl_dev)
1551 if (sg_sysfs_valid) { 1551 if (sg_sysfs_valid) {
1552 struct class_device * sg_class_member; 1552 struct class_device * sg_class_member;
1553 1553
1554 sg_class_member = class_simple_device_add(sg_sysfs_class, 1554 sg_class_member = class_device_create(sg_sysfs_class,
1555 MKDEV(SCSI_GENERIC_MAJOR, k), 1555 MKDEV(SCSI_GENERIC_MAJOR, k),
1556 cl_dev->dev, "%s", 1556 cl_dev->dev, "%s",
1557 disk->disk_name); 1557 disk->disk_name);
1558 if (IS_ERR(sg_class_member)) 1558 if (IS_ERR(sg_class_member))
1559 printk(KERN_WARNING "sg_add: " 1559 printk(KERN_WARNING "sg_add: "
1560 "class_simple_device_add failed\n"); 1560 "class_device_create failed\n");
1561 class_set_devdata(sg_class_member, sdp); 1561 class_set_devdata(sg_class_member, sdp);
1562 error = sysfs_create_link(&scsidp->sdev_gendev.kobj, 1562 error = sysfs_create_link(&scsidp->sdev_gendev.kobj,
1563 &sg_class_member->kobj, "generic"); 1563 &sg_class_member->kobj, "generic");
@@ -1636,7 +1636,7 @@ sg_remove(struct class_device *cl_dev)
1636 1636
1637 if (sdp) { 1637 if (sdp) {
1638 sysfs_remove_link(&scsidp->sdev_gendev.kobj, "generic"); 1638 sysfs_remove_link(&scsidp->sdev_gendev.kobj, "generic");
1639 class_simple_device_remove(MKDEV(SCSI_GENERIC_MAJOR, k)); 1639 class_device_destroy(sg_sysfs_class, MKDEV(SCSI_GENERIC_MAJOR, k));
1640 cdev_del(sdp->cdev); 1640 cdev_del(sdp->cdev);
1641 sdp->cdev = NULL; 1641 sdp->cdev = NULL;
1642 devfs_remove("%s/generic", scsidp->devfs_name); 1642 devfs_remove("%s/generic", scsidp->devfs_name);
@@ -1677,7 +1677,7 @@ init_sg(void)
1677 SG_MAX_DEVS, "sg"); 1677 SG_MAX_DEVS, "sg");
1678 if (rc) 1678 if (rc)
1679 return rc; 1679 return rc;
1680 sg_sysfs_class = class_simple_create(THIS_MODULE, "scsi_generic"); 1680 sg_sysfs_class = class_create(THIS_MODULE, "scsi_generic");
1681 if ( IS_ERR(sg_sysfs_class) ) { 1681 if ( IS_ERR(sg_sysfs_class) ) {
1682 rc = PTR_ERR(sg_sysfs_class); 1682 rc = PTR_ERR(sg_sysfs_class);
1683 goto err_out; 1683 goto err_out;
@@ -1690,7 +1690,7 @@ init_sg(void)
1690#endif /* CONFIG_SCSI_PROC_FS */ 1690#endif /* CONFIG_SCSI_PROC_FS */
1691 return 0; 1691 return 0;
1692 } 1692 }
1693 class_simple_destroy(sg_sysfs_class); 1693 class_destroy(sg_sysfs_class);
1694err_out: 1694err_out:
1695 unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), SG_MAX_DEVS); 1695 unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), SG_MAX_DEVS);
1696 return rc; 1696 return rc;
@@ -1703,7 +1703,7 @@ exit_sg(void)
1703 sg_proc_cleanup(); 1703 sg_proc_cleanup();
1704#endif /* CONFIG_SCSI_PROC_FS */ 1704#endif /* CONFIG_SCSI_PROC_FS */
1705 scsi_unregister_interface(&sg_interface); 1705 scsi_unregister_interface(&sg_interface);
1706 class_simple_destroy(sg_sysfs_class); 1706 class_destroy(sg_sysfs_class);
1707 sg_sysfs_valid = 0; 1707 sg_sysfs_valid = 0;
1708 unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), 1708 unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0),
1709 SG_MAX_DEVS); 1709 SG_MAX_DEVS);
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 03b902c20e09..0291a8fb654d 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -84,7 +84,7 @@ static int try_wdio = 1;
84static int st_dev_max; 84static int st_dev_max;
85static int st_nr_dev; 85static int st_nr_dev;
86 86
87static struct class_simple *st_sysfs_class; 87static struct class *st_sysfs_class;
88 88
89MODULE_AUTHOR("Kai Makisara"); 89MODULE_AUTHOR("Kai Makisara");
90MODULE_DESCRIPTION("SCSI Tape Driver"); 90MODULE_DESCRIPTION("SCSI Tape Driver");
@@ -4024,8 +4024,9 @@ out_free_tape:
4024 if (STm->cdevs[j]) { 4024 if (STm->cdevs[j]) {
4025 if (cdev == STm->cdevs[j]) 4025 if (cdev == STm->cdevs[j])
4026 cdev = NULL; 4026 cdev = NULL;
4027 class_simple_device_remove(MKDEV(SCSI_TAPE_MAJOR, 4027 class_device_destroy(st_sysfs_class,
4028 TAPE_MINOR(i, mode, j))); 4028 MKDEV(SCSI_TAPE_MAJOR,
4029 TAPE_MINOR(i, mode, j)));
4029 cdev_del(STm->cdevs[j]); 4030 cdev_del(STm->cdevs[j]);
4030 } 4031 }
4031 } 4032 }
@@ -4068,8 +4069,9 @@ static int st_remove(struct device *dev)
4068 devfs_remove("%s/mt%s", SDp->devfs_name, st_formats[j]); 4069 devfs_remove("%s/mt%s", SDp->devfs_name, st_formats[j]);
4069 devfs_remove("%s/mt%sn", SDp->devfs_name, st_formats[j]); 4070 devfs_remove("%s/mt%sn", SDp->devfs_name, st_formats[j]);
4070 for (j=0; j < 2; j++) { 4071 for (j=0; j < 2; j++) {
4071 class_simple_device_remove(MKDEV(SCSI_TAPE_MAJOR, 4072 class_device_destroy(st_sysfs_class,
4072 TAPE_MINOR(i, mode, j))); 4073 MKDEV(SCSI_TAPE_MAJOR,
4074 TAPE_MINOR(i, mode, j)));
4073 cdev_del(tpnt->modes[mode].cdevs[j]); 4075 cdev_del(tpnt->modes[mode].cdevs[j]);
4074 tpnt->modes[mode].cdevs[j] = NULL; 4076 tpnt->modes[mode].cdevs[j] = NULL;
4075 } 4077 }
@@ -4134,7 +4136,7 @@ static int __init init_st(void)
4134 "st: Version %s, fixed bufsize %d, s/g segs %d\n", 4136 "st: Version %s, fixed bufsize %d, s/g segs %d\n",
4135 verstr, st_fixed_buffer_size, st_max_sg_segs); 4137 verstr, st_fixed_buffer_size, st_max_sg_segs);
4136 4138
4137 st_sysfs_class = class_simple_create(THIS_MODULE, "scsi_tape"); 4139 st_sysfs_class = class_create(THIS_MODULE, "scsi_tape");
4138 if (IS_ERR(st_sysfs_class)) { 4140 if (IS_ERR(st_sysfs_class)) {
4139 st_sysfs_class = NULL; 4141 st_sysfs_class = NULL;
4140 printk(KERN_ERR "Unable create sysfs class for SCSI tapes\n"); 4142 printk(KERN_ERR "Unable create sysfs class for SCSI tapes\n");
@@ -4148,7 +4150,7 @@ static int __init init_st(void)
4148 return 0; 4150 return 0;
4149 } 4151 }
4150 if (st_sysfs_class) 4152 if (st_sysfs_class)
4151 class_simple_destroy(st_sysfs_class); 4153 class_destroy(st_sysfs_class);
4152 unregister_chrdev_region(MKDEV(SCSI_TAPE_MAJOR, 0), 4154 unregister_chrdev_region(MKDEV(SCSI_TAPE_MAJOR, 0),
4153 4155
4154 ST_MAX_TAPE_ENTRIES); 4156 ST_MAX_TAPE_ENTRIES);
@@ -4161,7 +4163,7 @@ static int __init init_st(void)
4161static void __exit exit_st(void) 4163static void __exit exit_st(void)
4162{ 4164{
4163 if (st_sysfs_class) 4165 if (st_sysfs_class)
4164 class_simple_destroy(st_sysfs_class); 4166 class_destroy(st_sysfs_class);
4165 st_sysfs_class = NULL; 4167 st_sysfs_class = NULL;
4166 do_remove_driverfs_files(); 4168 do_remove_driverfs_files();
4167 scsi_unregister_driver(&st_template.gendrv); 4169 scsi_unregister_driver(&st_template.gendrv);
@@ -4284,12 +4286,12 @@ static void do_create_class_files(struct scsi_tape *STp, int dev_num, int mode)
4284 snprintf(name, 10, "%s%s%s", rew ? "n" : "", 4286 snprintf(name, 10, "%s%s%s", rew ? "n" : "",
4285 STp->disk->disk_name, st_formats[i]); 4287 STp->disk->disk_name, st_formats[i]);
4286 st_class_member = 4288 st_class_member =
4287 class_simple_device_add(st_sysfs_class, 4289 class_device_create(st_sysfs_class,
4288 MKDEV(SCSI_TAPE_MAJOR, 4290 MKDEV(SCSI_TAPE_MAJOR,
4289 TAPE_MINOR(dev_num, mode, rew)), 4291 TAPE_MINOR(dev_num, mode, rew)),
4290 &STp->device->sdev_gendev, "%s", name); 4292 &STp->device->sdev_gendev, "%s", name);
4291 if (IS_ERR(st_class_member)) { 4293 if (IS_ERR(st_class_member)) {
4292 printk(KERN_WARNING "st%d: class_simple_device_add failed\n", 4294 printk(KERN_WARNING "st%d: class_device_create failed\n",
4293 dev_num); 4295 dev_num);
4294 goto out; 4296 goto out;
4295 } 4297 }