aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/amso1100/c2_provider.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:30 -0400
commitf4e91eb4a81559da87a3843758a641b5cc590b65 (patch)
tree534335821d076764cbc072586b19c4b061710e3d /drivers/infiniband/hw/amso1100/c2_provider.c
parentc4c66cf1787d408066fbfc69209185701f5df15f (diff)
IB: convert struct class_device to struct device
This converts the main ib_device to use struct device instead of struct class_device as class_device is going away. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/infiniband/hw/amso1100/c2_provider.c')
-rw-r--r--drivers/infiniband/hw/amso1100/c2_provider.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/drivers/infiniband/hw/amso1100/c2_provider.c b/drivers/infiniband/hw/amso1100/c2_provider.c
index e10d27a6e14..6af2c0f79a6 100644
--- a/drivers/infiniband/hw/amso1100/c2_provider.c
+++ b/drivers/infiniband/hw/amso1100/c2_provider.c
@@ -523,45 +523,49 @@ static int c2_dereg_mr(struct ib_mr *ib_mr)
523 return err; 523 return err;
524} 524}
525 525
526static ssize_t show_rev(struct class_device *cdev, char *buf) 526static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
527 char *buf)
527{ 528{
528 struct c2_dev *dev = container_of(cdev, struct c2_dev, ibdev.class_dev); 529 struct c2_dev *c2dev = container_of(dev, struct c2_dev, ibdev.dev);
529 pr_debug("%s:%u\n", __func__, __LINE__); 530 pr_debug("%s:%u\n", __func__, __LINE__);
530 return sprintf(buf, "%x\n", dev->props.hw_ver); 531 return sprintf(buf, "%x\n", c2dev->props.hw_ver);
531} 532}
532 533
533static ssize_t show_fw_ver(struct class_device *cdev, char *buf) 534static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr,
535 char *buf)
534{ 536{
535 struct c2_dev *dev = container_of(cdev, struct c2_dev, ibdev.class_dev); 537 struct c2_dev *c2dev = container_of(dev, struct c2_dev, ibdev.dev);
536 pr_debug("%s:%u\n", __func__, __LINE__); 538 pr_debug("%s:%u\n", __func__, __LINE__);
537 return sprintf(buf, "%x.%x.%x\n", 539 return sprintf(buf, "%x.%x.%x\n",
538 (int) (dev->props.fw_ver >> 32), 540 (int) (c2dev->props.fw_ver >> 32),
539 (int) (dev->props.fw_ver >> 16) & 0xffff, 541 (int) (c2dev->props.fw_ver >> 16) & 0xffff,
540 (int) (dev->props.fw_ver & 0xffff)); 542 (int) (c2dev->props.fw_ver & 0xffff));
541} 543}
542 544
543static ssize_t show_hca(struct class_device *cdev, char *buf) 545static ssize_t show_hca(struct device *dev, struct device_attribute *attr,
546 char *buf)
544{ 547{
545 pr_debug("%s:%u\n", __func__, __LINE__); 548 pr_debug("%s:%u\n", __func__, __LINE__);
546 return sprintf(buf, "AMSO1100\n"); 549 return sprintf(buf, "AMSO1100\n");
547} 550}
548 551
549static ssize_t show_board(struct class_device *cdev, char *buf) 552static ssize_t show_board(struct device *dev, struct device_attribute *attr,
553 char *buf)
550{ 554{
551 pr_debug("%s:%u\n", __func__, __LINE__); 555 pr_debug("%s:%u\n", __func__, __LINE__);
552 return sprintf(buf, "%.*s\n", 32, "AMSO1100 Board ID"); 556 return sprintf(buf, "%.*s\n", 32, "AMSO1100 Board ID");
553} 557}
554 558
555static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL); 559static DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
556static CLASS_DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL); 560static DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
557static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL); 561static DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL);
558static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL); 562static DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL);
559 563
560static struct class_device_attribute *c2_class_attributes[] = { 564static struct device_attribute *c2_dev_attributes[] = {
561 &class_device_attr_hw_rev, 565 &dev_attr_hw_rev,
562 &class_device_attr_fw_ver, 566 &dev_attr_fw_ver,
563 &class_device_attr_hca_type, 567 &dev_attr_hca_type,
564 &class_device_attr_board_id 568 &dev_attr_board_id
565}; 569};
566 570
567static int c2_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, 571static int c2_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
@@ -861,9 +865,9 @@ int c2_register_device(struct c2_dev *dev)
861 if (ret) 865 if (ret)
862 goto out1; 866 goto out1;
863 867
864 for (i = 0; i < ARRAY_SIZE(c2_class_attributes); ++i) { 868 for (i = 0; i < ARRAY_SIZE(c2_dev_attributes); ++i) {
865 ret = class_device_create_file(&dev->ibdev.class_dev, 869 ret = device_create_file(&dev->ibdev.dev,
866 c2_class_attributes[i]); 870 c2_dev_attributes[i]);
867 if (ret) 871 if (ret)
868 goto out0; 872 goto out0;
869 } 873 }