From patchwork Wed Feb 25 16:02:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 443493 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9802E14008F for ; Thu, 26 Feb 2015 03:17:23 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 6E8161A0427 for ; Thu, 26 Feb 2015 03:17:23 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from pokefinder.org (sauhun.de [89.238.76.85]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 754561A012A for ; Thu, 26 Feb 2015 03:02:56 +1100 (AEDT) Received: from p4fe256bb.dip0.t-ipconnect.de ([79.226.86.187]:42010 helo=localhost) by pokefinder.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1YQeQF-0001xf-4Y; Wed, 25 Feb 2015 17:02:51 +0100 From: Wolfram Sang To: linux-i2c@vger.kernel.org Subject: [RFC V2 10/12] i2c: viperboard: make use of the new infrastructure for quirks Date: Wed, 25 Feb 2015 17:02:01 +0100 Message-Id: <1424880126-15047-11-git-send-email-wsa@the-dreams.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1424880126-15047-1-git-send-email-wsa@the-dreams.de> References: <1424880126-15047-1-git-send-email-wsa@the-dreams.de> Cc: linux-mips@linux-mips.org, Wolfram Sang , linux-kernel@vger.kernel.org, Ludovic Desroches , Yingjoe Chen , Eddie Huang , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Wolfram Sang Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-viperboard.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-viperboard.c b/drivers/i2c/busses/i2c-viperboard.c index 7533fa34d73711..47e88adf2011e1 100644 --- a/drivers/i2c/busses/i2c-viperboard.c +++ b/drivers/i2c/busses/i2c-viperboard.c @@ -288,10 +288,6 @@ static int vprbrd_i2c_xfer(struct i2c_adapter *i2c, struct i2c_msg *msgs, i, pmsg->flags & I2C_M_RD ? "read" : "write", pmsg->flags, pmsg->len, pmsg->addr); - /* msgs longer than 2048 bytes are not supported by adapter */ - if (pmsg->len > 2048) - return -EINVAL; - mutex_lock(&vb->lock); /* directly send the message */ if (pmsg->flags & I2C_M_RD) { @@ -358,6 +354,11 @@ static const struct i2c_algorithm vprbrd_algorithm = { .functionality = vprbrd_i2c_func, }; +static struct i2c_adapter_quirks vprbrd_quirks = { + .max_read_len = 2048, + .max_write_len = 2048, +}; + static int vprbrd_i2c_probe(struct platform_device *pdev) { struct vprbrd *vb = dev_get_drvdata(pdev->dev.parent); @@ -373,6 +374,7 @@ static int vprbrd_i2c_probe(struct platform_device *pdev) vb_i2c->i2c.owner = THIS_MODULE; vb_i2c->i2c.class = I2C_CLASS_HWMON; vb_i2c->i2c.algo = &vprbrd_algorithm; + vb_i2c->i2c.quirks = &vprbrd_quirks; vb_i2c->i2c.algo_data = vb; /* save the param in usb capabable memory */ vb_i2c->bus_freq_param = i2c_bus_param;