i2c-s3c2410: Remove default platform data.

The platform data should now always be present when the device
is initialised, so we can remove the default platform data in
the driver.

All the device initialisation points in the board specific code
should already have been changed to initialise this as necessary.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>

Ben Dooks 6a039cab 8be310a6

+8 -31
+8 -31
drivers/i2c/busses/i2c-s3c2410.c
··· 77 77 #endif 78 78 }; 79 79 80 - /* default platform data to use if not supplied in the platform_device 81 - */ 82 - 83 - static struct s3c2410_platform_i2c s3c24xx_i2c_default_platform = { 84 - .flags = 0, 85 - .slave_addr = 0x10, 86 - .bus_freq = 100*1000, 87 - .max_freq = 400*1000, 88 - .sda_delay = S3C2410_IICLC_SDA_DELAY5 | S3C2410_IICLC_FILTER_ON, 89 - }; 80 + /* default platform data removed, dev should always carry data. */ 90 81 91 82 /* s3c24xx_i2c_is2440() 92 83 * ··· 89 98 struct platform_device *pdev = to_platform_device(i2c->dev); 90 99 91 100 return !strcmp(pdev->name, "s3c2440-i2c"); 92 - } 93 - 94 - 95 - /* s3c24xx_i2c_get_platformdata 96 - * 97 - * get the platform data associated with the given device, or return 98 - * the default if there is none 99 - */ 100 - 101 - static inline struct s3c2410_platform_i2c * 102 - s3c24xx_i2c_get_platformdata(struct device *dev) 103 - { 104 - if (dev->platform_data != NULL) 105 - return (struct s3c2410_platform_i2c *)dev->platform_data; 106 - 107 - return &s3c24xx_i2c_default_platform; 108 101 } 109 102 110 103 /* s3c24xx_i2c_master_complete ··· 623 648 624 649 static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, unsigned int *got) 625 650 { 626 - struct s3c2410_platform_i2c *pdata; 651 + struct s3c2410_platform_i2c *pdata = i2c->dev->platform_data; 627 652 unsigned long clkin = clk_get_rate(i2c->clk); 628 653 unsigned int divs, div1; 629 654 u32 iiccon; ··· 631 656 int start, end; 632 657 633 658 i2c->clkrate = clkin; 634 - 635 - pdata = s3c24xx_i2c_get_platformdata(i2c->adap.dev.parent); 636 659 clkin /= 1000; /* clkin now in KHz */ 637 660 638 661 dev_dbg(i2c->dev, "pdata %p, freq %lu %lu..%lu\n", ··· 751 778 752 779 /* get the plafrom data */ 753 780 754 - pdata = s3c24xx_i2c_get_platformdata(i2c->dev); 781 + pdata = i2c->dev->platform_data; 755 782 756 783 /* inititalise the gpio */ 757 784 ··· 802 829 struct resource *res; 803 830 int ret; 804 831 805 - pdata = s3c24xx_i2c_get_platformdata(&pdev->dev); 832 + pdata = pdev->dev.platform_data; 833 + if (!pdata) { 834 + dev_err(&pdev->dev, "no platform data\n"); 835 + return -EINVAL; 836 + } 806 837 807 838 /* find the clock and enable it */ 808 839