aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-10-15 07:42:35 -0400
committerRalf Baechle <ralf@linux-mips.org>2007-10-16 13:23:49 -0400
commit736fad17b89e5e718908abb76ae9bce210a9d5d4 (patch)
tree23e34c0001795b7a54db4328cc30ba088e37622f /arch/mips
parent2f7055c5932ecc02159be375ebda1eee64665d17 (diff)
[MIPS] VPE loader: convert from struct class_ device to struct device
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/kernel/vpe.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 61b729fa0548..df8cbe4c7c0d 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -1317,7 +1317,8 @@ static void kspd_sp_exit( int sp_id)
1317} 1317}
1318#endif 1318#endif
1319 1319
1320static ssize_t store_kill(struct class_device *dev, const char *buf, size_t len) 1320static ssize_t store_kill(struct device *dev, struct device_attribute *attr,
1321 const char *buf, size_t len)
1321{ 1322{
1322 struct vpe *vpe = get_vpe(tclimit); 1323 struct vpe *vpe = get_vpe(tclimit);
1323 struct vpe_notifications *not; 1324 struct vpe_notifications *not;
@@ -1334,14 +1335,16 @@ static ssize_t store_kill(struct class_device *dev, const char *buf, size_t len)
1334 return len; 1335 return len;
1335} 1336}
1336 1337
1337static ssize_t show_ntcs(struct class_device *cd, char *buf) 1338static ssize_t show_ntcs(struct device *cd, struct device_attribute *attr,
1339 char *buf)
1338{ 1340{
1339 struct vpe *vpe = get_vpe(tclimit); 1341 struct vpe *vpe = get_vpe(tclimit);
1340 1342
1341 return sprintf(buf, "%d\n", vpe->ntcs); 1343 return sprintf(buf, "%d\n", vpe->ntcs);
1342} 1344}
1343 1345
1344static ssize_t store_ntcs(struct class_device *dev, const char *buf, size_t len) 1346static ssize_t store_ntcs(struct device *dev, struct device_attribute *attr,
1347 const char *buf, size_t len)
1345{ 1348{
1346 struct vpe *vpe = get_vpe(tclimit); 1349 struct vpe *vpe = get_vpe(tclimit);
1347 unsigned long new; 1350 unsigned long new;
@@ -1362,13 +1365,13 @@ out_einval:
1362 return -EINVAL;; 1365 return -EINVAL;;
1363} 1366}
1364 1367
1365static struct class_device_attribute vpe_class_attributes[] = { 1368static struct device_attribute vpe_class_attributes[] = {
1366 __ATTR(kill, S_IWUSR, NULL, store_kill), 1369 __ATTR(kill, S_IWUSR, NULL, store_kill),
1367 __ATTR(ntcs, S_IRUGO | S_IWUSR, show_ntcs, store_ntcs), 1370 __ATTR(ntcs, S_IRUGO | S_IWUSR, show_ntcs, store_ntcs),
1368 {} 1371 {}
1369}; 1372};
1370 1373
1371static void vpe_class_device_release(struct class_device *cd) 1374static void vpe_device_release(struct device *cd)
1372{ 1375{
1373 kfree(cd); 1376 kfree(cd);
1374} 1377}
@@ -1376,11 +1379,11 @@ static void vpe_class_device_release(struct class_device *cd)
1376struct class vpe_class = { 1379struct class vpe_class = {
1377 .name = "vpe", 1380 .name = "vpe",
1378 .owner = THIS_MODULE, 1381 .owner = THIS_MODULE,
1379 .release = vpe_class_device_release, 1382 .dev_release = vpe_device_release,
1380 .class_dev_attrs = vpe_class_attributes, 1383 .dev_attrs = vpe_class_attributes,
1381}; 1384};
1382 1385
1383struct class_device vpe_device; 1386struct device vpe_device;
1384 1387
1385static int __init vpe_module_init(void) 1388static int __init vpe_module_init(void)
1386{ 1389{
@@ -1423,12 +1426,12 @@ static int __init vpe_module_init(void)
1423 goto out_chrdev; 1426 goto out_chrdev;
1424 } 1427 }
1425 1428
1426 class_device_initialize(&vpe_device); 1429 device_initialize(&vpe_device);
1427 vpe_device.class = &vpe_class, 1430 vpe_device.class = &vpe_class,
1428 vpe_device.parent = NULL, 1431 vpe_device.parent = NULL,
1429 strlcpy(vpe_device.class_id, "vpe1", BUS_ID_SIZE); 1432 strlcpy(vpe_device.bus_id, "vpe1", BUS_ID_SIZE);
1430 vpe_device.devt = MKDEV(major, minor); 1433 vpe_device.devt = MKDEV(major, minor);
1431 err = class_device_add(&vpe_device); 1434 err = device_add(&vpe_device);
1432 if (err) { 1435 if (err) {
1433 printk(KERN_ERR "Adding vpe_device failed\n"); 1436 printk(KERN_ERR "Adding vpe_device failed\n");
1434 goto out_class; 1437 goto out_class;
@@ -1573,7 +1576,7 @@ static void __exit vpe_module_exit(void)
1573 } 1576 }
1574 } 1577 }
1575 1578
1576 class_device_del(&vpe_device); 1579 device_del(&vpe_device);
1577 unregister_chrdev(major, module_name); 1580 unregister_chrdev(major, module_name);
1578} 1581}
1579 1582