projects
/
GitHub
/
mt8127
/
android_kernel_alcatel_ttab.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[DRIVER MODEL] Convert platform drivers to use struct platform_driver
[GitHub/mt8127/android_kernel_alcatel_ttab.git]
/
drivers
/
i2c
/
busses
/
i2c-mv64xxx.c
diff --git
a/drivers/i2c/busses/i2c-mv64xxx.c
b/drivers/i2c/busses/i2c-mv64xxx.c
index d0d2a6f1386e03dcd5ea64ec9e83ca2b4d2dfc55..afd7634e5cc9f1bf68a2ae358f689cad2c55fd09 100644
(file)
--- a/
drivers/i2c/busses/i2c-mv64xxx.c
+++ b/
drivers/i2c/busses/i2c-mv64xxx.c
@@
-17,6
+17,8
@@
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/mv643xx.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/mv643xx.h>
+#include <linux/platform_device.h>
+
#include <asm/io.h>
/* Register defines */
#include <asm/io.h>
/* Register defines */
@@
-490,11
+492,10
@@
mv64xxx_i2c_unmap_regs(struct mv64xxx_i2c_data *drv_data)
}
static int __devinit
}
static int __devinit
-mv64xxx_i2c_probe(struct
device *dev
)
+mv64xxx_i2c_probe(struct
platform_device *pd
)
{
{
- struct platform_device *pd = to_platform_device(dev);
struct mv64xxx_i2c_data *drv_data;
struct mv64xxx_i2c_data *drv_data;
- struct mv64xxx_i2c_pdata *pdata =
dev->
platform_data;
+ struct mv64xxx_i2c_pdata *pdata =
pd->dev.
platform_data;
int rc;
if ((pd->id != 0) || !pdata)
int rc;
if ((pd->id != 0) || !pdata)
@@
-524,7
+525,7
@@
mv64xxx_i2c_probe(struct device *dev)
drv_data->adapter.class = I2C_CLASS_HWMON;
drv_data->adapter.timeout = pdata->timeout;
drv_data->adapter.retries = pdata->retries;
drv_data->adapter.class = I2C_CLASS_HWMON;
drv_data->adapter.timeout = pdata->timeout;
drv_data->adapter.retries = pdata->retries;
-
dev_set_drvdata(dev
, drv_data);
+
platform_set_drvdata(pd
, drv_data);
i2c_set_adapdata(&drv_data->adapter, drv_data);
if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0,
i2c_set_adapdata(&drv_data->adapter, drv_data);
if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0,
@@
-553,9
+554,9
@@
mv64xxx_i2c_probe(struct device *dev)
}
static int __devexit
}
static int __devexit
-mv64xxx_i2c_remove(struct device *dev)
+mv64xxx_i2c_remove(struct
platform_
device *dev)
{
{
- struct mv64xxx_i2c_data *drv_data =
dev
_get_drvdata(dev);
+ struct mv64xxx_i2c_data *drv_data =
platform
_get_drvdata(dev);
int rc;
rc = i2c_del_adapter(&drv_data->adapter);
int rc;
rc = i2c_del_adapter(&drv_data->adapter);
@@
-566,24
+567,25
@@
mv64xxx_i2c_remove(struct device *dev)
return rc;
}
return rc;
}
-static struct device_driver mv64xxx_i2c_driver = {
- .owner = THIS_MODULE,
- .name = MV64XXX_I2C_CTLR_NAME,
- .bus = &platform_bus_type,
+static struct platform_driver mv64xxx_i2c_driver = {
.probe = mv64xxx_i2c_probe,
.remove = mv64xxx_i2c_remove,
.probe = mv64xxx_i2c_probe,
.remove = mv64xxx_i2c_remove,
+ .driver = {
+ .owner = THIS_MODULE,
+ .name = MV64XXX_I2C_CTLR_NAME,
+ },
};
static int __init
mv64xxx_i2c_init(void)
{
};
static int __init
mv64xxx_i2c_init(void)
{
- return driver_register(&mv64xxx_i2c_driver);
+ return
platform_
driver_register(&mv64xxx_i2c_driver);
}
static void __exit
mv64xxx_i2c_exit(void)
{
}
static void __exit
mv64xxx_i2c_exit(void)
{
- driver_unregister(&mv64xxx_i2c_driver);
+
platform_
driver_unregister(&mv64xxx_i2c_driver);
}
module_init(mv64xxx_i2c_init);
}
module_init(mv64xxx_i2c_init);