From patchwork Tue Feb 1 22:40:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Igor M. Liplianin" X-Patchwork-Id: 524281 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p11MehVt013519 for ; Tue, 1 Feb 2011 22:41:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751461Ab1BAWlD (ORCPT ); Tue, 1 Feb 2011 17:41:03 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:38207 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751221Ab1BAWlC (ORCPT ); Tue, 1 Feb 2011 17:41:02 -0500 Received: by mail-fx0-f46.google.com with SMTP id 20so7348272fxm.19 for ; Tue, 01 Feb 2011 14:41:01 -0800 (PST) Received: by 10.223.98.198 with SMTP id r6mr7979223fan.42.1296600061403; Tue, 01 Feb 2011 14:41:01 -0800 (PST) Received: from useri.localnet ([93.125.74.3]) by mx.google.com with ESMTPS id z1sm8116673fau.45.2011.02.01.14.41.00 (version=SSLv3 cipher=RC4-MD5); Tue, 01 Feb 2011 14:41:00 -0800 (PST) Subject: [PATCH 3/9 v2] ds3000: loading firmware in bigger chunks To: mchehab@infradead.org, linux-media@vger.kernel.org From: "Igor M. Liplianin" Date: Wed, 2 Feb 2011 00:40:25 +0200 MIME-Version: 1.0 Message-Id: <201102020040.25705.liplianin@me.by> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 01 Feb 2011 22:41:18 +0000 (UTC) diff --git a/drivers/media/dvb/frontends/ds3000.c b/drivers/media/dvb/frontends/ds3000.c index b20005c..02ba759 100644 --- a/drivers/media/dvb/frontends/ds3000.c +++ b/drivers/media/dvb/frontends/ds3000.c @@ -305,7 +305,7 @@ static int ds3000_writeFW(struct ds3000_state *state, int reg, struct i2c_msg msg; u8 *buf; - buf = kmalloc(3, GFP_KERNEL); + buf = kmalloc(33, GFP_KERNEL); if (buf == NULL) { printk(KERN_ERR "Unable to kmalloc\n"); ret = -ENOMEM; @@ -317,10 +317,10 @@ static int ds3000_writeFW(struct ds3000_state *state, int reg, msg.addr = state->config->demod_address; msg.flags = 0; msg.buf = buf; - msg.len = 3; + msg.len = 33; - for (i = 0; i < len; i += 2) { - memcpy(buf + 1, data + i, 2); + for (i = 0; i < len; i += 32) { + memcpy(buf + 1, data + i, 32); dprintk("%s: write reg 0x%02x, len = %d\n", __func__, reg, len);