diff options
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_verbs.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_verbs.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c index 320a6d018de..c38f9aa8be8 100644 --- a/drivers/infiniband/hw/ipath/ipath_verbs.c +++ b/drivers/infiniband/hw/ipath/ipath_verbs.c | |||
@@ -2172,18 +2172,20 @@ void ipath_unregister_ib_device(struct ipath_ibdev *dev) | |||
2172 | ib_dealloc_device(ibdev); | 2172 | ib_dealloc_device(ibdev); |
2173 | } | 2173 | } |
2174 | 2174 | ||
2175 | static ssize_t show_rev(struct class_device *cdev, char *buf) | 2175 | static ssize_t show_rev(struct device *device, struct device_attribute *attr, |
2176 | char *buf) | ||
2176 | { | 2177 | { |
2177 | struct ipath_ibdev *dev = | 2178 | struct ipath_ibdev *dev = |
2178 | container_of(cdev, struct ipath_ibdev, ibdev.class_dev); | 2179 | container_of(device, struct ipath_ibdev, ibdev.dev); |
2179 | 2180 | ||
2180 | return sprintf(buf, "%x\n", dev->dd->ipath_pcirev); | 2181 | return sprintf(buf, "%x\n", dev->dd->ipath_pcirev); |
2181 | } | 2182 | } |
2182 | 2183 | ||
2183 | static ssize_t show_hca(struct class_device *cdev, char *buf) | 2184 | static ssize_t show_hca(struct device *device, struct device_attribute *attr, |
2185 | char *buf) | ||
2184 | { | 2186 | { |
2185 | struct ipath_ibdev *dev = | 2187 | struct ipath_ibdev *dev = |
2186 | container_of(cdev, struct ipath_ibdev, ibdev.class_dev); | 2188 | container_of(device, struct ipath_ibdev, ibdev.dev); |
2187 | int ret; | 2189 | int ret; |
2188 | 2190 | ||
2189 | ret = dev->dd->ipath_f_get_boardname(dev->dd, buf, 128); | 2191 | ret = dev->dd->ipath_f_get_boardname(dev->dd, buf, 128); |
@@ -2196,10 +2198,11 @@ bail: | |||
2196 | return ret; | 2198 | return ret; |
2197 | } | 2199 | } |
2198 | 2200 | ||
2199 | static ssize_t show_stats(struct class_device *cdev, char *buf) | 2201 | static ssize_t show_stats(struct device *device, struct device_attribute *attr, |
2202 | char *buf) | ||
2200 | { | 2203 | { |
2201 | struct ipath_ibdev *dev = | 2204 | struct ipath_ibdev *dev = |
2202 | container_of(cdev, struct ipath_ibdev, ibdev.class_dev); | 2205 | container_of(device, struct ipath_ibdev, ibdev.dev); |
2203 | int i; | 2206 | int i; |
2204 | int len; | 2207 | int len; |
2205 | 2208 | ||
@@ -2237,16 +2240,16 @@ static ssize_t show_stats(struct class_device *cdev, char *buf) | |||
2237 | return len; | 2240 | return len; |
2238 | } | 2241 | } |
2239 | 2242 | ||
2240 | static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL); | 2243 | static DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL); |
2241 | static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL); | 2244 | static DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL); |
2242 | static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_hca, NULL); | 2245 | static DEVICE_ATTR(board_id, S_IRUGO, show_hca, NULL); |
2243 | static CLASS_DEVICE_ATTR(stats, S_IRUGO, show_stats, NULL); | 2246 | static DEVICE_ATTR(stats, S_IRUGO, show_stats, NULL); |
2244 | 2247 | ||
2245 | static struct class_device_attribute *ipath_class_attributes[] = { | 2248 | static struct device_attribute *ipath_class_attributes[] = { |
2246 | &class_device_attr_hw_rev, | 2249 | &dev_attr_hw_rev, |
2247 | &class_device_attr_hca_type, | 2250 | &dev_attr_hca_type, |
2248 | &class_device_attr_board_id, | 2251 | &dev_attr_board_id, |
2249 | &class_device_attr_stats | 2252 | &dev_attr_stats |
2250 | }; | 2253 | }; |
2251 | 2254 | ||
2252 | static int ipath_verbs_register_sysfs(struct ib_device *dev) | 2255 | static int ipath_verbs_register_sysfs(struct ib_device *dev) |
@@ -2255,8 +2258,8 @@ static int ipath_verbs_register_sysfs(struct ib_device *dev) | |||
2255 | int ret; | 2258 | int ret; |
2256 | 2259 | ||
2257 | for (i = 0; i < ARRAY_SIZE(ipath_class_attributes); ++i) | 2260 | for (i = 0; i < ARRAY_SIZE(ipath_class_attributes); ++i) |
2258 | if (class_device_create_file(&dev->class_dev, | 2261 | if (device_create_file(&dev->dev, |
2259 | ipath_class_attributes[i])) { | 2262 | ipath_class_attributes[i])) { |
2260 | ret = 1; | 2263 | ret = 1; |
2261 | goto bail; | 2264 | goto bail; |
2262 | } | 2265 | } |