linux-mips
[Top] [All Lists]

[RFC V2 07/12] i2c: axxia: make use of the new infrastructure for quirks

To: linux-i2c@vger.kernel.org
Subject: [RFC V2 07/12] i2c: axxia: make use of the new infrastructure for quirks
From: Wolfram Sang <wsa@the-dreams.de>
Date: Wed, 25 Feb 2015 17:01:58 +0100
Cc: linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mips@linux-mips.org, Benjamin Herrenschmidt <benh@kernel.crashing.org>, Ludovic Desroches <ludovic.desroches@atmel.com>, Yingjoe Chen <yingjoe.chen@mediatek.com>, Eddie Huang <eddie.huang@mediatek.com>, Wolfram Sang <wsa@the-dreams.de>, linux-kernel@vger.kernel.org
In-reply-to: <1424880126-15047-1-git-send-email-wsa@the-dreams.de>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1424880126-15047-1-git-send-email-wsa@the-dreams.de>
Sender: linux-mips-bounce@linux-mips.org
From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/busses/i2c-axxia.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index 768a598d8d03ad..488c5d3bf9dba7 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -336,11 +336,6 @@ static int axxia_i2c_xfer_msg(struct axxia_i2c_dev *idev, 
struct i2c_msg *msg)
        u32 addr_1, addr_2;
        int ret;
 
-       if (msg->len > 255) {
-               dev_warn(idev->dev, "unsupported length %u\n", msg->len);
-               return -EINVAL;
-       }
-
        idev->msg = msg;
        idev->msg_xfrd = 0;
        idev->msg_err = 0;
@@ -454,6 +449,11 @@ static const struct i2c_algorithm axxia_i2c_algo = {
        .functionality = axxia_i2c_func,
 };
 
+static struct i2c_adapter_quirks axxia_i2c_quirks = {
+       .max_read_len = 255,
+       .max_write_len = 255,
+};
+
 static int axxia_i2c_probe(struct platform_device *pdev)
 {
        struct device_node *np = pdev->dev.of_node;
@@ -511,6 +511,7 @@ static int axxia_i2c_probe(struct platform_device *pdev)
        strlcpy(idev->adapter.name, pdev->name, sizeof(idev->adapter.name));
        idev->adapter.owner = THIS_MODULE;
        idev->adapter.algo = &axxia_i2c_algo;
+       idev->adapter.quirks = &axxia_i2c_quirks;
        idev->adapter.dev.parent = &pdev->dev;
        idev->adapter.dev.of_node = pdev->dev.of_node;
 
-- 
2.1.4


<Prev in Thread] Current Thread [Next in Thread>