aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/misc/hdpuftrs/hdpu_cpustate.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/misc/hdpuftrs/hdpu_cpustate.c b/drivers/misc/hdpuftrs/hdpu_cpustate.c
index 7501fab349e4..46de5c940555 100644
--- a/drivers/misc/hdpuftrs/hdpu_cpustate.c
+++ b/drivers/misc/hdpuftrs/hdpu_cpustate.c
@@ -192,22 +192,37 @@ static int hdpu_cpustate_probe(struct device *ddev)
192{ 192{
193 struct platform_device *pdev = to_platform_device(ddev); 193 struct platform_device *pdev = to_platform_device(ddev);
194 struct resource *res; 194 struct resource *res;
195 struct proc_dir_entry *proc_de;
196 int ret;
195 197
196 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 198 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
197 cpustate.set_addr = (unsigned long *)res->start; 199 cpustate.set_addr = (unsigned long *)res->start;
198 cpustate.clr_addr = (unsigned long *)res->end - 1; 200 cpustate.clr_addr = (unsigned long *)res->end - 1;
199 201
200 misc_register(&cpustate_dev); 202 ret = misc_register(&cpustate_dev);
201 create_proc_read_entry("sky_cpustate", 0, 0, cpustate_read_proc, NULL); 203 if (ret) {
204 printk(KERN_WARNING "sky_cpustate: Unable to register misc "
205 "device.\n");
206 cpustate.set_addr = NULL;
207 cpustate.clr_addr = NULL;
208 return ret;
209 }
210
211 proc_de = create_proc_read_entry("sky_cpustate", 0, 0,
212 cpustate_read_proc, NULL);
213 if (proc_de == NULL)
214 printk(KERN_WARNING "sky_cpustate: Unable to create proc "
215 "dir entry\n");
202 216
203 printk(KERN_INFO "Sky CPU State Driver v" SKY_CPUSTATE_VERSION "\n"); 217 printk(KERN_INFO "Sky CPU State Driver v" SKY_CPUSTATE_VERSION "\n");
204 return 0; 218 return 0;
205} 219}
220
206static int hdpu_cpustate_remove(struct device *ddev) 221static int hdpu_cpustate_remove(struct device *ddev)
207{ 222{
208 223
209 cpustate.set_addr = 0; 224 cpustate.set_addr = NULL;
210 cpustate.clr_addr = 0; 225 cpustate.clr_addr = NULL;
211 226
212 remove_proc_entry("sky_cpustate", NULL); 227 remove_proc_entry("sky_cpustate", NULL);
213 misc_deregister(&cpustate_dev); 228 misc_deregister(&cpustate_dev);