aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2011-09-08 03:09:34 -0400
committerBen Dooks <ben-linux@fluff.org>2011-09-14 17:14:41 -0400
commit593702c71a415b153bd81fbc487394979f3e7a63 (patch)
tree7987f13b6ef65cbd99d3c118e8a1d43a28f3d76a /drivers/i2c
parent9e79e3e9dd9672b37ac9412e9a926714306551fe (diff)
i2c-imx: remove init/exit hooks from platform data
The init/exit hooks in platform data are being used nowhere, so can be removed. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: Darius Augulis <augulis.darius@gmail.com> Cc: Ben Dooks <ben-linux@fluff.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-imx.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 4c2a62b75b5c..54d809ed20be 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -466,7 +466,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
466{ 466{
467 struct imx_i2c_struct *i2c_imx; 467 struct imx_i2c_struct *i2c_imx;
468 struct resource *res; 468 struct resource *res;
469 struct imxi2c_platform_data *pdata; 469 struct imxi2c_platform_data *pdata = pdev->dev.platform_data;
470 void __iomem *base; 470 void __iomem *base;
471 resource_size_t res_size; 471 resource_size_t res_size;
472 int irq; 472 int irq;
@@ -485,19 +485,11 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
485 return -ENOENT; 485 return -ENOENT;
486 } 486 }
487 487
488 pdata = pdev->dev.platform_data;
489
490 if (pdata && pdata->init) {
491 ret = pdata->init(&pdev->dev);
492 if (ret)
493 return ret;
494 }
495
496 res_size = resource_size(res); 488 res_size = resource_size(res);
497 489
498 if (!request_mem_region(res->start, res_size, DRIVER_NAME)) { 490 if (!request_mem_region(res->start, res_size, DRIVER_NAME)) {
499 ret = -EBUSY; 491 dev_err(&pdev->dev, "request_mem_region failed\n");
500 goto fail0; 492 return -EBUSY;
501 } 493 }
502 494
503 base = ioremap(res->start, res_size); 495 base = ioremap(res->start, res_size);
@@ -586,9 +578,6 @@ fail2:
586 iounmap(base); 578 iounmap(base);
587fail1: 579fail1:
588 release_mem_region(res->start, resource_size(res)); 580 release_mem_region(res->start, resource_size(res));
589fail0:
590 if (pdata && pdata->exit)
591 pdata->exit(&pdev->dev);
592 return ret; /* Return error number */ 581 return ret; /* Return error number */
593} 582}
594 583
@@ -611,10 +600,6 @@ static int __exit i2c_imx_remove(struct platform_device *pdev)
611 writeb(0, i2c_imx->base + IMX_I2C_I2CR); 600 writeb(0, i2c_imx->base + IMX_I2C_I2CR);
612 writeb(0, i2c_imx->base + IMX_I2C_I2SR); 601 writeb(0, i2c_imx->base + IMX_I2C_I2SR);
613 602
614 /* Shut down hardware */
615 if (pdata && pdata->exit)
616 pdata->exit(&pdev->dev);
617
618 clk_put(i2c_imx->clk); 603 clk_put(i2c_imx->clk);
619 604
620 iounmap(i2c_imx->base); 605 iounmap(i2c_imx->base);