diff options
author | Tony Jones <tonyj@suse.de> | 2008-02-21 18:13:36 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-19 22:10:30 -0400 |
commit | f4e91eb4a81559da87a3843758a641b5cc590b65 (patch) | |
tree | 534335821d076764cbc072586b19c4b061710e3d /drivers/infiniband/hw/nes | |
parent | c4c66cf1787d408066fbfc69209185701f5df15f (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/nes')
-rw-r--r-- | drivers/infiniband/hw/nes/nes_verbs.c | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c index 7c27420c2240..f9a5d4390892 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c | |||
@@ -2800,10 +2800,11 @@ static int nes_dereg_mr(struct ib_mr *ib_mr) | |||
2800 | /** | 2800 | /** |
2801 | * show_rev | 2801 | * show_rev |
2802 | */ | 2802 | */ |
2803 | static ssize_t show_rev(struct class_device *cdev, char *buf) | 2803 | static ssize_t show_rev(struct device *dev, struct device_attribute *attr, |
2804 | char *buf) | ||
2804 | { | 2805 | { |
2805 | struct nes_ib_device *nesibdev = | 2806 | struct nes_ib_device *nesibdev = |
2806 | container_of(cdev, struct nes_ib_device, ibdev.class_dev); | 2807 | container_of(dev, struct nes_ib_device, ibdev.dev); |
2807 | struct nes_vnic *nesvnic = nesibdev->nesvnic; | 2808 | struct nes_vnic *nesvnic = nesibdev->nesvnic; |
2808 | 2809 | ||
2809 | nes_debug(NES_DBG_INIT, "\n"); | 2810 | nes_debug(NES_DBG_INIT, "\n"); |
@@ -2814,10 +2815,11 @@ static ssize_t show_rev(struct class_device *cdev, char *buf) | |||
2814 | /** | 2815 | /** |
2815 | * show_fw_ver | 2816 | * show_fw_ver |
2816 | */ | 2817 | */ |
2817 | static ssize_t show_fw_ver(struct class_device *cdev, char *buf) | 2818 | static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr, |
2819 | char *buf) | ||
2818 | { | 2820 | { |
2819 | struct nes_ib_device *nesibdev = | 2821 | struct nes_ib_device *nesibdev = |
2820 | container_of(cdev, struct nes_ib_device, ibdev.class_dev); | 2822 | container_of(dev, struct nes_ib_device, ibdev.dev); |
2821 | struct nes_vnic *nesvnic = nesibdev->nesvnic; | 2823 | struct nes_vnic *nesvnic = nesibdev->nesvnic; |
2822 | 2824 | ||
2823 | nes_debug(NES_DBG_INIT, "\n"); | 2825 | nes_debug(NES_DBG_INIT, "\n"); |
@@ -2831,7 +2833,8 @@ static ssize_t show_fw_ver(struct class_device *cdev, char *buf) | |||
2831 | /** | 2833 | /** |
2832 | * show_hca | 2834 | * show_hca |
2833 | */ | 2835 | */ |
2834 | static ssize_t show_hca(struct class_device *cdev, char *buf) | 2836 | static ssize_t show_hca(struct device *dev, struct device_attribute *attr, |
2837 | char *buf) | ||
2835 | { | 2838 | { |
2836 | nes_debug(NES_DBG_INIT, "\n"); | 2839 | nes_debug(NES_DBG_INIT, "\n"); |
2837 | return sprintf(buf, "NES020\n"); | 2840 | return sprintf(buf, "NES020\n"); |
@@ -2841,23 +2844,24 @@ static ssize_t show_hca(struct class_device *cdev, char *buf) | |||
2841 | /** | 2844 | /** |
2842 | * show_board | 2845 | * show_board |
2843 | */ | 2846 | */ |
2844 | static ssize_t show_board(struct class_device *cdev, char *buf) | 2847 | static ssize_t show_board(struct device *dev, struct device_attribute *attr, |
2848 | char *buf) | ||
2845 | { | 2849 | { |
2846 | nes_debug(NES_DBG_INIT, "\n"); | 2850 | nes_debug(NES_DBG_INIT, "\n"); |
2847 | return sprintf(buf, "%.*s\n", 32, "NES020 Board ID"); | 2851 | return sprintf(buf, "%.*s\n", 32, "NES020 Board ID"); |
2848 | } | 2852 | } |
2849 | 2853 | ||
2850 | 2854 | ||
2851 | static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL); | 2855 | static DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL); |
2852 | static CLASS_DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL); | 2856 | static DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL); |
2853 | static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL); | 2857 | static DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL); |
2854 | static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL); | 2858 | static DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL); |
2855 | 2859 | ||
2856 | static struct class_device_attribute *nes_class_attributes[] = { | 2860 | static struct device_attribute *nes_dev_attributes[] = { |
2857 | &class_device_attr_hw_rev, | 2861 | &dev_attr_hw_rev, |
2858 | &class_device_attr_fw_ver, | 2862 | &dev_attr_fw_ver, |
2859 | &class_device_attr_hca_type, | 2863 | &dev_attr_hca_type, |
2860 | &class_device_attr_board_id | 2864 | &dev_attr_board_id |
2861 | }; | 2865 | }; |
2862 | 2866 | ||
2863 | 2867 | ||
@@ -3782,7 +3786,7 @@ struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev) | |||
3782 | nesibdev->ibdev.phys_port_cnt = 1; | 3786 | nesibdev->ibdev.phys_port_cnt = 1; |
3783 | nesibdev->ibdev.num_comp_vectors = 1; | 3787 | nesibdev->ibdev.num_comp_vectors = 1; |
3784 | nesibdev->ibdev.dma_device = &nesdev->pcidev->dev; | 3788 | nesibdev->ibdev.dma_device = &nesdev->pcidev->dev; |
3785 | nesibdev->ibdev.class_dev.dev = &nesdev->pcidev->dev; | 3789 | nesibdev->ibdev.dev.parent = &nesdev->pcidev->dev; |
3786 | nesibdev->ibdev.query_device = nes_query_device; | 3790 | nesibdev->ibdev.query_device = nes_query_device; |
3787 | nesibdev->ibdev.query_port = nes_query_port; | 3791 | nesibdev->ibdev.query_port = nes_query_port; |
3788 | nesibdev->ibdev.modify_port = nes_modify_port; | 3792 | nesibdev->ibdev.modify_port = nes_modify_port; |
@@ -3877,13 +3881,13 @@ int nes_register_ofa_device(struct nes_ib_device *nesibdev) | |||
3877 | nesibdev->max_qp = (nesadapter->max_qp-NES_FIRST_QPN) / nesadapter->port_count; | 3881 | nesibdev->max_qp = (nesadapter->max_qp-NES_FIRST_QPN) / nesadapter->port_count; |
3878 | nesibdev->max_pd = nesadapter->max_pd / nesadapter->port_count; | 3882 | nesibdev->max_pd = nesadapter->max_pd / nesadapter->port_count; |
3879 | 3883 | ||
3880 | for (i = 0; i < ARRAY_SIZE(nes_class_attributes); ++i) { | 3884 | for (i = 0; i < ARRAY_SIZE(nes_dev_attributes); ++i) { |
3881 | ret = class_device_create_file(&nesibdev->ibdev.class_dev, nes_class_attributes[i]); | 3885 | ret = device_create_file(&nesibdev->ibdev.dev, nes_dev_attributes[i]); |
3882 | if (ret) { | 3886 | if (ret) { |
3883 | while (i > 0) { | 3887 | while (i > 0) { |
3884 | i--; | 3888 | i--; |
3885 | class_device_remove_file(&nesibdev->ibdev.class_dev, | 3889 | device_remove_file(&nesibdev->ibdev.dev, |
3886 | nes_class_attributes[i]); | 3890 | nes_dev_attributes[i]); |
3887 | } | 3891 | } |
3888 | ib_unregister_device(&nesibdev->ibdev); | 3892 | ib_unregister_device(&nesibdev->ibdev); |
3889 | return ret; | 3893 | return ret; |
@@ -3904,8 +3908,8 @@ static void nes_unregister_ofa_device(struct nes_ib_device *nesibdev) | |||
3904 | struct nes_vnic *nesvnic = nesibdev->nesvnic; | 3908 | struct nes_vnic *nesvnic = nesibdev->nesvnic; |
3905 | int i; | 3909 | int i; |
3906 | 3910 | ||
3907 | for (i = 0; i < ARRAY_SIZE(nes_class_attributes); ++i) { | 3911 | for (i = 0; i < ARRAY_SIZE(nes_dev_attributes); ++i) { |
3908 | class_device_remove_file(&nesibdev->ibdev.class_dev, nes_class_attributes[i]); | 3912 | device_remove_file(&nesibdev->ibdev.dev, nes_dev_attributes[i]); |
3909 | } | 3913 | } |
3910 | 3914 | ||
3911 | if (nesvnic->of_device_registered) { | 3915 | if (nesvnic->of_device_registered) { |