i2c-mv64xxx.c (a4721ced760684d1776bf31f7925aa41bb3f4846) i2c-mv64xxx.c (e0442d76213981ab48e8ea0874bb6c47e3af5a36)
1/*
2 * Driver for the i2c controller on the Marvell line of host bridges
3 * (e.g, gt642[46]0, mv643[46]0, mv644[46]0, and Orion SoC family).
4 *
5 * Author: Mark A. Greer <mgreer@mvista.com>
6 *
7 * 2005 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program

--- 863 unchanged lines hidden (view full) ---

872}
873#endif /* CONFIG_OF */
874
875static int
876mv64xxx_i2c_probe(struct platform_device *pd)
877{
878 struct mv64xxx_i2c_data *drv_data;
879 struct mv64xxx_i2c_pdata *pdata = dev_get_platdata(&pd->dev);
1/*
2 * Driver for the i2c controller on the Marvell line of host bridges
3 * (e.g, gt642[46]0, mv643[46]0, mv644[46]0, and Orion SoC family).
4 *
5 * Author: Mark A. Greer <mgreer@mvista.com>
6 *
7 * 2005 (c) MontaVista, Software, Inc. This file is licensed under
8 * the terms of the GNU General Public License version 2. This program

--- 863 unchanged lines hidden (view full) ---

872}
873#endif /* CONFIG_OF */
874
875static int
876mv64xxx_i2c_probe(struct platform_device *pd)
877{
878 struct mv64xxx_i2c_data *drv_data;
879 struct mv64xxx_i2c_pdata *pdata = dev_get_platdata(&pd->dev);
880 struct resource *r;
881 int rc;
882
883 if ((!pdata && !pd->dev.of_node))
884 return -ENODEV;
885
886 drv_data = devm_kzalloc(&pd->dev, sizeof(struct mv64xxx_i2c_data),
887 GFP_KERNEL);
888 if (!drv_data)
889 return -ENOMEM;
890
880 int rc;
881
882 if ((!pdata && !pd->dev.of_node))
883 return -ENODEV;
884
885 drv_data = devm_kzalloc(&pd->dev, sizeof(struct mv64xxx_i2c_data),
886 GFP_KERNEL);
887 if (!drv_data)
888 return -ENOMEM;
889
891 r = platform_get_resource(pd, IORESOURCE_MEM, 0);
892 drv_data->reg_base = devm_ioremap_resource(&pd->dev, r);
890 drv_data->reg_base = devm_platform_ioremap_resource(pd, 0);
893 if (IS_ERR(drv_data->reg_base))
894 return PTR_ERR(drv_data->reg_base);
895
896 strlcpy(drv_data->adapter.name, MV64XXX_I2C_CTLR_NAME " adapter",
897 sizeof(drv_data->adapter.name));
898
899 init_waitqueue_head(&drv_data->waitq);
900 spin_lock_init(&drv_data->lock);

--- 117 unchanged lines hidden ---
891 if (IS_ERR(drv_data->reg_base))
892 return PTR_ERR(drv_data->reg_base);
893
894 strlcpy(drv_data->adapter.name, MV64XXX_I2C_CTLR_NAME " adapter",
895 sizeof(drv_data->adapter.name));
896
897 init_waitqueue_head(&drv_data->waitq);
898 spin_lock_init(&drv_data->lock);

--- 117 unchanged lines hidden ---