aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sbus
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-08-06 11:25:50 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-08-06 11:25:50 -0400
commit2dc11581376829303b98eadb2de253bee065a56a (patch)
treedbce62559c822cd720d1819a50c488bfecdfa945 /drivers/sbus
parentfc1caf6eafb30ea185720e29f7f5eccca61ecd60 (diff)
of/device: Replace struct of_device with struct platform_device
of_device is just an alias for platform_device, so remove it entirely. Also replace to_of_device() with to_platform_device() and update comment blocks. This patch was initially generated from the following semantic patch, and then edited by hand to pick up the bits that coccinelle didn't catch. @@ @@ -struct of_device +struct platform_device Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Reviewed-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/sbus')
-rw-r--r--drivers/sbus/char/bbc_envctrl.c6
-rw-r--r--drivers/sbus/char/bbc_i2c.c18
-rw-r--r--drivers/sbus/char/bbc_i2c.h10
-rw-r--r--drivers/sbus/char/display7seg.c4
-rw-r--r--drivers/sbus/char/envctrl.c4
-rw-r--r--drivers/sbus/char/flash.c4
-rw-r--r--drivers/sbus/char/uctrl.c4
7 files changed, 25 insertions, 25 deletions
diff --git a/drivers/sbus/char/bbc_envctrl.c b/drivers/sbus/char/bbc_envctrl.c
index 103fdf6b0b89..160e7510aca6 100644
--- a/drivers/sbus/char/bbc_envctrl.c
+++ b/drivers/sbus/char/bbc_envctrl.c
@@ -443,7 +443,7 @@ static int kenvctrld(void *__unused)
443 return 0; 443 return 0;
444} 444}
445 445
446static void attach_one_temp(struct bbc_i2c_bus *bp, struct of_device *op, 446static void attach_one_temp(struct bbc_i2c_bus *bp, struct platform_device *op,
447 int temp_idx) 447 int temp_idx)
448{ 448{
449 struct bbc_cpu_temperature *tp; 449 struct bbc_cpu_temperature *tp;
@@ -488,7 +488,7 @@ static void attach_one_temp(struct bbc_i2c_bus *bp, struct of_device *op,
488 tp->fan_todo[FAN_CPU] = FAN_SAME; 488 tp->fan_todo[FAN_CPU] = FAN_SAME;
489} 489}
490 490
491static void attach_one_fan(struct bbc_i2c_bus *bp, struct of_device *op, 491static void attach_one_fan(struct bbc_i2c_bus *bp, struct platform_device *op,
492 int fan_idx) 492 int fan_idx)
493{ 493{
494 struct bbc_fan_control *fp; 494 struct bbc_fan_control *fp;
@@ -559,7 +559,7 @@ static void destroy_all_fans(struct bbc_i2c_bus *bp)
559 559
560int bbc_envctrl_init(struct bbc_i2c_bus *bp) 560int bbc_envctrl_init(struct bbc_i2c_bus *bp)
561{ 561{
562 struct of_device *op; 562 struct platform_device *op;
563 int temp_index = 0; 563 int temp_index = 0;
564 int fan_index = 0; 564 int fan_index = 0;
565 int devidx = 0; 565 int devidx = 0;
diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c
index 3e89c313e98d..614a5e114a19 100644
--- a/drivers/sbus/char/bbc_i2c.c
+++ b/drivers/sbus/char/bbc_i2c.c
@@ -51,7 +51,7 @@
51 * The second controller also connects to the smartcard reader, if present. 51 * The second controller also connects to the smartcard reader, if present.
52 */ 52 */
53 53
54static void set_device_claimage(struct bbc_i2c_bus *bp, struct of_device *op, int val) 54static void set_device_claimage(struct bbc_i2c_bus *bp, struct platform_device *op, int val)
55{ 55{
56 int i; 56 int i;
57 57
@@ -66,9 +66,9 @@ static void set_device_claimage(struct bbc_i2c_bus *bp, struct of_device *op, in
66#define claim_device(BP,ECHILD) set_device_claimage(BP,ECHILD,1) 66#define claim_device(BP,ECHILD) set_device_claimage(BP,ECHILD,1)
67#define release_device(BP,ECHILD) set_device_claimage(BP,ECHILD,0) 67#define release_device(BP,ECHILD) set_device_claimage(BP,ECHILD,0)
68 68
69struct of_device *bbc_i2c_getdev(struct bbc_i2c_bus *bp, int index) 69struct platform_device *bbc_i2c_getdev(struct bbc_i2c_bus *bp, int index)
70{ 70{
71 struct of_device *op = NULL; 71 struct platform_device *op = NULL;
72 int curidx = 0, i; 72 int curidx = 0, i;
73 73
74 for (i = 0; i < NUM_CHILDREN; i++) { 74 for (i = 0; i < NUM_CHILDREN; i++) {
@@ -86,7 +86,7 @@ out:
86 return NULL; 86 return NULL;
87} 87}
88 88
89struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct of_device *op) 89struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct platform_device *op)
90{ 90{
91 struct bbc_i2c_client *client; 91 struct bbc_i2c_client *client;
92 const u32 *reg; 92 const u32 *reg;
@@ -114,7 +114,7 @@ struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct of_device *
114void bbc_i2c_detach(struct bbc_i2c_client *client) 114void bbc_i2c_detach(struct bbc_i2c_client *client)
115{ 115{
116 struct bbc_i2c_bus *bp = client->bp; 116 struct bbc_i2c_bus *bp = client->bp;
117 struct of_device *op = client->op; 117 struct platform_device *op = client->op;
118 118
119 release_device(bp, op); 119 release_device(bp, op);
120 kfree(client); 120 kfree(client);
@@ -297,7 +297,7 @@ static void __init reset_one_i2c(struct bbc_i2c_bus *bp)
297 writeb(I2C_PCF_IDLE, bp->i2c_control_regs + 0x0); 297 writeb(I2C_PCF_IDLE, bp->i2c_control_regs + 0x0);
298} 298}
299 299
300static struct bbc_i2c_bus * __init attach_one_i2c(struct of_device *op, int index) 300static struct bbc_i2c_bus * __init attach_one_i2c(struct platform_device *op, int index)
301{ 301{
302 struct bbc_i2c_bus *bp; 302 struct bbc_i2c_bus *bp;
303 struct device_node *dp; 303 struct device_node *dp;
@@ -330,7 +330,7 @@ static struct bbc_i2c_bus * __init attach_one_i2c(struct of_device *op, int inde
330 for (dp = op->dev.of_node->child; 330 for (dp = op->dev.of_node->child;
331 dp && entry < 8; 331 dp && entry < 8;
332 dp = dp->sibling, entry++) { 332 dp = dp->sibling, entry++) {
333 struct of_device *child_op; 333 struct platform_device *child_op;
334 334
335 child_op = of_find_device_by_node(dp); 335 child_op = of_find_device_by_node(dp);
336 bp->devs[entry].device = child_op; 336 bp->devs[entry].device = child_op;
@@ -361,7 +361,7 @@ fail:
361extern int bbc_envctrl_init(struct bbc_i2c_bus *bp); 361extern int bbc_envctrl_init(struct bbc_i2c_bus *bp);
362extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp); 362extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp);
363 363
364static int __devinit bbc_i2c_probe(struct of_device *op, 364static int __devinit bbc_i2c_probe(struct platform_device *op,
365 const struct of_device_id *match) 365 const struct of_device_id *match)
366{ 366{
367 struct bbc_i2c_bus *bp; 367 struct bbc_i2c_bus *bp;
@@ -386,7 +386,7 @@ static int __devinit bbc_i2c_probe(struct of_device *op,
386 return err; 386 return err;
387} 387}
388 388
389static int __devexit bbc_i2c_remove(struct of_device *op) 389static int __devexit bbc_i2c_remove(struct platform_device *op)
390{ 390{
391 struct bbc_i2c_bus *bp = dev_get_drvdata(&op->dev); 391 struct bbc_i2c_bus *bp = dev_get_drvdata(&op->dev);
392 392
diff --git a/drivers/sbus/char/bbc_i2c.h b/drivers/sbus/char/bbc_i2c.h
index 83c4811b7b5e..4b4531066e75 100644
--- a/drivers/sbus/char/bbc_i2c.h
+++ b/drivers/sbus/char/bbc_i2c.h
@@ -7,7 +7,7 @@
7 7
8struct bbc_i2c_client { 8struct bbc_i2c_client {
9 struct bbc_i2c_bus *bp; 9 struct bbc_i2c_bus *bp;
10 struct of_device *op; 10 struct platform_device *op;
11 int bus; 11 int bus;
12 int address; 12 int address;
13}; 13};
@@ -64,16 +64,16 @@ struct bbc_i2c_bus {
64 struct list_head temps; 64 struct list_head temps;
65 struct list_head fans; 65 struct list_head fans;
66 66
67 struct of_device *op; 67 struct platform_device *op;
68 struct { 68 struct {
69 struct of_device *device; 69 struct platform_device *device;
70 int client_claimed; 70 int client_claimed;
71 } devs[NUM_CHILDREN]; 71 } devs[NUM_CHILDREN];
72}; 72};
73 73
74/* Probing and attachment. */ 74/* Probing and attachment. */
75extern struct of_device *bbc_i2c_getdev(struct bbc_i2c_bus *, int); 75extern struct platform_device *bbc_i2c_getdev(struct bbc_i2c_bus *, int);
76extern struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct of_device *); 76extern struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct platform_device *);
77extern void bbc_i2c_detach(struct bbc_i2c_client *); 77extern void bbc_i2c_detach(struct bbc_i2c_client *);
78 78
79/* Register read/write. NOTE: Blocking! */ 79/* Register read/write. NOTE: Blocking! */
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c
index 47db97583ea7..1690e53fb84a 100644
--- a/drivers/sbus/char/display7seg.c
+++ b/drivers/sbus/char/display7seg.c
@@ -170,7 +170,7 @@ static struct miscdevice d7s_miscdev = {
170 .fops = &d7s_fops 170 .fops = &d7s_fops
171}; 171};
172 172
173static int __devinit d7s_probe(struct of_device *op, 173static int __devinit d7s_probe(struct platform_device *op,
174 const struct of_device_id *match) 174 const struct of_device_id *match)
175{ 175{
176 struct device_node *opts; 176 struct device_node *opts;
@@ -236,7 +236,7 @@ out_free:
236 goto out; 236 goto out;
237} 237}
238 238
239static int __devexit d7s_remove(struct of_device *op) 239static int __devexit d7s_remove(struct platform_device *op)
240{ 240{
241 struct d7s *p = dev_get_drvdata(&op->dev); 241 struct d7s *p = dev_get_drvdata(&op->dev);
242 u8 regs = readb(p->regs); 242 u8 regs = readb(p->regs);
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c
index 3c27f45e2b6d..078e5f4520ef 100644
--- a/drivers/sbus/char/envctrl.c
+++ b/drivers/sbus/char/envctrl.c
@@ -1027,7 +1027,7 @@ static int kenvctrld(void *__unused)
1027 return 0; 1027 return 0;
1028} 1028}
1029 1029
1030static int __devinit envctrl_probe(struct of_device *op, 1030static int __devinit envctrl_probe(struct platform_device *op,
1031 const struct of_device_id *match) 1031 const struct of_device_id *match)
1032{ 1032{
1033 struct device_node *dp; 1033 struct device_node *dp;
@@ -1104,7 +1104,7 @@ out_iounmap:
1104 return err; 1104 return err;
1105} 1105}
1106 1106
1107static int __devexit envctrl_remove(struct of_device *op) 1107static int __devexit envctrl_remove(struct platform_device *op)
1108{ 1108{
1109 int index; 1109 int index;
1110 1110
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c
index 8bb31c584b64..2b4b4b613c48 100644
--- a/drivers/sbus/char/flash.c
+++ b/drivers/sbus/char/flash.c
@@ -160,7 +160,7 @@ static const struct file_operations flash_fops = {
160 160
161static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops }; 161static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops };
162 162
163static int __devinit flash_probe(struct of_device *op, 163static int __devinit flash_probe(struct platform_device *op,
164 const struct of_device_id *match) 164 const struct of_device_id *match)
165{ 165{
166 struct device_node *dp = op->dev.of_node; 166 struct device_node *dp = op->dev.of_node;
@@ -192,7 +192,7 @@ static int __devinit flash_probe(struct of_device *op,
192 return misc_register(&flash_dev); 192 return misc_register(&flash_dev);
193} 193}
194 194
195static int __devexit flash_remove(struct of_device *op) 195static int __devexit flash_remove(struct platform_device *op)
196{ 196{
197 misc_deregister(&flash_dev); 197 misc_deregister(&flash_dev);
198 198
diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c
index 41eb6725ff5f..1b345be5cc02 100644
--- a/drivers/sbus/char/uctrl.c
+++ b/drivers/sbus/char/uctrl.c
@@ -348,7 +348,7 @@ static void uctrl_get_external_status(struct uctrl_driver *driver)
348 348
349} 349}
350 350
351static int __devinit uctrl_probe(struct of_device *op, 351static int __devinit uctrl_probe(struct platform_device *op,
352 const struct of_device_id *match) 352 const struct of_device_id *match)
353{ 353{
354 struct uctrl_driver *p; 354 struct uctrl_driver *p;
@@ -404,7 +404,7 @@ out_free:
404 goto out; 404 goto out;
405} 405}
406 406
407static int __devexit uctrl_remove(struct of_device *op) 407static int __devexit uctrl_remove(struct platform_device *op)
408{ 408{
409 struct uctrl_driver *p = dev_get_drvdata(&op->dev); 409 struct uctrl_driver *p = dev_get_drvdata(&op->dev);
410 410