All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Miao <eric.y.miao@gmail.com>
To: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: ymiao3@marvell.com, linux-fbdev-devel@lists.sourceforge.net,
	linux-arm-kernel@lists.arm.linux.org.uk
Subject: Re: [RFC 2.6.26-rc3 09/10] metronomefb: convert printk to dev_dbg/err messages
Date: Fri, 13 Jun 2008 10:22:15 +0800	[thread overview]
Message-ID: <4851D9D7.9040905@gmail.com> (raw)
In-Reply-To: <1213289961-1562-10-git-send-email-jayakumar.lkml@gmail.com>

Jaya Kumar wrote:
> This patch converts the printk messages in metronomefb to dev_dbg/err type
> messages.
> 
> Signed-off-by: Jaya Kumar <jayakumar.lkml@gmail.com>

Acked-by: Eric Miao <eric.miao@marvell.com>

Except that you may want to disable DEBUG by default when pushing upstream.

> ---
>  drivers/video/metronomefb.c |   49 +++++++++++++++++++-----------------------
>  1 files changed, 22 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c
> index cc4c038..8ccd113 100644
> --- a/drivers/video/metronomefb.c
> +++ b/drivers/video/metronomefb.c
> @@ -18,6 +18,8 @@
>   * is provided as am200epd.c
>   *
>   */
> +#define DEBUG 1
> +
>  #include <linux/module.h>
>  #include <linux/kernel.h>
>  #include <linux/errno.h>
> @@ -40,15 +42,6 @@
>  
>  #include <asm/unaligned.h>
>  
> -
> -#define DEBUG 1
> -#ifdef DEBUG
> -#define DPRINTK(f, a...) printk(KERN_DEBUG "%s: " f, __func__ , ## a)
> -#else
> -#define DPRINTK(f, a...)
> -#endif
> -
> -
>  /* Display specific information */
>  #define DPY_W 832
>  #define DPY_H 622
> @@ -135,8 +128,8 @@ static u16 calc_img_cksum(u16 *start, int length)
>  
>  /* here we decode the incoming waveform file and populate metromem */
>  #define EXP_WFORM_SIZE 47001
> -static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
> -				u8 *frame_count)
> +static int __devinit load_waveform(u8 *mem, size_t size, int m, int t,
> +				struct metronomefb_par *par)
>  {
>  	int tta;
>  	int wmta;
> @@ -148,9 +141,11 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
>  	int wfm_idx, owfm_idx;
>  	int mem_idx = 0;
>  	struct waveform_hdr *wfm_hdr;
> +	u8 *metromem = par->metromem_wfm;
> +	struct device *dev = par->info->dev;
>  
>  	if (size != EXP_WFORM_SIZE) {
> -		printk(KERN_ERR "Error: unexpected size %d != %d\n", size,
> +		dev_err(dev, "Error: unexpected size %d != %d\n", size,
>  					EXP_WFORM_SIZE);
>  		return -EINVAL;
>  	}
> @@ -158,16 +153,16 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
>  	wfm_hdr = (struct waveform_hdr *) mem;
>  
>  	if (wfm_hdr->fvsn != 1) {
> -		printk(KERN_ERR "Error: bad fvsn %x\n", wfm_hdr->fvsn);
> +		dev_err(dev, "Error: bad fvsn %x\n", wfm_hdr->fvsn);
>  		return -EINVAL;
>  	}
>  	if (wfm_hdr->luts != 0) {
> -		printk(KERN_ERR "Error: bad luts %x\n", wfm_hdr->luts);
> +		dev_err(dev, "Error: bad luts %x\n", wfm_hdr->luts);
>  		return -EINVAL;
>  	}
>  	cksum = calc_cksum(32, 47, mem);
>  	if (cksum != wfm_hdr->wfm_cs) {
> -		printk(KERN_ERR "Error: bad cksum %x != %x\n", cksum,
> +		dev_err(dev, "Error: bad cksum %x != %x\n", cksum,
>  					wfm_hdr->wfm_cs);
>  		return -EINVAL;
>  	}
> @@ -175,7 +170,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
>  	wfm_hdr->trc += 1;
>  	for (i = 0; i < 5; i++) {
>  		if (*(wfm_hdr->stuff2a + i) != 0) {
> -			printk(KERN_ERR "Error: unexpected value in padding\n");
> +			dev_err(dev, "Error: unexpected value in padding\n");
>  			return -EINVAL;
>  		}
>  	}
> @@ -200,7 +195,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
>  		return -EINVAL;
>  	cksum = calc_cksum(sizeof(*wfm_hdr), cksum_idx, mem);
>  	if (cksum != mem[cksum_idx]) {
> -		printk(KERN_ERR "Error: bad temperature range table cksum"
> +		dev_err(dev, "Error: bad temperature range table cksum"
>  				" %x != %x\n", cksum, mem[cksum_idx]);
>  		return -EINVAL;
>  	}
> @@ -212,7 +207,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
>  		return -EINVAL;
>  	cksum = calc_cksum(cksum_idx - 3, cksum_idx, mem);
>  	if (cksum != mem[cksum_idx]) {
> -		printk(KERN_ERR "Error: bad mode table address cksum"
> +		dev_err(dev, "Error: bad mode table address cksum"
>  				" %x != %x\n", cksum, mem[cksum_idx]);
>  		return -EINVAL;
>  	}
> @@ -224,7 +219,7 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
>  		return -EINVAL;
>  	cksum = calc_cksum(cksum_idx - 3, cksum_idx, mem);
>  	if (cksum != mem[cksum_idx]) {
> -		printk(KERN_ERR "Error: bad temperature table address cksum"
> +		dev_err(dev, "Error: bad temperature table address cksum"
>  			" %x != %x\n", cksum, mem[cksum_idx]);
>  		return -EINVAL;
>  	}
> @@ -259,11 +254,11 @@ static int load_waveform(u8 *mem, size_t size, u8 *metromem, int m, int t,
>  		return -EINVAL;
>  	cksum = calc_cksum(owfm_idx, cksum_idx, mem);
>  	if (cksum != mem[cksum_idx]) {
> -		printk(KERN_ERR "Error: bad waveform data cksum"
> +		dev_err(dev, "Error: bad waveform data cksum"
>  				" %x != %x\n", cksum, mem[cksum_idx]);
>  		return -EINVAL;
>  	}
> -	*frame_count = (mem_idx/64);
> +	par->frame_count = (mem_idx/64);
>  
>  	return 0;
>  }
> @@ -662,15 +657,15 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
>  		b) process waveform and decode into metromem */
>  	retval = request_firmware(&fw_entry, "metronome.wbf", &dev->dev);
>  	if (retval < 0) {
> -		printk(KERN_ERR "metronomefb: couldn't get waveform\n");
> +		dev_err(&dev->dev, "Failed to get waveform\n");
>  		goto err_dma_free;
>  	}
>  
> -	retval = load_waveform((u8 *) fw_entry->data, fw_entry->size,
> -				par->metromem_wfm, 3, 31, &par->frame_count);
> +	retval = load_waveform((u8 *) fw_entry->data, fw_entry->size, 3, 31,
> +				par);
>  	release_firmware(fw_entry);
>  	if (retval < 0) {
> -		printk(KERN_ERR "metronomefb: couldn't process waveform\n");
> +		dev_err(&dev->dev, "Failed processing waveform\n");
>  		goto err_dma_free;
>  	}
>  
> @@ -688,7 +683,7 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
>  
>  	retval = fb_alloc_cmap(&info->cmap, 8, 0);
>  	if (retval < 0) {
> -		printk(KERN_ERR "Failed to allocate colormap\n");
> +		dev_err(&dev->dev, "Failed to allocate colormap\n");
>  		goto err_fb_rel;
>  	}
>  
> @@ -704,7 +699,7 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
>  
>  	platform_set_drvdata(dev, info);
>  
> -	printk(KERN_INFO
> +	dev_dbg(&dev->dev,
>  		"fb%d: Metronome frame buffer device, using %dK of video"
>  		" memory\n", info->node, videomemorysize >> 10);
>  


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

  reply	other threads:[~2008-06-13  2:22 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12 16:59 [RFC 2.6.26-rc3 0/10] am200epd, pxafb, metronomefb changes v4 Jaya Kumar
2008-06-12 16:59 ` [RFC 2.6.26-rc3 01/10] pxafb: fix ifdef for command line option handling Jaya Kumar
     [not found]   ` <20080612203541.0baa5586.krzysztof.h1@poczta.fm>
2008-06-13  1:22     ` Eric Miao
2008-06-13  7:37   ` Russell King - ARM Linux
2008-06-12 16:59 ` [RFC 2.6.26-rc3 02/10] pxafb: cleanup and fix order of failure handling Jaya Kumar
2008-06-12 18:36   ` Krzysztof Helt
2008-06-13  1:23     ` Eric Miao
2008-06-13  7:37   ` Russell King - ARM Linux
2008-06-12 16:59 ` [RFC 2.6.26-rc3 03/10] pxafb: fix __devinit/exit annotations Jaya Kumar
2008-06-12 18:36   ` [Linux-fbdev-devel] " Krzysztof Helt
2008-06-13  1:24     ` Eric Miao
2008-06-13  7:38   ` Russell King - ARM Linux
2008-06-12 16:59 ` [RFC 2.6.26-rc3 04/10] pxafb: add exit and remove handlers Jaya Kumar
2008-06-12 18:37   ` [Linux-fbdev-devel] " Krzysztof Helt
2008-06-13  1:24   ` Eric Miao
2008-06-13  7:39   ` Russell King - ARM Linux
2008-06-12 16:59 ` [RFC 2.6.26-rc3 05/10] pxafb: add shared framebuffer interface Jaya Kumar
2008-06-15  6:26   ` [Linux-fbdev-devel] " Krzysztof Helt
2008-06-15  6:49     ` Jaya Kumar
2008-06-12 16:59 ` [RFC 2.6.26-rc3 06/10] gumstix: conversion to MFP support and add bluetooth support Jaya Kumar
2008-06-13  2:01   ` Eric Miao
2008-06-15  5:51     ` Jaya Kumar
2008-06-16  2:21       ` Eric Miao
2008-07-04  5:01         ` Jaya Kumar
2008-07-08  0:52     ` Jaya Kumar
2008-06-13  7:42   ` Russell King - ARM Linux
2008-06-15  5:54     ` Jaya Kumar
2008-07-31  9:04   ` Andrew Morton
2008-06-12 16:59 ` [RFC 2.6.26-rc3 07/10] am200epd: move am200epd to mach-pxa Jaya Kumar
2008-06-13  2:12   ` Eric Miao
2008-06-15  6:23     ` Jaya Kumar
2008-06-16  2:29       ` Eric Miao
2008-06-12 16:59 ` [RFC 2.6.26-rc3 08/10] am200epd: convert to shared fb and use gpio api Jaya Kumar
2008-06-13  2:20   ` Eric Miao
2008-06-15  6:42     ` Jaya Kumar
2008-06-16  2:35       ` Eric Miao
2008-07-08 12:43         ` Jaya Kumar
2008-06-12 16:59 ` [RFC 2.6.26-rc3 09/10] metronomefb: convert printk to dev_dbg/err messages Jaya Kumar
2008-06-13  2:22   ` Eric Miao [this message]
2008-06-12 16:59 ` [RFC 2.6.26-rc3 10/10] metronomefb: changes to use separate framebuffer Jaya Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4851D9D7.9040905@gmail.com \
    --to=eric.y.miao@gmail.com \
    --cc=jayakumar.lkml@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=ymiao3@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.