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>
此提交包含在:
@@ -443,7 +443,7 @@ static int kenvctrld(void *__unused)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void attach_one_temp(struct bbc_i2c_bus *bp, struct of_device *op,
|
||||
static void attach_one_temp(struct bbc_i2c_bus *bp, struct platform_device *op,
|
||||
int temp_idx)
|
||||
{
|
||||
struct bbc_cpu_temperature *tp;
|
||||
@@ -488,7 +488,7 @@ static void attach_one_temp(struct bbc_i2c_bus *bp, struct of_device *op,
|
||||
tp->fan_todo[FAN_CPU] = FAN_SAME;
|
||||
}
|
||||
|
||||
static void attach_one_fan(struct bbc_i2c_bus *bp, struct of_device *op,
|
||||
static void attach_one_fan(struct bbc_i2c_bus *bp, struct platform_device *op,
|
||||
int fan_idx)
|
||||
{
|
||||
struct bbc_fan_control *fp;
|
||||
@@ -559,7 +559,7 @@ static void destroy_all_fans(struct bbc_i2c_bus *bp)
|
||||
|
||||
int bbc_envctrl_init(struct bbc_i2c_bus *bp)
|
||||
{
|
||||
struct of_device *op;
|
||||
struct platform_device *op;
|
||||
int temp_index = 0;
|
||||
int fan_index = 0;
|
||||
int devidx = 0;
|
||||
|
@@ -51,7 +51,7 @@
|
||||
* The second controller also connects to the smartcard reader, if present.
|
||||
*/
|
||||
|
||||
static void set_device_claimage(struct bbc_i2c_bus *bp, struct of_device *op, int val)
|
||||
static void set_device_claimage(struct bbc_i2c_bus *bp, struct platform_device *op, int val)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -66,9 +66,9 @@ static void set_device_claimage(struct bbc_i2c_bus *bp, struct of_device *op, in
|
||||
#define claim_device(BP,ECHILD) set_device_claimage(BP,ECHILD,1)
|
||||
#define release_device(BP,ECHILD) set_device_claimage(BP,ECHILD,0)
|
||||
|
||||
struct of_device *bbc_i2c_getdev(struct bbc_i2c_bus *bp, int index)
|
||||
struct platform_device *bbc_i2c_getdev(struct bbc_i2c_bus *bp, int index)
|
||||
{
|
||||
struct of_device *op = NULL;
|
||||
struct platform_device *op = NULL;
|
||||
int curidx = 0, i;
|
||||
|
||||
for (i = 0; i < NUM_CHILDREN; i++) {
|
||||
@@ -86,7 +86,7 @@ out:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct of_device *op)
|
||||
struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct platform_device *op)
|
||||
{
|
||||
struct bbc_i2c_client *client;
|
||||
const u32 *reg;
|
||||
@@ -114,7 +114,7 @@ struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct of_device *
|
||||
void bbc_i2c_detach(struct bbc_i2c_client *client)
|
||||
{
|
||||
struct bbc_i2c_bus *bp = client->bp;
|
||||
struct of_device *op = client->op;
|
||||
struct platform_device *op = client->op;
|
||||
|
||||
release_device(bp, op);
|
||||
kfree(client);
|
||||
@@ -297,7 +297,7 @@ static void __init reset_one_i2c(struct bbc_i2c_bus *bp)
|
||||
writeb(I2C_PCF_IDLE, bp->i2c_control_regs + 0x0);
|
||||
}
|
||||
|
||||
static struct bbc_i2c_bus * __init attach_one_i2c(struct of_device *op, int index)
|
||||
static struct bbc_i2c_bus * __init attach_one_i2c(struct platform_device *op, int index)
|
||||
{
|
||||
struct bbc_i2c_bus *bp;
|
||||
struct device_node *dp;
|
||||
@@ -330,7 +330,7 @@ static struct bbc_i2c_bus * __init attach_one_i2c(struct of_device *op, int inde
|
||||
for (dp = op->dev.of_node->child;
|
||||
dp && entry < 8;
|
||||
dp = dp->sibling, entry++) {
|
||||
struct of_device *child_op;
|
||||
struct platform_device *child_op;
|
||||
|
||||
child_op = of_find_device_by_node(dp);
|
||||
bp->devs[entry].device = child_op;
|
||||
@@ -361,7 +361,7 @@ fail:
|
||||
extern int bbc_envctrl_init(struct bbc_i2c_bus *bp);
|
||||
extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp);
|
||||
|
||||
static int __devinit bbc_i2c_probe(struct of_device *op,
|
||||
static int __devinit bbc_i2c_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct bbc_i2c_bus *bp;
|
||||
@@ -386,7 +386,7 @@ static int __devinit bbc_i2c_probe(struct of_device *op,
|
||||
return err;
|
||||
}
|
||||
|
||||
static int __devexit bbc_i2c_remove(struct of_device *op)
|
||||
static int __devexit bbc_i2c_remove(struct platform_device *op)
|
||||
{
|
||||
struct bbc_i2c_bus *bp = dev_get_drvdata(&op->dev);
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
struct bbc_i2c_client {
|
||||
struct bbc_i2c_bus *bp;
|
||||
struct of_device *op;
|
||||
struct platform_device *op;
|
||||
int bus;
|
||||
int address;
|
||||
};
|
||||
@@ -64,16 +64,16 @@ struct bbc_i2c_bus {
|
||||
struct list_head temps;
|
||||
struct list_head fans;
|
||||
|
||||
struct of_device *op;
|
||||
struct platform_device *op;
|
||||
struct {
|
||||
struct of_device *device;
|
||||
struct platform_device *device;
|
||||
int client_claimed;
|
||||
} devs[NUM_CHILDREN];
|
||||
};
|
||||
|
||||
/* Probing and attachment. */
|
||||
extern struct of_device *bbc_i2c_getdev(struct bbc_i2c_bus *, int);
|
||||
extern struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct of_device *);
|
||||
extern struct platform_device *bbc_i2c_getdev(struct bbc_i2c_bus *, int);
|
||||
extern struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct platform_device *);
|
||||
extern void bbc_i2c_detach(struct bbc_i2c_client *);
|
||||
|
||||
/* Register read/write. NOTE: Blocking! */
|
||||
|
@@ -170,7 +170,7 @@ static struct miscdevice d7s_miscdev = {
|
||||
.fops = &d7s_fops
|
||||
};
|
||||
|
||||
static int __devinit d7s_probe(struct of_device *op,
|
||||
static int __devinit d7s_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *opts;
|
||||
@@ -236,7 +236,7 @@ out_free:
|
||||
goto out;
|
||||
}
|
||||
|
||||
static int __devexit d7s_remove(struct of_device *op)
|
||||
static int __devexit d7s_remove(struct platform_device *op)
|
||||
{
|
||||
struct d7s *p = dev_get_drvdata(&op->dev);
|
||||
u8 regs = readb(p->regs);
|
||||
|
@@ -1027,7 +1027,7 @@ static int kenvctrld(void *__unused)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __devinit envctrl_probe(struct of_device *op,
|
||||
static int __devinit envctrl_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *dp;
|
||||
@@ -1104,7 +1104,7 @@ out_iounmap:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int __devexit envctrl_remove(struct of_device *op)
|
||||
static int __devexit envctrl_remove(struct platform_device *op)
|
||||
{
|
||||
int index;
|
||||
|
||||
|
@@ -160,7 +160,7 @@ static const struct file_operations flash_fops = {
|
||||
|
||||
static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops };
|
||||
|
||||
static int __devinit flash_probe(struct of_device *op,
|
||||
static int __devinit flash_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
@@ -192,7 +192,7 @@ static int __devinit flash_probe(struct of_device *op,
|
||||
return misc_register(&flash_dev);
|
||||
}
|
||||
|
||||
static int __devexit flash_remove(struct of_device *op)
|
||||
static int __devexit flash_remove(struct platform_device *op)
|
||||
{
|
||||
misc_deregister(&flash_dev);
|
||||
|
||||
|
@@ -348,7 +348,7 @@ static void uctrl_get_external_status(struct uctrl_driver *driver)
|
||||
|
||||
}
|
||||
|
||||
static int __devinit uctrl_probe(struct of_device *op,
|
||||
static int __devinit uctrl_probe(struct platform_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct uctrl_driver *p;
|
||||
@@ -404,7 +404,7 @@ out_free:
|
||||
goto out;
|
||||
}
|
||||
|
||||
static int __devexit uctrl_remove(struct of_device *op)
|
||||
static int __devexit uctrl_remove(struct platform_device *op)
|
||||
{
|
||||
struct uctrl_driver *p = dev_get_drvdata(&op->dev);
|
||||
|
||||
|
新增問題並參考
封鎖使用者