aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message
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/message
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/message')
-rw-r--r--drivers/message/fusion/mptscsih.c122
-rw-r--r--drivers/message/fusion/mptscsih.h2
2 files changed, 69 insertions, 55 deletions
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 89c63147a15d..b109bd8a4d19 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -3300,9 +3300,10 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
3300} 3300}
3301 3301
3302static ssize_t 3302static ssize_t
3303mptscsih_version_fw_show(struct class_device *cdev, char *buf) 3303mptscsih_version_fw_show(struct device *dev, struct device_attribute *attr,
3304 char *buf)
3304{ 3305{
3305 struct Scsi_Host *host = class_to_shost(cdev); 3306 struct Scsi_Host *host = class_to_shost(dev);
3306 MPT_SCSI_HOST *hd = shost_priv(host); 3307 MPT_SCSI_HOST *hd = shost_priv(host);
3307 MPT_ADAPTER *ioc = hd->ioc; 3308 MPT_ADAPTER *ioc = hd->ioc;
3308 3309
@@ -3312,12 +3313,13 @@ mptscsih_version_fw_show(struct class_device *cdev, char *buf)
3312 (ioc->facts.FWVersion.Word & 0x0000FF00) >> 8, 3313 (ioc->facts.FWVersion.Word & 0x0000FF00) >> 8,
3313 ioc->facts.FWVersion.Word & 0x000000FF); 3314 ioc->facts.FWVersion.Word & 0x000000FF);
3314} 3315}
3315static CLASS_DEVICE_ATTR(version_fw, S_IRUGO, mptscsih_version_fw_show, NULL); 3316static DEVICE_ATTR(version_fw, S_IRUGO, mptscsih_version_fw_show, NULL);
3316 3317
3317static ssize_t 3318static ssize_t
3318mptscsih_version_bios_show(struct class_device *cdev, char *buf) 3319mptscsih_version_bios_show(struct device *dev, struct device_attribute *attr,
3320 char *buf)
3319{ 3321{
3320 struct Scsi_Host *host = class_to_shost(cdev); 3322 struct Scsi_Host *host = class_to_shost(dev);
3321 MPT_SCSI_HOST *hd = shost_priv(host); 3323 MPT_SCSI_HOST *hd = shost_priv(host);
3322 MPT_ADAPTER *ioc = hd->ioc; 3324 MPT_ADAPTER *ioc = hd->ioc;
3323 3325
@@ -3327,129 +3329,141 @@ mptscsih_version_bios_show(struct class_device *cdev, char *buf)
3327 (ioc->biosVersion & 0x0000FF00) >> 8, 3329 (ioc->biosVersion & 0x0000FF00) >> 8,
3328 ioc->biosVersion & 0x000000FF); 3330 ioc->biosVersion & 0x000000FF);
3329} 3331}
3330static CLASS_DEVICE_ATTR(version_bios, S_IRUGO, mptscsih_version_bios_show, NULL); 3332static DEVICE_ATTR(version_bios, S_IRUGO, mptscsih_version_bios_show, NULL);
3331 3333
3332static ssize_t 3334static ssize_t
3333mptscsih_version_mpi_show(struct class_device *cdev, char *buf) 3335mptscsih_version_mpi_show(struct device *dev, struct device_attribute *attr,
3336 char *buf)
3334{ 3337{
3335 struct Scsi_Host *host = class_to_shost(cdev); 3338 struct Scsi_Host *host = class_to_shost(dev);
3336 MPT_SCSI_HOST *hd = shost_priv(host); 3339 MPT_SCSI_HOST *hd = shost_priv(host);
3337 MPT_ADAPTER *ioc = hd->ioc; 3340 MPT_ADAPTER *ioc = hd->ioc;
3338 3341
3339 return snprintf(buf, PAGE_SIZE, "%03x\n", ioc->facts.MsgVersion); 3342 return snprintf(buf, PAGE_SIZE, "%03x\n", ioc->facts.MsgVersion);
3340} 3343}
3341static CLASS_DEVICE_ATTR(version_mpi, S_IRUGO, mptscsih_version_mpi_show, NULL); 3344static DEVICE_ATTR(version_mpi, S_IRUGO, mptscsih_version_mpi_show, NULL);
3342 3345
3343static ssize_t 3346static ssize_t
3344mptscsih_version_product_show(struct class_device *cdev, char *buf) 3347mptscsih_version_product_show(struct device *dev,
3348 struct device_attribute *attr,
3349char *buf)
3345{ 3350{
3346 struct Scsi_Host *host = class_to_shost(cdev); 3351 struct Scsi_Host *host = class_to_shost(dev);
3347 MPT_SCSI_HOST *hd = shost_priv(host); 3352 MPT_SCSI_HOST *hd = shost_priv(host);
3348 MPT_ADAPTER *ioc = hd->ioc; 3353 MPT_ADAPTER *ioc = hd->ioc;
3349 3354
3350 return snprintf(buf, PAGE_SIZE, "%s\n", ioc->prod_name); 3355 return snprintf(buf, PAGE_SIZE, "%s\n", ioc->prod_name);
3351} 3356}
3352static CLASS_DEVICE_ATTR(version_product, S_IRUGO, 3357static DEVICE_ATTR(version_product, S_IRUGO,
3353 mptscsih_version_product_show, NULL); 3358 mptscsih_version_product_show, NULL);
3354 3359
3355static ssize_t 3360static ssize_t
3356mptscsih_version_nvdata_persistent_show(struct class_device *cdev, char *buf) 3361mptscsih_version_nvdata_persistent_show(struct device *dev,
3362 struct device_attribute *attr,
3363 char *buf)
3357{ 3364{
3358 struct Scsi_Host *host = class_to_shost(cdev); 3365 struct Scsi_Host *host = class_to_shost(dev);
3359 MPT_SCSI_HOST *hd = shost_priv(host); 3366 MPT_SCSI_HOST *hd = shost_priv(host);
3360 MPT_ADAPTER *ioc = hd->ioc; 3367 MPT_ADAPTER *ioc = hd->ioc;
3361 3368
3362 return snprintf(buf, PAGE_SIZE, "%02xh\n", 3369 return snprintf(buf, PAGE_SIZE, "%02xh\n",
3363 ioc->nvdata_version_persistent); 3370 ioc->nvdata_version_persistent);
3364} 3371}
3365static CLASS_DEVICE_ATTR(version_nvdata_persistent, S_IRUGO, 3372static DEVICE_ATTR(version_nvdata_persistent, S_IRUGO,
3366 mptscsih_version_nvdata_persistent_show, NULL); 3373 mptscsih_version_nvdata_persistent_show, NULL);
3367 3374
3368static ssize_t 3375static ssize_t
3369mptscsih_version_nvdata_default_show(struct class_device *cdev, char *buf) 3376mptscsih_version_nvdata_default_show(struct device *dev,
3377 struct device_attribute *attr, char *buf)
3370{ 3378{
3371 struct Scsi_Host *host = class_to_shost(cdev); 3379 struct Scsi_Host *host = class_to_shost(dev);
3372 MPT_SCSI_HOST *hd = shost_priv(host); 3380 MPT_SCSI_HOST *hd = shost_priv(host);
3373 MPT_ADAPTER *ioc = hd->ioc; 3381 MPT_ADAPTER *ioc = hd->ioc;
3374 3382
3375 return snprintf(buf, PAGE_SIZE, "%02xh\n",ioc->nvdata_version_default); 3383 return snprintf(buf, PAGE_SIZE, "%02xh\n",ioc->nvdata_version_default);
3376} 3384}
3377static CLASS_DEVICE_ATTR(version_nvdata_default, S_IRUGO, 3385static DEVICE_ATTR(version_nvdata_default, S_IRUGO,
3378 mptscsih_version_nvdata_default_show, NULL); 3386 mptscsih_version_nvdata_default_show, NULL);
3379 3387
3380static ssize_t 3388static ssize_t
3381mptscsih_board_name_show(struct class_device *cdev, char *buf) 3389mptscsih_board_name_show(struct device *dev, struct device_attribute *attr,
3390 char *buf)
3382{ 3391{
3383 struct Scsi_Host *host = class_to_shost(cdev); 3392 struct Scsi_Host *host = class_to_shost(dev);
3384 MPT_SCSI_HOST *hd = shost_priv(host); 3393 MPT_SCSI_HOST *hd = shost_priv(host);
3385 MPT_ADAPTER *ioc = hd->ioc; 3394 MPT_ADAPTER *ioc = hd->ioc;
3386 3395
3387 return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_name); 3396 return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_name);
3388} 3397}
3389static CLASS_DEVICE_ATTR(board_name, S_IRUGO, mptscsih_board_name_show, NULL); 3398static DEVICE_ATTR(board_name, S_IRUGO, mptscsih_board_name_show, NULL);
3390 3399
3391static ssize_t 3400static ssize_t
3392mptscsih_board_assembly_show(struct class_device *cdev, char *buf) 3401mptscsih_board_assembly_show(struct device *dev,
3402 struct device_attribute *attr, char *buf)
3393{ 3403{
3394 struct Scsi_Host *host = class_to_shost(cdev); 3404 struct Scsi_Host *host = class_to_shost(dev);
3395 MPT_SCSI_HOST *hd = shost_priv(host); 3405 MPT_SCSI_HOST *hd = shost_priv(host);
3396 MPT_ADAPTER *ioc = hd->ioc; 3406 MPT_ADAPTER *ioc = hd->ioc;
3397 3407
3398 return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_assembly); 3408 return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_assembly);
3399} 3409}
3400static CLASS_DEVICE_ATTR(board_assembly, S_IRUGO, 3410static DEVICE_ATTR(board_assembly, S_IRUGO,
3401 mptscsih_board_assembly_show, NULL); 3411 mptscsih_board_assembly_show, NULL);
3402 3412
3403static ssize_t 3413static ssize_t
3404mptscsih_board_tracer_show(struct class_device *cdev, char *buf) 3414mptscsih_board_tracer_show(struct device *dev, struct device_attribute *attr,
3415 char *buf)
3405{ 3416{
3406 struct Scsi_Host *host = class_to_shost(cdev); 3417 struct Scsi_Host *host = class_to_shost(dev);
3407 MPT_SCSI_HOST *hd = shost_priv(host); 3418 MPT_SCSI_HOST *hd = shost_priv(host);
3408 MPT_ADAPTER *ioc = hd->ioc; 3419 MPT_ADAPTER *ioc = hd->ioc;
3409 3420
3410 return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_tracer); 3421 return snprintf(buf, PAGE_SIZE, "%s\n", ioc->board_tracer);
3411} 3422}
3412static CLASS_DEVICE_ATTR(board_tracer, S_IRUGO, 3423static DEVICE_ATTR(board_tracer, S_IRUGO,
3413 mptscsih_board_tracer_show, NULL); 3424 mptscsih_board_tracer_show, NULL);
3414 3425
3415static ssize_t 3426static ssize_t
3416mptscsih_io_delay_show(struct class_device *cdev, char *buf) 3427mptscsih_io_delay_show(struct device *dev, struct device_attribute *attr,
3428 char *buf)
3417{ 3429{
3418 struct Scsi_Host *host = class_to_shost(cdev); 3430 struct Scsi_Host *host = class_to_shost(dev);
3419 MPT_SCSI_HOST *hd = shost_priv(host); 3431 MPT_SCSI_HOST *hd = shost_priv(host);
3420 MPT_ADAPTER *ioc = hd->ioc; 3432 MPT_ADAPTER *ioc = hd->ioc;
3421 3433
3422 return snprintf(buf, PAGE_SIZE, "%02d\n", ioc->io_missing_delay); 3434 return snprintf(buf, PAGE_SIZE, "%02d\n", ioc->io_missing_delay);
3423} 3435}
3424static CLASS_DEVICE_ATTR(io_delay, S_IRUGO, 3436static DEVICE_ATTR(io_delay, S_IRUGO,
3425 mptscsih_io_delay_show, NULL); 3437 mptscsih_io_delay_show, NULL);
3426 3438
3427static ssize_t 3439static ssize_t
3428mptscsih_device_delay_show(struct class_device *cdev, char *buf) 3440mptscsih_device_delay_show(struct device *dev, struct device_attribute *attr,
3441 char *buf)
3429{ 3442{
3430 struct Scsi_Host *host = class_to_shost(cdev); 3443 struct Scsi_Host *host = class_to_shost(dev);
3431 MPT_SCSI_HOST *hd = shost_priv(host); 3444 MPT_SCSI_HOST *hd = shost_priv(host);
3432 MPT_ADAPTER *ioc = hd->ioc; 3445 MPT_ADAPTER *ioc = hd->ioc;
3433 3446
3434 return snprintf(buf, PAGE_SIZE, "%02d\n", ioc->device_missing_delay); 3447 return snprintf(buf, PAGE_SIZE, "%02d\n", ioc->device_missing_delay);
3435} 3448}
3436static CLASS_DEVICE_ATTR(device_delay, S_IRUGO, 3449static DEVICE_ATTR(device_delay, S_IRUGO,
3437 mptscsih_device_delay_show, NULL); 3450 mptscsih_device_delay_show, NULL);
3438 3451
3439static ssize_t 3452static ssize_t
3440mptscsih_debug_level_show(struct class_device *cdev, char *buf) 3453mptscsih_debug_level_show(struct device *dev, struct device_attribute *attr,
3454 char *buf)
3441{ 3455{
3442 struct Scsi_Host *host = class_to_shost(cdev); 3456 struct Scsi_Host *host = class_to_shost(dev);
3443 MPT_SCSI_HOST *hd = shost_priv(host); 3457 MPT_SCSI_HOST *hd = shost_priv(host);
3444 MPT_ADAPTER *ioc = hd->ioc; 3458 MPT_ADAPTER *ioc = hd->ioc;
3445 3459
3446 return snprintf(buf, PAGE_SIZE, "%08xh\n", ioc->debug_level); 3460 return snprintf(buf, PAGE_SIZE, "%08xh\n", ioc->debug_level);
3447} 3461}
3448static ssize_t 3462static ssize_t
3449mptscsih_debug_level_store(struct class_device *cdev, const char *buf, 3463mptscsih_debug_level_store(struct device *dev, struct device_attribute *attr,
3450 size_t count) 3464 const char *buf, size_t count)
3451{ 3465{
3452 struct Scsi_Host *host = class_to_shost(cdev); 3466 struct Scsi_Host *host = class_to_shost(dev);
3453 MPT_SCSI_HOST *hd = shost_priv(host); 3467 MPT_SCSI_HOST *hd = shost_priv(host);
3454 MPT_ADAPTER *ioc = hd->ioc; 3468 MPT_ADAPTER *ioc = hd->ioc;
3455 int val = 0; 3469 int val = 0;
@@ -3462,22 +3476,22 @@ mptscsih_debug_level_store(struct class_device *cdev, const char *buf,
3462 ioc->name, ioc->debug_level); 3476 ioc->name, ioc->debug_level);
3463 return strlen(buf); 3477 return strlen(buf);
3464} 3478}
3465static CLASS_DEVICE_ATTR(debug_level, S_IRUGO | S_IWUSR, 3479static DEVICE_ATTR(debug_level, S_IRUGO | S_IWUSR,
3466 mptscsih_debug_level_show, mptscsih_debug_level_store); 3480 mptscsih_debug_level_show, mptscsih_debug_level_store);
3467 3481
3468struct class_device_attribute *mptscsih_host_attrs[] = { 3482struct device_attribute *mptscsih_host_attrs[] = {
3469 &class_device_attr_version_fw, 3483 &dev_attr_version_fw,
3470 &class_device_attr_version_bios, 3484 &dev_attr_version_bios,
3471 &class_device_attr_version_mpi, 3485 &dev_attr_version_mpi,
3472 &class_device_attr_version_product, 3486 &dev_attr_version_product,
3473 &class_device_attr_version_nvdata_persistent, 3487 &dev_attr_version_nvdata_persistent,
3474 &class_device_attr_version_nvdata_default, 3488 &dev_attr_version_nvdata_default,
3475 &class_device_attr_board_name, 3489 &dev_attr_board_name,
3476 &class_device_attr_board_assembly, 3490 &dev_attr_board_assembly,
3477 &class_device_attr_board_tracer, 3491 &dev_attr_board_tracer,
3478 &class_device_attr_io_delay, 3492 &dev_attr_io_delay,
3479 &class_device_attr_device_delay, 3493 &dev_attr_device_delay,
3480 &class_device_attr_debug_level, 3494 &dev_attr_debug_level,
3481 NULL, 3495 NULL,
3482}; 3496};
3483EXPORT_SYMBOL(mptscsih_host_attrs); 3497EXPORT_SYMBOL(mptscsih_host_attrs);
diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h
index d289e97cfe8b..7ea7da0e090c 100644
--- a/drivers/message/fusion/mptscsih.h
+++ b/drivers/message/fusion/mptscsih.h
@@ -129,4 +129,4 @@ extern void mptscsih_timer_expired(unsigned long data);
129extern int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun, int ctx2abort, ulong timeout); 129extern int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun, int ctx2abort, ulong timeout);
130extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id); 130extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id);
131extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id); 131extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id);
132extern struct class_device_attribute *mptscsih_host_attrs[]; 132extern struct device_attribute *mptscsih_host_attrs[];