diff options
author | Brian King <brking@linux.vnet.ibm.com> | 2009-05-28 17:17:25 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-08 14:07:33 -0400 |
commit | 85e2399e925e0afa04dd6e185a910bdd3dc4626b (patch) | |
tree | 3eeb22266e6e42411d4e1503c3bd96b7d673679d | |
parent | 7270b9bde5f382e730e1ef69d6c1b34d388df2b0 (diff) |
[SCSI] ibmvfc: Use DEVICE_ATTR macro
Use DEVICE_ATTR macro for defining device sysfs attributes.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvfc.c | 67 |
1 files changed, 13 insertions, 54 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index c450a346590e..26abed2c3a41 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c | |||
@@ -2434,14 +2434,6 @@ static ssize_t ibmvfc_show_host_partition_name(struct device *dev, | |||
2434 | vhost->login_buf->resp.partition_name); | 2434 | vhost->login_buf->resp.partition_name); |
2435 | } | 2435 | } |
2436 | 2436 | ||
2437 | static struct device_attribute ibmvfc_host_partition_name = { | ||
2438 | .attr = { | ||
2439 | .name = "partition_name", | ||
2440 | .mode = S_IRUGO, | ||
2441 | }, | ||
2442 | .show = ibmvfc_show_host_partition_name, | ||
2443 | }; | ||
2444 | |||
2445 | static ssize_t ibmvfc_show_host_device_name(struct device *dev, | 2437 | static ssize_t ibmvfc_show_host_device_name(struct device *dev, |
2446 | struct device_attribute *attr, char *buf) | 2438 | struct device_attribute *attr, char *buf) |
2447 | { | 2439 | { |
@@ -2452,14 +2444,6 @@ static ssize_t ibmvfc_show_host_device_name(struct device *dev, | |||
2452 | vhost->login_buf->resp.device_name); | 2444 | vhost->login_buf->resp.device_name); |
2453 | } | 2445 | } |
2454 | 2446 | ||
2455 | static struct device_attribute ibmvfc_host_device_name = { | ||
2456 | .attr = { | ||
2457 | .name = "device_name", | ||
2458 | .mode = S_IRUGO, | ||
2459 | }, | ||
2460 | .show = ibmvfc_show_host_device_name, | ||
2461 | }; | ||
2462 | |||
2463 | static ssize_t ibmvfc_show_host_loc_code(struct device *dev, | 2447 | static ssize_t ibmvfc_show_host_loc_code(struct device *dev, |
2464 | struct device_attribute *attr, char *buf) | 2448 | struct device_attribute *attr, char *buf) |
2465 | { | 2449 | { |
@@ -2470,14 +2454,6 @@ static ssize_t ibmvfc_show_host_loc_code(struct device *dev, | |||
2470 | vhost->login_buf->resp.port_loc_code); | 2454 | vhost->login_buf->resp.port_loc_code); |
2471 | } | 2455 | } |
2472 | 2456 | ||
2473 | static struct device_attribute ibmvfc_host_loc_code = { | ||
2474 | .attr = { | ||
2475 | .name = "port_loc_code", | ||
2476 | .mode = S_IRUGO, | ||
2477 | }, | ||
2478 | .show = ibmvfc_show_host_loc_code, | ||
2479 | }; | ||
2480 | |||
2481 | static ssize_t ibmvfc_show_host_drc_name(struct device *dev, | 2457 | static ssize_t ibmvfc_show_host_drc_name(struct device *dev, |
2482 | struct device_attribute *attr, char *buf) | 2458 | struct device_attribute *attr, char *buf) |
2483 | { | 2459 | { |
@@ -2488,14 +2464,6 @@ static ssize_t ibmvfc_show_host_drc_name(struct device *dev, | |||
2488 | vhost->login_buf->resp.drc_name); | 2464 | vhost->login_buf->resp.drc_name); |
2489 | } | 2465 | } |
2490 | 2466 | ||
2491 | static struct device_attribute ibmvfc_host_drc_name = { | ||
2492 | .attr = { | ||
2493 | .name = "drc_name", | ||
2494 | .mode = S_IRUGO, | ||
2495 | }, | ||
2496 | .show = ibmvfc_show_host_drc_name, | ||
2497 | }; | ||
2498 | |||
2499 | static ssize_t ibmvfc_show_host_npiv_version(struct device *dev, | 2467 | static ssize_t ibmvfc_show_host_npiv_version(struct device *dev, |
2500 | struct device_attribute *attr, char *buf) | 2468 | struct device_attribute *attr, char *buf) |
2501 | { | 2469 | { |
@@ -2504,14 +2472,6 @@ static ssize_t ibmvfc_show_host_npiv_version(struct device *dev, | |||
2504 | return snprintf(buf, PAGE_SIZE, "%d\n", vhost->login_buf->resp.version); | 2472 | return snprintf(buf, PAGE_SIZE, "%d\n", vhost->login_buf->resp.version); |
2505 | } | 2473 | } |
2506 | 2474 | ||
2507 | static struct device_attribute ibmvfc_host_npiv_version = { | ||
2508 | .attr = { | ||
2509 | .name = "npiv_version", | ||
2510 | .mode = S_IRUGO, | ||
2511 | }, | ||
2512 | .show = ibmvfc_show_host_npiv_version, | ||
2513 | }; | ||
2514 | |||
2515 | /** | 2475 | /** |
2516 | * ibmvfc_show_log_level - Show the adapter's error logging level | 2476 | * ibmvfc_show_log_level - Show the adapter's error logging level |
2517 | * @dev: class device struct | 2477 | * @dev: class device struct |
@@ -2556,14 +2516,13 @@ static ssize_t ibmvfc_store_log_level(struct device *dev, | |||
2556 | return strlen(buf); | 2516 | return strlen(buf); |
2557 | } | 2517 | } |
2558 | 2518 | ||
2559 | static struct device_attribute ibmvfc_log_level_attr = { | 2519 | static DEVICE_ATTR(partition_name, S_IRUGO, ibmvfc_show_host_partition_name, NULL); |
2560 | .attr = { | 2520 | static DEVICE_ATTR(device_name, S_IRUGO, ibmvfc_show_host_device_name, NULL); |
2561 | .name = "log_level", | 2521 | static DEVICE_ATTR(port_loc_code, S_IRUGO, ibmvfc_show_host_loc_code, NULL); |
2562 | .mode = S_IRUGO | S_IWUSR, | 2522 | static DEVICE_ATTR(drc_name, S_IRUGO, ibmvfc_show_host_drc_name, NULL); |
2563 | }, | 2523 | static DEVICE_ATTR(npiv_version, S_IRUGO, ibmvfc_show_host_npiv_version, NULL); |
2564 | .show = ibmvfc_show_log_level, | 2524 | static DEVICE_ATTR(log_level, S_IRUGO | S_IWUSR, |
2565 | .store = ibmvfc_store_log_level | 2525 | ibmvfc_show_log_level, ibmvfc_store_log_level); |
2566 | }; | ||
2567 | 2526 | ||
2568 | #ifdef CONFIG_SCSI_IBMVFC_TRACE | 2527 | #ifdef CONFIG_SCSI_IBMVFC_TRACE |
2569 | /** | 2528 | /** |
@@ -2612,12 +2571,12 @@ static struct bin_attribute ibmvfc_trace_attr = { | |||
2612 | #endif | 2571 | #endif |
2613 | 2572 | ||
2614 | static struct device_attribute *ibmvfc_attrs[] = { | 2573 | static struct device_attribute *ibmvfc_attrs[] = { |
2615 | &ibmvfc_host_partition_name, | 2574 | &dev_attr_partition_name, |
2616 | &ibmvfc_host_device_name, | 2575 | &dev_attr_device_name, |
2617 | &ibmvfc_host_loc_code, | 2576 | &dev_attr_port_loc_code, |
2618 | &ibmvfc_host_drc_name, | 2577 | &dev_attr_drc_name, |
2619 | &ibmvfc_host_npiv_version, | 2578 | &dev_attr_npiv_version, |
2620 | &ibmvfc_log_level_attr, | 2579 | &dev_attr_log_level, |
2621 | NULL | 2580 | NULL |
2622 | }; | 2581 | }; |
2623 | 2582 | ||