The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com,
	Alessandro Zummo <a.zummo@towertech.it>,
	Samuel Ortiz <sameo@linux.intel.com>,
	kyungmin.park@samsung.com, myungjoo.ham@gmail.com
Subject: Re: [PATCH 2/2] MAX8997/8966 RTC Driver Initial Release
Date: Fri, 04 Mar 2011 00:58:52 -0800	[thread overview]
Message-ID: <1299229132.1929.53.camel@Joe-Laptop> (raw)
In-Reply-To: <1299224924-11230-1-git-send-email-myungjoo.ham@samsung.com>

On Fri, 2011-03-04 at 16:48 +0900, MyungJoo Ham wrote:
> This patch adds support for RTC functionality for MAX8997/8966 chips.

just trivial comments here too.

> diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c
[]
> +static void __maybe_unused dump(struct rtc_data *rtc)
> +{
> +	int i, j;
> +	char buf[256];
> +	char *ptr;
> +	u8 val;
> +
> +	for (i = 0; i < 3; i++) {
> +		ptr = buf;
> +		ptr += sprintf(ptr, "[%2.2xh] ", i * 16);
> +		for (j = 0; j < 16; j++) {
> +			max8997_read_reg(rtc->i2c, i * 16 + j, &val);
> +			ptr += sprintf(ptr, "%2.2x ", val);
> +		}
> +		pr_info("%s\n", buf);
> +	}
> +}

It might be better to use a loop to read all the registers
and then print_hex_dump.  Something like:

static void __maybe_unused dump(struct rtc_data *rtc)
{
	int i;
	u8 buf[48];

	for (i = 0; i < 48; i++)
		max8997_read_reg(rtc->i2c, i, &buf[i]);
	print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1,
		       buf, sizeof(buf), false);
}




  reply	other threads:[~2011-03-04  8:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-04  6:50 [PATCH v2 0/2] MAX8997/8966 MFD (includig PMIC) Initial Release MyungJoo Ham
2011-03-04  6:50 ` [PATCH v2 1/2] MAX8997/8966 MFD Driver Initial Release (PMIC+RTC+MUIC+Haptic+...) MyungJoo Ham
2011-03-05 11:31   ` Mark Brown
2011-03-04  6:50 ` [PATCH v2 2/2] MAX8997/8966 PMIC Regulator Driver Initial Release MyungJoo Ham
2011-03-04  7:16   ` [PATCH] MAX8997/8966 PMIC: compiler warning removed (incompatible pointer) MyungJoo Ham
2011-03-05 12:03   ` [PATCH v2 2/2] MAX8997/8966 PMIC Regulator Driver Initial Release Mark Brown
2011-03-08  1:50     ` MyungJoo Ham
2011-03-08 12:41       ` Mark Brown
2011-03-04  7:45 ` [PATCH 1/2] MAX8997/8966 MFD: Add IRQ control feature MyungJoo Ham
2011-03-04  8:58   ` Joe Perches
2011-03-14 10:11   ` Samuel Ortiz
2011-03-14 10:37     ` MyungJoo Ham
2011-03-04  7:48 ` [PATCH 2/2] MAX8997/8966 RTC Driver Initial Release MyungJoo Ham
2011-03-04  8:58   ` Joe Perches [this message]
2011-03-05 12:07   ` [rtc-linux] " Mark Brown
2011-03-14  9:49 ` [PATCH v2 0/2] MAX8997/8966 MFD (includig PMIC) " Samuel Ortiz

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=1299229132.1929.53.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=a.zummo@towertech.it \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@gmail.com \
    --cc=myungjoo.ham@samsung.com \
    --cc=rtc-linux@googlegroups.com \
    --cc=sameo@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox