aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/platform/atom/punit_atom_debug.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/arch/x86/platform/atom/punit_atom_debug.c b/arch/x86/platform/atom/punit_atom_debug.c
index d49d3be81953..034813d4ab1e 100644
--- a/arch/x86/platform/atom/punit_atom_debug.c
+++ b/arch/x86/platform/atom/punit_atom_debug.c
@@ -109,18 +109,7 @@ static int punit_dev_state_show(struct seq_file *seq_file, void *unused)
109 109
110 return 0; 110 return 0;
111} 111}
112 112DEFINE_SHOW_ATTRIBUTE(punit_dev_state);
113static int punit_dev_state_open(struct inode *inode, struct file *file)
114{
115 return single_open(file, punit_dev_state_show, inode->i_private);
116}
117
118static const struct file_operations punit_dev_state_ops = {
119 .open = punit_dev_state_open,
120 .read = seq_read,
121 .llseek = seq_lseek,
122 .release = single_release,
123};
124 113
125static struct dentry *punit_dbg_file; 114static struct dentry *punit_dbg_file;
126 115
@@ -132,9 +121,9 @@ static int punit_dbgfs_register(struct punit_device *punit_device)
132 if (!punit_dbg_file) 121 if (!punit_dbg_file)
133 return -ENXIO; 122 return -ENXIO;
134 123
135 dev_state = debugfs_create_file("dev_power_state", S_IFREG | S_IRUGO, 124 dev_state = debugfs_create_file("dev_power_state", 0444,
136 punit_dbg_file, punit_device, 125 punit_dbg_file, punit_device,
137 &punit_dev_state_ops); 126 &punit_dev_state_fops);
138 if (!dev_state) { 127 if (!dev_state) {
139 pr_err("punit_dev_state register failed\n"); 128 pr_err("punit_dev_state register failed\n");
140 debugfs_remove(punit_dbg_file); 129 debugfs_remove(punit_dbg_file);