From patchwork Mon Nov 5 11:38:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Toshiaki Yamane X-Patchwork-Id: 1696491 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 4C3043FCDE for ; Mon, 5 Nov 2012 11:39:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753546Ab2KELix (ORCPT ); Mon, 5 Nov 2012 06:38:53 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:46010 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752642Ab2KELiv (ORCPT ); Mon, 5 Nov 2012 06:38:51 -0500 Received: by mail-pb0-f46.google.com with SMTP id rr4so3865134pbb.19 for ; Mon, 05 Nov 2012 03:38:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=N4xXRYckhw+KQGiztp8crLLJRn9X4vXijFZMVj8YV8I=; b=DIhd7d2VYzuiiBM6hYA17qwsbfeNMILLaVmBr3TjduMAu243D9EgTNSticuACozKmO mOwUboL8hTeQu3DtGMPPpqQmKvEGWFktcRBwLyiC1JcPAvL2myF3d6ImeVyiCIju96EK dcKIGxm1dRj737F8WgN2WNpAl9w9cDzNoXIudTWB1rPtiJHKMaYHSAWlTIWWxjojyvV1 vZts8zQWyagmMYD/NR/wBjMdZo1jVcm1SNLy3zYJN7ZKc6S3KGFhXZEC1uOWKyc7I963 nEwva+QJpEwllX44+ZM5svZ2kdviFk/491C7E4YPe/MI0iZ1GdroVBPK2Osa1n0cQrsv NZWw== Received: by 10.66.81.138 with SMTP id a10mr27503014pay.53.1352115531003; Mon, 05 Nov 2012 03:38:51 -0800 (PST) Received: from localhost (softbank220057059032.bbtec.net. [220.57.59.32]) by mx.google.com with ESMTPS id s1sm10538537paz.0.2012.11.05.03.38.48 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Nov 2012 03:38:50 -0800 (PST) From: YAMANE Toshiaki To: Greg Kroah-Hartman , linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, YAMANE Toshiaki Subject: [PATCH 1/2] staging/media: Use dev_ printks in go7007/go7007-fw.c Date: Mon, 5 Nov 2012 20:38:46 +0900 Message-Id: <1352115526-8287-1-git-send-email-yamanetoshi@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org fixed below checkpatch warning. - WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ... - WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... Signed-off-by: YAMANE Toshiaki --- drivers/staging/media/go7007/go7007-fw.c | 42 ++++++++++++++---------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/drivers/staging/media/go7007/go7007-fw.c b/drivers/staging/media/go7007/go7007-fw.c index c9a6409..f99c05b 100644 --- a/drivers/staging/media/go7007/go7007-fw.c +++ b/drivers/staging/media/go7007/go7007-fw.c @@ -382,8 +382,8 @@ static int gen_mjpeghdr_to_package(struct go7007 *go, __le16 *code, int space) buf = kzalloc(4096, GFP_KERNEL); if (buf == NULL) { - printk(KERN_ERR "go7007: unable to allocate 4096 bytes for " - "firmware construction\n"); + dev_err(go->dev, + "unable to allocate 4096 bytes for firmware construction\n"); return -1; } @@ -652,8 +652,8 @@ static int gen_mpeg1hdr_to_package(struct go7007 *go, buf = kzalloc(5120, GFP_KERNEL); if (buf == NULL) { - printk(KERN_ERR "go7007: unable to allocate 5120 bytes for " - "firmware construction\n"); + dev_err(go->dev, + "unable to allocate 5120 bytes for firmware construction\n"); return -1; } framelen[0] = mpeg1_frame_header(go, buf, 0, 1, PFRAME); @@ -839,8 +839,8 @@ static int gen_mpeg4hdr_to_package(struct go7007 *go, buf = kzalloc(5120, GFP_KERNEL); if (buf == NULL) { - printk(KERN_ERR "go7007: unable to allocate 5120 bytes for " - "firmware construction\n"); + dev_err(go->dev, + "unable to allocate 5120 bytes for firmware construction\n"); return -1; } framelen[0] = mpeg4_frame_header(go, buf, 0, PFRAME); @@ -1545,9 +1545,8 @@ static int do_special(struct go7007 *go, u16 type, __le16 *code, int space, case SPECIAL_MODET: return modet_to_package(go, code, space); } - printk(KERN_ERR - "go7007: firmware file contains unsupported feature %04x\n", - type); + dev_err(go->dev, + "firmware file contains unsupported feature %04x\n", type); return -1; } @@ -1577,15 +1576,16 @@ int go7007_construct_fw_image(struct go7007 *go, u8 **fw, int *fwlen) return -1; } if (request_firmware(&fw_entry, go->board_info->firmware, go->dev)) { - printk(KERN_ERR - "go7007: unable to load firmware from file \"%s\"\n", + dev_err(go->dev, + "unable to load firmware from file \"%s\"\n", go->board_info->firmware); return -1; } code = kzalloc(codespace * 2, GFP_KERNEL); if (code == NULL) { - printk(KERN_ERR "go7007: unable to allocate %d bytes for " - "firmware construction\n", codespace * 2); + dev_err(go->dev, + "unable to allocate %d bytes for firmware construction\n", + codespace * 2); goto fw_failed; } src = (__le16 *)fw_entry->data; @@ -1594,9 +1594,9 @@ int go7007_construct_fw_image(struct go7007 *go, u8 **fw, int *fwlen) chunk_flags = __le16_to_cpu(src[0]); chunk_len = __le16_to_cpu(src[1]); if (chunk_len + 2 > srclen) { - printk(KERN_ERR "go7007: firmware file \"%s\" " - "appears to be corrupted\n", - go->board_info->firmware); + dev_err(go->dev, + "firmware file \"%s\" appears to be corrupted\n", + go->board_info->firmware); goto fw_failed; } if (chunk_flags & mode_flag) { @@ -1604,17 +1604,15 @@ int go7007_construct_fw_image(struct go7007 *go, u8 **fw, int *fwlen) ret = do_special(go, __le16_to_cpu(src[2]), &code[i], codespace - i, framelen); if (ret < 0) { - printk(KERN_ERR "go7007: insufficient " - "memory for firmware " - "construction\n"); + dev_err(go->dev, + "insufficient memory for firmware construction\n"); goto fw_failed; } i += ret; } else { if (codespace - i < chunk_len) { - printk(KERN_ERR "go7007: insufficient " - "memory for firmware " - "construction\n"); + dev_err(go->dev, + "insufficient memory for firmware construction\n"); goto fw_failed; } memcpy(&code[i], &src[2], chunk_len * 2);