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 #endif 78 }; 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 - }; 90 91 /* s3c24xx_i2c_is2440() 92 * ··· 89 struct platform_device *pdev = to_platform_device(i2c->dev); 90 91 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 } 109 110 /* s3c24xx_i2c_master_complete ··· 623 624 static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, unsigned int *got) 625 { 626 - struct s3c2410_platform_i2c *pdata; 627 unsigned long clkin = clk_get_rate(i2c->clk); 628 unsigned int divs, div1; 629 u32 iiccon; ··· 631 int start, end; 632 633 i2c->clkrate = clkin; 634 - 635 - pdata = s3c24xx_i2c_get_platformdata(i2c->adap.dev.parent); 636 clkin /= 1000; /* clkin now in KHz */ 637 638 dev_dbg(i2c->dev, "pdata %p, freq %lu %lu..%lu\n", ··· 751 752 /* get the plafrom data */ 753 754 - pdata = s3c24xx_i2c_get_platformdata(i2c->dev); 755 756 /* inititalise the gpio */ 757 ··· 802 struct resource *res; 803 int ret; 804 805 - pdata = s3c24xx_i2c_get_platformdata(&pdev->dev); 806 807 /* find the clock and enable it */ 808
··· 77 #endif 78 }; 79 80 + /* default platform data removed, dev should always carry data. */ 81 82 /* s3c24xx_i2c_is2440() 83 * ··· 98 struct platform_device *pdev = to_platform_device(i2c->dev); 99 100 return !strcmp(pdev->name, "s3c2440-i2c"); 101 } 102 103 /* s3c24xx_i2c_master_complete ··· 648 649 static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, unsigned int *got) 650 { 651 + struct s3c2410_platform_i2c *pdata = i2c->dev->platform_data; 652 unsigned long clkin = clk_get_rate(i2c->clk); 653 unsigned int divs, div1; 654 u32 iiccon; ··· 656 int start, end; 657 658 i2c->clkrate = clkin; 659 clkin /= 1000; /* clkin now in KHz */ 660 661 dev_dbg(i2c->dev, "pdata %p, freq %lu %lu..%lu\n", ··· 778 779 /* get the plafrom data */ 780 781 + pdata = i2c->dev->platform_data; 782 783 /* inititalise the gpio */ 784 ··· 829 struct resource *res; 830 int ret; 831 832 + pdata = pdev->dev.platform_data; 833 + if (!pdata) { 834 + dev_err(&pdev->dev, "no platform data\n"); 835 + return -EINVAL; 836 + } 837 838 /* find the clock and enable it */ 839