X-Git-Url: https://git.stricted.de/?a=blobdiff_plain;f=drivers%2Fi2c%2Fbusses%2Fi2c-iop3xx.c;h=1414851a17b8ee1ea13df7124060dec12522055b;hb=3ae5eaec1d2d9c0cf53745352e7d4b152810ba24;hp=cfae4ad00faee2bb6ca81b1ed34a7c71f1c66126;hpb=dad2ad82c5f058367df79de022bd12d36afcd065;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c index cfae4ad00fae..1414851a17b8 100644 --- a/drivers/i2c/busses/i2c-iop3xx.c +++ b/drivers/i2c/busses/i2c-iop3xx.c @@ -405,10 +405,9 @@ static struct i2c_algorithm iop3xx_i2c_algo = { }; static int -iop3xx_i2c_remove(struct device *device) +iop3xx_i2c_remove(struct platform_device *pdev) { - struct platform_device *pdev = to_platform_device(device); - struct i2c_adapter *padapter = dev_get_drvdata(&pdev->dev); + struct i2c_adapter *padapter = platform_get_drvdata(pdev); struct i2c_algo_iop3xx_data *adapter_data = (struct i2c_algo_iop3xx_data *)padapter->algo_data; struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -426,15 +425,14 @@ iop3xx_i2c_remove(struct device *device) kfree(adapter_data); kfree(padapter); - dev_set_drvdata(&pdev->dev, NULL); + platform_set_drvdata(pdev, NULL); return 0; } static int -iop3xx_i2c_probe(struct device *dev) +iop3xx_i2c_probe(struct platform_device *pdev) { - struct platform_device *pdev = to_platform_device(dev); struct resource *res; int ret; struct i2c_adapter *new_adapter; @@ -499,7 +497,7 @@ iop3xx_i2c_probe(struct device *dev) iop3xx_i2c_set_slave_addr(adapter_data); iop3xx_i2c_enable(adapter_data); - dev_set_drvdata(&pdev->dev, new_adapter); + platform_set_drvdata(pdev, new_adapter); new_adapter->algo_data = adapter_data; i2c_add_adapter(new_adapter); @@ -523,24 +521,25 @@ out: } -static struct device_driver iop3xx_i2c_driver = { - .owner = THIS_MODULE, - .name = "IOP3xx-I2C", - .bus = &platform_bus_type, +static struct platform_driver iop3xx_i2c_driver = { .probe = iop3xx_i2c_probe, - .remove = iop3xx_i2c_remove + .remove = iop3xx_i2c_remove, + .driver = { + .owner = THIS_MODULE, + .name = "IOP3xx-I2C", + }, }; static int __init i2c_iop3xx_init (void) { - return driver_register(&iop3xx_i2c_driver); + return platform_driver_register(&iop3xx_i2c_driver); } static void __exit i2c_iop3xx_exit (void) { - driver_unregister(&iop3xx_i2c_driver); + platform_driver_unregister(&iop3xx_i2c_driver); return; }