linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Volkov <avolkov@varma-el.com>
To: Andrew Morton <akpm@osdl.org>
Cc: khali@linux-fr.org, lm-sensors@lm-sensors.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] Added support of ST m41t85 rtc chip
Date: Wed, 16 Nov 2005 00:24:18 +0300	[thread overview]
Message-ID: <437A5202.2080807@varma-el.com> (raw)
In-Reply-To: <20051114164118.7270c6ce.akpm@osdl.org>

Andrew Morton wrote:
> Andrey Volkov <avolkov@varma-el.com> wrote:
> 
>>...
>>Added support of ST M41T85 RTC
>>
>>...
>>
>>+ulong
>>+m41t85_get_rtc_time(void)
> 
> 
> Does this need to have global scope?
> 
> It appears to have no callers.

I use this function(s) in platform driver (which still in dev stage) of
our board as platform get_rtc_time/set_rtc_time by same way as Mark in
the katana does.

May be better create special header in include/linux?
(And convert m41t80.c and arch/ppc/katana.c too)

>>+static void
>>+m41t85_set_tlet(ulong arg)
>>+{
>>+	struct rtc_time	tm;
>>+	ulong	nowtime = *(ulong *)arg;
>>+
>>+	to_tm(nowtime, &tm);
>>+	tm.tm_year = (tm.tm_year - 1900) % 100;
>>+
>>+	tm.tm_sec = BIN2BCD(tm.tm_sec);
>>+	tm.tm_min = BIN2BCD(tm.tm_min);
>>+	tm.tm_hour = BIN2BCD(tm.tm_hour);
>>+	tm.tm_mon = BIN2BCD(tm.tm_mon);
>>+	tm.tm_mday = BIN2BCD(tm.tm_mday);
>>+	tm.tm_year = BIN2BCD(tm.tm_year);
>>+
>>+	down(&m41t85_mutex);
> 
> 
> Cannot do down() in a tasklet handler!  Enable CONFIG_DEBUG_PREEMPT and
> CONFIG_DEBUG_SPINLOCK_SLEEP, retest.

Oops, you're right. It's copy-paste bug from m41t00.c
(which then buggy too).

> 
> schedule_work() might be an appropriate fix.
> 
> 
>>+int
>>+m41t85_set_rtc_time(ulong nowtime)
>>+{
>>+	new_time = nowtime;
>>+
>>+	if (in_interrupt())
>>+		tasklet_schedule(&m41t85_tasklet);
>>+	else
>>+		m41t85_set_tlet((ulong)&new_time);
>>+
>>+	return 0;
>>+}
> 
> 
> hm, this function isn't referenced from within this patch either.

Same as above.

> 
> 
>>+	#if defined (CONFIG_SENSORS_M41T85_SQW_FRQ)
> 
> 
> #if's normally start in column zero.
> 
> 
>>+		ret = i2c_smbus_write_byte_data(client, RTC_SQW_ADDR, CONFIG_SENSORS_M41T85_SQW_FRQ);
> 
> 
> My, what large xterms you have ;)

Tabs=4 and 1280 full screened :). Ok I fix it to 80 columns.

--
Regards
Andrey Volkov


  reply	other threads:[~2005-11-15 21:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-14 13:50 [PATCH 1/1] Added support of ST m41t85 rtc chip Andrey Volkov
2005-11-15  0:41 ` Andrew Morton
2005-11-15 21:24   ` Andrey Volkov [this message]
2005-11-15 20:52 ` Jean Delvare
2005-11-15 21:48   ` Andrey Volkov
2005-11-16  3:15     ` Mark A. Greer
2005-11-16 14:50       ` Andrey Volkov
2005-11-16 18:55       ` Andy Isaacson
2005-11-16 22:24         ` Mark A. Greer
2005-11-18 20:35           ` Mark A. Greer
2005-11-21 12:35             ` Andrey Volkov
2005-12-06 21:18               ` Mark A. Greer
2005-11-16  2:57   ` Mark A. Greer
2005-11-16 14:45     ` Andrey Volkov
2005-11-16 15:19       ` Jean Delvare
2005-11-16 16:43         ` Andrey Volkov
2005-11-16 21:36           ` Mark A. Greer
2005-11-17  9:20           ` Jean Delvare
2005-11-16 21:24         ` Mark A. Greer
2005-12-19 21:03     ` [RFC] i2c: Combined ST m41txx i2c rtc chip driver (was: [PATCH 1/1] Added support of ST m41t85 rtc chip) Mark A. Greer
2005-12-19 21:06       ` Mark A. Greer
2005-12-20 10:05       ` [RFC] i2c: Combined ST m41txx i2c rtc chip driver Andrey Volkov
2005-12-21 21:25         ` Mark A. Greer
     [not found]         ` <20060111000912.GA11471@mag.az.mvista.com>
     [not found]           ` <43C4D275.2070505@varma-el.com>
     [not found]             ` <20060111161954.GB6405@mag.az.mvista.com>
2006-01-11 19:03               ` Andrey Volkov
2006-01-18 22:06                 ` Mark A. Greer
2006-01-19  7:25                   ` Jean Delvare
2006-01-26  2:01                     ` Mark A. Greer
2006-01-26 20:50                       ` Mark A. Greer

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=437A5202.2080807@varma-el.com \
    --to=avolkov@varma-el.com \
    --cc=akpm@osdl.org \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    /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;
as well as URLs for NNTP newsgroup(s).