diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2007-10-02 16:30:05 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-10-02 22:02:43 -0400 |
commit | a4e32b5f0ac60e6bca7c6896f47e1c624ae45df1 (patch) | |
tree | 04ecd93e767acbd6ffc249e4223ef240c8e284c5 /drivers/misc/hdpuftrs | |
parent | 8150caad02266623b5b9f58088d589f130fccd97 (diff) |
[POWERPC] Sky Cpu and Nexus: code style improvement
Remove useless spaces and adds some empty lines to make code more
readable. Also marker for printk is added.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kumar Gala <galak@gate.crashing.org>
Cc: Brian Waite <waite@skycomputers.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/misc/hdpuftrs')
-rw-r--r-- | drivers/misc/hdpuftrs/hdpu_cpustate.c | 38 | ||||
-rw-r--r-- | drivers/misc/hdpuftrs/hdpu_nexus.c | 24 |
2 files changed, 31 insertions, 31 deletions
diff --git a/drivers/misc/hdpuftrs/hdpu_cpustate.c b/drivers/misc/hdpuftrs/hdpu_cpustate.c index 276ba3c5143f..1874b0740f2b 100644 --- a/drivers/misc/hdpuftrs/hdpu_cpustate.c +++ b/drivers/misc/hdpuftrs/hdpu_cpustate.c | |||
@@ -169,22 +169,21 @@ static struct platform_driver hdpu_cpustate_driver = { | |||
169 | * The various file operations we support. | 169 | * The various file operations we support. |
170 | */ | 170 | */ |
171 | static const struct file_operations cpustate_fops = { | 171 | static const struct file_operations cpustate_fops = { |
172 | owner:THIS_MODULE, | 172 | owner: THIS_MODULE, |
173 | open:cpustate_open, | 173 | open: cpustate_open, |
174 | release:cpustate_release, | 174 | release: cpustate_release, |
175 | read:cpustate_read, | 175 | read: cpustate_read, |
176 | write:cpustate_write, | 176 | write: cpustate_write, |
177 | fasync:NULL, | 177 | fasync: NULL, |
178 | poll:NULL, | 178 | poll: NULL, |
179 | ioctl:NULL, | 179 | ioctl: NULL, |
180 | llseek:no_llseek, | 180 | llseek: no_llseek, |
181 | |||
182 | }; | 181 | }; |
183 | 182 | ||
184 | static struct miscdevice cpustate_dev = { | 183 | static struct miscdevice cpustate_dev = { |
185 | MISC_DYNAMIC_MINOR, | 184 | MISC_DYNAMIC_MINOR, |
186 | "sky_cpustate", | 185 | "sky_cpustate", |
187 | &cpustate_fops | 186 | &cpustate_fops, |
188 | }; | 187 | }; |
189 | 188 | ||
190 | static int hdpu_cpustate_probe(struct platform_device *pdev) | 189 | static int hdpu_cpustate_probe(struct platform_device *pdev) |
@@ -199,18 +198,18 @@ static int hdpu_cpustate_probe(struct platform_device *pdev) | |||
199 | 198 | ||
200 | ret = misc_register(&cpustate_dev); | 199 | ret = misc_register(&cpustate_dev); |
201 | if (ret) { | 200 | if (ret) { |
202 | printk(KERN_WARNING "sky_cpustate: Unable to register misc " | 201 | printk(KERN_WARNING "sky_cpustate: " |
203 | "device.\n"); | 202 | "Unable to register misc device.\n"); |
204 | cpustate.set_addr = NULL; | 203 | cpustate.set_addr = NULL; |
205 | cpustate.clr_addr = NULL; | 204 | cpustate.clr_addr = NULL; |
206 | return ret; | 205 | return ret; |
207 | } | 206 | } |
208 | 207 | ||
209 | proc_de = create_proc_read_entry("sky_cpustate", 0, 0, | 208 | proc_de = create_proc_read_entry("sky_cpustate", 0, 0, |
210 | cpustate_read_proc, NULL); | 209 | cpustate_read_proc, NULL); |
211 | if (proc_de == NULL) | 210 | if (proc_de == NULL) |
212 | printk(KERN_WARNING "sky_cpustate: Unable to create proc " | 211 | printk(KERN_WARNING "sky_cpustate: " |
213 | "dir entry\n"); | 212 | "Unable to create proc dir entry\n"); |
214 | 213 | ||
215 | printk(KERN_INFO "Sky CPU State Driver v" SKY_CPUSTATE_VERSION "\n"); | 214 | printk(KERN_INFO "Sky CPU State Driver v" SKY_CPUSTATE_VERSION "\n"); |
216 | return 0; | 215 | return 0; |
@@ -218,21 +217,18 @@ static int hdpu_cpustate_probe(struct platform_device *pdev) | |||
218 | 217 | ||
219 | static int hdpu_cpustate_remove(struct platform_device *pdev) | 218 | static int hdpu_cpustate_remove(struct platform_device *pdev) |
220 | { | 219 | { |
221 | |||
222 | cpustate.set_addr = NULL; | 220 | cpustate.set_addr = NULL; |
223 | cpustate.clr_addr = NULL; | 221 | cpustate.clr_addr = NULL; |
224 | 222 | ||
225 | remove_proc_entry("sky_cpustate", NULL); | 223 | remove_proc_entry("sky_cpustate", NULL); |
226 | misc_deregister(&cpustate_dev); | 224 | misc_deregister(&cpustate_dev); |
227 | return 0; | ||
228 | 225 | ||
226 | return 0; | ||
229 | } | 227 | } |
230 | 228 | ||
231 | static int __init cpustate_init(void) | 229 | static int __init cpustate_init(void) |
232 | { | 230 | { |
233 | int rc; | 231 | return platform_driver_register(&hdpu_cpustate_driver); |
234 | rc = platform_driver_register(&hdpu_cpustate_driver); | ||
235 | return rc; | ||
236 | } | 232 | } |
237 | 233 | ||
238 | static void __exit cpustate_exit(void) | 234 | static void __exit cpustate_exit(void) |
diff --git a/drivers/misc/hdpuftrs/hdpu_nexus.c b/drivers/misc/hdpuftrs/hdpu_nexus.c index 60c8b26f0678..fd3f3c22115f 100644 --- a/drivers/misc/hdpuftrs/hdpu_nexus.c +++ b/drivers/misc/hdpuftrs/hdpu_nexus.c | |||
@@ -40,40 +40,43 @@ static struct platform_driver hdpu_nexus_driver = { | |||
40 | int hdpu_slot_id_read(char *buffer, char **buffer_location, off_t offset, | 40 | int hdpu_slot_id_read(char *buffer, char **buffer_location, off_t offset, |
41 | int buffer_length, int *zero, void *ptr) | 41 | int buffer_length, int *zero, void *ptr) |
42 | { | 42 | { |
43 | |||
44 | if (offset > 0) | 43 | if (offset > 0) |
45 | return 0; | 44 | return 0; |
45 | |||
46 | return sprintf(buffer, "%d\n", slot_id); | 46 | return sprintf(buffer, "%d\n", slot_id); |
47 | } | 47 | } |
48 | 48 | ||
49 | int hdpu_chassis_id_read(char *buffer, char **buffer_location, off_t offset, | 49 | int hdpu_chassis_id_read(char *buffer, char **buffer_location, off_t offset, |
50 | int buffer_length, int *zero, void *ptr) | 50 | int buffer_length, int *zero, void *ptr) |
51 | { | 51 | { |
52 | |||
53 | if (offset > 0) | 52 | if (offset > 0) |
54 | return 0; | 53 | return 0; |
54 | |||
55 | return sprintf(buffer, "%d\n", chassis_id); | 55 | return sprintf(buffer, "%d\n", chassis_id); |
56 | } | 56 | } |
57 | 57 | ||
58 | static int hdpu_nexus_probe(struct platform_device *pdev) | 58 | static int hdpu_nexus_probe(struct platform_device *pdev) |
59 | { | 59 | { |
60 | struct resource *res; | 60 | struct resource *res; |
61 | int *nexus_id_addr; | ||
61 | 62 | ||
62 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 63 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
63 | int *nexus_id_addr; | 64 | nexus_id_addr = ioremap(res->start, |
64 | nexus_id_addr = | 65 | (unsigned long)(res->end - res->start)); |
65 | ioremap(res->start, (unsigned long)(res->end - res->start)); | ||
66 | if (nexus_id_addr) { | 66 | if (nexus_id_addr) { |
67 | slot_id = (*nexus_id_addr >> 8) & 0x1f; | 67 | slot_id = (*nexus_id_addr >> 8) & 0x1f; |
68 | chassis_id = *nexus_id_addr & 0xff; | 68 | chassis_id = *nexus_id_addr & 0xff; |
69 | iounmap(nexus_id_addr); | 69 | iounmap(nexus_id_addr); |
70 | } else | 70 | } else { |
71 | printk("Could not map slot id\n"); | 71 | printk(KERN_ERR "Could not map slot id\n"); |
72 | } | ||
73 | |||
72 | hdpu_slot_id = create_proc_entry("sky_slot_id", 0666, &proc_root); | 74 | hdpu_slot_id = create_proc_entry("sky_slot_id", 0666, &proc_root); |
73 | hdpu_slot_id->read_proc = hdpu_slot_id_read; | 75 | hdpu_slot_id->read_proc = hdpu_slot_id_read; |
74 | 76 | ||
75 | hdpu_chassis_id = create_proc_entry("sky_chassis_id", 0666, &proc_root); | 77 | hdpu_chassis_id = create_proc_entry("sky_chassis_id", 0666, &proc_root); |
76 | hdpu_chassis_id->read_proc = hdpu_chassis_id_read; | 78 | hdpu_chassis_id->read_proc = hdpu_chassis_id_read; |
79 | |||
77 | return 0; | 80 | return 0; |
78 | } | 81 | } |
79 | 82 | ||
@@ -81,18 +84,19 @@ static int hdpu_nexus_remove(struct platform_device *pdev) | |||
81 | { | 84 | { |
82 | slot_id = -1; | 85 | slot_id = -1; |
83 | chassis_id = -1; | 86 | chassis_id = -1; |
87 | |||
84 | remove_proc_entry("sky_slot_id", &proc_root); | 88 | remove_proc_entry("sky_slot_id", &proc_root); |
85 | remove_proc_entry("sky_chassis_id", &proc_root); | 89 | remove_proc_entry("sky_chassis_id", &proc_root); |
90 | |||
86 | hdpu_slot_id = 0; | 91 | hdpu_slot_id = 0; |
87 | hdpu_chassis_id = 0; | 92 | hdpu_chassis_id = 0; |
93 | |||
88 | return 0; | 94 | return 0; |
89 | } | 95 | } |
90 | 96 | ||
91 | static int __init nexus_init(void) | 97 | static int __init nexus_init(void) |
92 | { | 98 | { |
93 | int rc; | 99 | return platform_driver_register(&hdpu_nexus_driver); |
94 | rc = platform_driver_register(&hdpu_nexus_driver); | ||
95 | return rc; | ||
96 | } | 100 | } |
97 | 101 | ||
98 | static void __exit nexus_exit(void) | 102 | static void __exit nexus_exit(void) |