mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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 <[email protected]> Reviewed-by: David S. Miller <[email protected]>
This commit is contained in:
parent
fc1caf6eaf
commit
2dc1158137
158 changed files with 519 additions and 527 deletions
|
|
@ -15,7 +15,7 @@ field##_show (struct device *dev, struct device_attribute *attr, \
|
|||
static ssize_t
|
||||
compatible_show (struct device *dev, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct of_device *of;
|
||||
struct platform_device *of;
|
||||
const char *compat;
|
||||
int cplen;
|
||||
int length = 0;
|
||||
|
|
@ -52,9 +52,9 @@ static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
|
|||
static ssize_t devspec_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct of_device *ofdev;
|
||||
struct platform_device *ofdev;
|
||||
|
||||
ofdev = to_of_device(dev);
|
||||
ofdev = to_platform_device(dev);
|
||||
return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ struct smu_cmd_buf {
|
|||
struct smu_device {
|
||||
spinlock_t lock;
|
||||
struct device_node *of_node;
|
||||
struct of_device *of_dev;
|
||||
struct platform_device *of_dev;
|
||||
int doorbell; /* doorbell gpio */
|
||||
u32 __iomem *db_buf; /* doorbell buffer */
|
||||
struct device_node *db_node;
|
||||
|
|
@ -645,7 +645,7 @@ static void smu_expose_childs(struct work_struct *unused)
|
|||
|
||||
static DECLARE_WORK(smu_expose_childs_work, smu_expose_childs);
|
||||
|
||||
static int smu_platform_probe(struct of_device* dev,
|
||||
static int smu_platform_probe(struct platform_device* dev,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
if (!smu)
|
||||
|
|
@ -695,7 +695,7 @@ static int __init smu_init_sysfs(void)
|
|||
|
||||
device_initcall(smu_init_sysfs);
|
||||
|
||||
struct of_device *smu_get_ofdev(void)
|
||||
struct platform_device *smu_get_ofdev(void)
|
||||
{
|
||||
if (!smu)
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ struct thermostat {
|
|||
|
||||
static enum {ADT7460, ADT7467} therm_type;
|
||||
static int therm_bus, therm_address;
|
||||
static struct of_device * of_dev;
|
||||
static struct platform_device * of_dev;
|
||||
static struct thermostat* thermostat;
|
||||
static struct task_struct *thread_therm = NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@
|
|||
* Driver statics
|
||||
*/
|
||||
|
||||
static struct of_device * of_dev;
|
||||
static struct platform_device * of_dev;
|
||||
static struct i2c_adapter * u3_0;
|
||||
static struct i2c_adapter * u3_1;
|
||||
static struct i2c_adapter * k2;
|
||||
|
|
@ -2210,7 +2210,7 @@ static void fcu_lookup_fans(struct device_node *fcu_node)
|
|||
}
|
||||
}
|
||||
|
||||
static int fcu_of_probe(struct of_device* dev, const struct of_device_id *match)
|
||||
static int fcu_of_probe(struct platform_device* dev, const struct of_device_id *match)
|
||||
{
|
||||
state = state_detached;
|
||||
|
||||
|
|
@ -2221,7 +2221,7 @@ static int fcu_of_probe(struct of_device* dev, const struct of_device_id *match)
|
|||
return i2c_add_driver(&therm_pm72_driver);
|
||||
}
|
||||
|
||||
static int fcu_of_remove(struct of_device* dev)
|
||||
static int fcu_of_remove(struct platform_device* dev)
|
||||
{
|
||||
i2c_del_driver(&therm_pm72_driver);
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ static struct {
|
|||
struct task_struct *poll_task;
|
||||
|
||||
struct mutex lock;
|
||||
struct of_device *of_dev;
|
||||
struct platform_device *of_dev;
|
||||
|
||||
struct i2c_client *thermostat;
|
||||
struct i2c_client *fan;
|
||||
|
|
@ -444,13 +444,13 @@ static struct i2c_driver g4fan_driver = {
|
|||
/************************************************************************/
|
||||
|
||||
static int
|
||||
therm_of_probe( struct of_device *dev, const struct of_device_id *match )
|
||||
therm_of_probe( struct platform_device *dev, const struct of_device_id *match )
|
||||
{
|
||||
return i2c_add_driver( &g4fan_driver );
|
||||
}
|
||||
|
||||
static int
|
||||
therm_of_remove( struct of_device *dev )
|
||||
therm_of_remove( struct platform_device *dev )
|
||||
{
|
||||
i2c_del_driver( &g4fan_driver );
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue