Skip to content

Commit 567b21e

Browse files
committed
mips: convert vpe_class to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups should be used instead. This converts the MIPS vpe_class code to use the correct field. Cc: Ralf Baechle <ralf@linux-mips.org> Cc: John Crispin <blogic@openwrt.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent cebcac7 commit 567b21e

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

arch/mips/kernel/vpe.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,16 +1335,17 @@ static ssize_t store_kill(struct device *dev, struct device_attribute *attr,
13351335

13361336
return len;
13371337
}
1338+
static DEVICE_ATTR(kill, S_IWUSR, NULL, store_kill);
13381339

1339-
static ssize_t show_ntcs(struct device *cd, struct device_attribute *attr,
1340+
static ssize_t ntcs_show(struct device *cd, struct device_attribute *attr,
13401341
char *buf)
13411342
{
13421343
struct vpe *vpe = get_vpe(tclimit);
13431344

13441345
return sprintf(buf, "%d\n", vpe->ntcs);
13451346
}
13461347

1347-
static ssize_t store_ntcs(struct device *dev, struct device_attribute *attr,
1348+
static ssize_t ntcs_store(struct device *dev, struct device_attribute *attr,
13481349
const char *buf, size_t len)
13491350
{
13501351
struct vpe *vpe = get_vpe(tclimit);
@@ -1365,12 +1366,14 @@ static ssize_t store_ntcs(struct device *dev, struct device_attribute *attr,
13651366
out_einval:
13661367
return -EINVAL;
13671368
}
1369+
static DEVICE_ATTR_RW(ntcs);
13681370

1369-
static struct device_attribute vpe_class_attributes[] = {
1370-
__ATTR(kill, S_IWUSR, NULL, store_kill),
1371-
__ATTR(ntcs, S_IRUGO | S_IWUSR, show_ntcs, store_ntcs),
1372-
{}
1371+
static struct attribute vpe_attrs[] = {
1372+
&dev_attr_kill.attr,
1373+
&dev_attr_ntcs.attr,
1374+
NULL,
13731375
};
1376+
ATTRIBUTE_GROUPS(vpe);
13741377

13751378
static void vpe_device_release(struct device *cd)
13761379
{
@@ -1381,7 +1384,7 @@ struct class vpe_class = {
13811384
.name = "vpe",
13821385
.owner = THIS_MODULE,
13831386
.dev_release = vpe_device_release,
1384-
.dev_attrs = vpe_class_attributes,
1387+
.dev_groups = vpe_groups,
13851388
};
13861389

13871390
struct device vpe_device;

0 commit comments

Comments
 (0)