i2c-axxia.c (a4721ced760684d1776bf31f7925aa41bb3f4846) i2c-axxia.c (e0442d76213981ab48e8ea0874bb6c47e3af5a36)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * This driver implements I2C master functionality using the LSI API2C
4 * controller.
5 *
6 * NOTE: The controller has a limitation in that it can only do transfers of
7 * maximum 255 bytes at a time. If a larger transfer is attempted, error code
8 * (-EINVAL) is returned.

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

729 .max_read_len = 255,
730 .max_write_len = 255,
731};
732
733static int axxia_i2c_probe(struct platform_device *pdev)
734{
735 struct device_node *np = pdev->dev.of_node;
736 struct axxia_i2c_dev *idev = NULL;
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * This driver implements I2C master functionality using the LSI API2C
4 * controller.
5 *
6 * NOTE: The controller has a limitation in that it can only do transfers of
7 * maximum 255 bytes at a time. If a larger transfer is attempted, error code
8 * (-EINVAL) is returned.

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

729 .max_read_len = 255,
730 .max_write_len = 255,
731};
732
733static int axxia_i2c_probe(struct platform_device *pdev)
734{
735 struct device_node *np = pdev->dev.of_node;
736 struct axxia_i2c_dev *idev = NULL;
737 struct resource *res;
738 void __iomem *base;
739 int ret = 0;
740
741 idev = devm_kzalloc(&pdev->dev, sizeof(*idev), GFP_KERNEL);
742 if (!idev)
743 return -ENOMEM;
744
737 void __iomem *base;
738 int ret = 0;
739
740 idev = devm_kzalloc(&pdev->dev, sizeof(*idev), GFP_KERNEL);
741 if (!idev)
742 return -ENOMEM;
743
745 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
746 base = devm_ioremap_resource(&pdev->dev, res);
744 base = devm_platform_ioremap_resource(pdev, 0);
747 if (IS_ERR(base))
748 return PTR_ERR(base);
749
750 idev->irq = platform_get_irq(pdev, 0);
751 if (idev->irq < 0) {
752 dev_err(&pdev->dev, "missing interrupt resource\n");
753 return idev->irq;
754 }

--- 88 unchanged lines hidden ---
745 if (IS_ERR(base))
746 return PTR_ERR(base);
747
748 idev->irq = platform_get_irq(pdev, 0);
749 if (idev->irq < 0) {
750 dev_err(&pdev->dev, "missing interrupt resource\n");
751 return idev->irq;
752 }

--- 88 unchanged lines hidden ---