Linux 3.15-rc1
[linux/fpc-iii.git] / arch / avr32 / boards / merisc / merisc_sysfs.c
blob5a252318f4bd42301bfa0508b8dea1c0fbd62d1a
1 /*
2 * Merisc sysfs exports
4 * Copyright (C) 2008 Martinsson Elektronik AB
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10 #include <linux/module.h>
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/list.h>
14 #include <linux/spinlock.h>
15 #include <linux/device.h>
16 #include <linux/timer.h>
17 #include <linux/err.h>
18 #include <linux/ctype.h>
19 #include "merisc.h"
21 static ssize_t merisc_model_show(struct class *class, char *buf)
23 ssize_t ret = 0;
25 sprintf(buf, "%s\n", merisc_model());
26 ret = strlen(buf) + 1;
28 return ret;
31 static ssize_t merisc_revision_show(struct class *class, char *buf)
33 ssize_t ret = 0;
35 sprintf(buf, "%s\n", merisc_revision());
36 ret = strlen(buf) + 1;
38 return ret;
41 static struct class_attribute merisc_class_attrs[] = {
42 __ATTR(model, S_IRUGO, merisc_model_show, NULL),
43 __ATTR(revision, S_IRUGO, merisc_revision_show, NULL),
44 __ATTR_NULL,
47 struct class merisc_class = {
48 .name = "merisc",
49 .owner = THIS_MODULE,
50 .class_attrs = merisc_class_attrs,
53 static int __init merisc_sysfs_init(void)
55 int status;
57 status = class_register(&merisc_class);
58 if (status < 0)
59 return status;
61 return 0;
64 postcore_initcall(merisc_sysfs_init);