aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hosts.c
diff options
context:
space:
mode:
authorTony Jones <tonyj@suse.de>2008-02-21 18:13:36 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-19 22:10:33 -0400
commitee959b00c335d7780136c5abda37809191fe52c3 (patch)
tree7775f3b274fd8caf5e7e5154fea89e96f2babd94 /drivers/scsi/hosts.c
parent56d110e852b0b1c85ad6c9bfe1cb4473ceb16402 (diff)
SCSI: convert struct class_device to struct device
It's big, but there doesn't seem to be a way to split it up smaller... Signed-off-by: Tony Jones <tonyj@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Cc: Roland Dreier <rolandd@cisco.com> Cc: Sean Hefty <sean.hefty@intel.com> Cc: Hal Rosenstock <hal.rosenstock@gmail.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/scsi/hosts.c')
-rw-r--r--drivers/scsi/hosts.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 1592640a87b5..c264a8c5f01e 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -43,14 +43,14 @@
43static int scsi_host_next_hn; /* host_no for next new host */ 43static int scsi_host_next_hn; /* host_no for next new host */
44 44
45 45
46static void scsi_host_cls_release(struct class_device *class_dev) 46static void scsi_host_cls_release(struct device *dev)
47{ 47{
48 put_device(&class_to_shost(class_dev)->shost_gendev); 48 put_device(&class_to_shost(dev)->shost_gendev);
49} 49}
50 50
51static struct class shost_class = { 51static struct class shost_class = {
52 .name = "scsi_host", 52 .name = "scsi_host",
53 .release = scsi_host_cls_release, 53 .dev_release = scsi_host_cls_release,
54}; 54};
55 55
56/** 56/**
@@ -174,7 +174,7 @@ void scsi_remove_host(struct Scsi_Host *shost)
174 spin_unlock_irqrestore(shost->host_lock, flags); 174 spin_unlock_irqrestore(shost->host_lock, flags);
175 175
176 transport_unregister_device(&shost->shost_gendev); 176 transport_unregister_device(&shost->shost_gendev);
177 class_device_unregister(&shost->shost_classdev); 177 device_unregister(&shost->shost_dev);
178 device_del(&shost->shost_gendev); 178 device_del(&shost->shost_gendev);
179 scsi_proc_hostdir_rm(shost->hostt); 179 scsi_proc_hostdir_rm(shost->hostt);
180} 180}
@@ -212,7 +212,7 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
212 scsi_host_set_state(shost, SHOST_RUNNING); 212 scsi_host_set_state(shost, SHOST_RUNNING);
213 get_device(shost->shost_gendev.parent); 213 get_device(shost->shost_gendev.parent);
214 214
215 error = class_device_add(&shost->shost_classdev); 215 error = device_add(&shost->shost_dev);
216 if (error) 216 if (error)
217 goto out_del_gendev; 217 goto out_del_gendev;
218 218
@@ -223,7 +223,7 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
223 GFP_KERNEL); 223 GFP_KERNEL);
224 if (shost->shost_data == NULL) { 224 if (shost->shost_data == NULL) {
225 error = -ENOMEM; 225 error = -ENOMEM;
226 goto out_del_classdev; 226 goto out_del_dev;
227 } 227 }
228 } 228 }
229 229
@@ -250,8 +250,8 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
250 destroy_workqueue(shost->work_q); 250 destroy_workqueue(shost->work_q);
251 out_free_shost_data: 251 out_free_shost_data:
252 kfree(shost->shost_data); 252 kfree(shost->shost_data);
253 out_del_classdev: 253 out_del_dev:
254 class_device_del(&shost->shost_classdev); 254 device_del(&shost->shost_dev);
255 out_del_gendev: 255 out_del_gendev:
256 device_del(&shost->shost_gendev); 256 device_del(&shost->shost_gendev);
257 out: 257 out:
@@ -385,11 +385,11 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
385 shost->host_no); 385 shost->host_no);
386 shost->shost_gendev.release = scsi_host_dev_release; 386 shost->shost_gendev.release = scsi_host_dev_release;
387 387
388 class_device_initialize(&shost->shost_classdev); 388 device_initialize(&shost->shost_dev);
389 shost->shost_classdev.dev = &shost->shost_gendev; 389 shost->shost_dev.parent = &shost->shost_gendev;
390 shost->shost_classdev.class = &shost_class; 390 shost->shost_dev.class = &shost_class;
391 snprintf(shost->shost_classdev.class_id, BUS_ID_SIZE, "host%d", 391 snprintf(shost->shost_dev.bus_id, BUS_ID_SIZE, "host%d",
392 shost->host_no); 392 shost->host_no);
393 393
394 shost->ehandler = kthread_run(scsi_error_handler, shost, 394 shost->ehandler = kthread_run(scsi_error_handler, shost,
395 "scsi_eh_%d", shost->host_no); 395 "scsi_eh_%d", shost->host_no);
@@ -432,12 +432,12 @@ void scsi_unregister(struct Scsi_Host *shost)
432} 432}
433EXPORT_SYMBOL(scsi_unregister); 433EXPORT_SYMBOL(scsi_unregister);
434 434
435static int __scsi_host_match(struct class_device *cdev, void *data) 435static int __scsi_host_match(struct device *dev, void *data)
436{ 436{
437 struct Scsi_Host *p; 437 struct Scsi_Host *p;
438 unsigned short *hostnum = (unsigned short *)data; 438 unsigned short *hostnum = (unsigned short *)data;
439 439
440 p = class_to_shost(cdev); 440 p = class_to_shost(dev);
441 return p->host_no == *hostnum; 441 return p->host_no == *hostnum;
442} 442}
443 443
@@ -450,10 +450,10 @@ static int __scsi_host_match(struct class_device *cdev, void *data)
450 **/ 450 **/
451struct Scsi_Host *scsi_host_lookup(unsigned short hostnum) 451struct Scsi_Host *scsi_host_lookup(unsigned short hostnum)
452{ 452{
453 struct class_device *cdev; 453 struct device *cdev;
454 struct Scsi_Host *shost = ERR_PTR(-ENXIO); 454 struct Scsi_Host *shost = ERR_PTR(-ENXIO);
455 455
456 cdev = class_find_child(&shost_class, &hostnum, __scsi_host_match); 456 cdev = class_find_device(&shost_class, &hostnum, __scsi_host_match);
457 if (cdev) 457 if (cdev)
458 shost = scsi_host_get(class_to_shost(cdev)); 458 shost = scsi_host_get(class_to_shost(cdev));
459 459