From: "tiejun.chen" <tiejun.chen@windriver.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH] Support RTC on Malta
Date: Fri, 31 Oct 2008 14:44:07 +0800 [thread overview]
Message-ID: <490AA937.3050505@windriver.com> (raw)
In-Reply-To: <20081030120510.GH26256@linux-mips.org>
Ralf Baechle wrote:
> On Thu, Oct 30, 2008 at 07:15:44PM +0800, Tiejun Chen wrote:
>
> Looks reasonable but I have a few comments:
>
>> diff --git a/arch/mips/mti-malta/Makefile b/arch/mips/mti-malta/Makefile
>> index cef2db8..26284fc 100644
>> --- a/arch/mips/mti-malta/Makefile
>> +++ b/arch/mips/mti-malta/Makefile
>> @@ -9,7 +9,7 @@ obj-y := malta-amon.o malta-cmdline.o \
>> malta-display.o malta-init.o malta-int.o \
>> malta-memory.o malta-mtd.o \
>> malta-platform.o malta-reset.o \
>> - malta-setup.o malta-time.o
>> + malta-setup.o malta-time.o malta-rtc.o
>
> Could you please fold malta-rtc.c into the existing malta-platform.c instead
> of creating a new file?
>
Good idea and done.
>> +++ b/arch/mips/mti-malta/malta-rtc.c
>> @@ -0,0 +1,73 @@
>
>> + struct platform_device *pdev;
>> + int ret;
>> +
>> + pdev = platform_device_alloc("rtc_cmos", -1);
>> + if (!pdev)
>> + return -ENOMEM;
>> +
>> + ret = platform_device_add_resources(pdev, malta_platform_rtc_resource,
>> + ARRAY_SIZE(malta_platform_rtc_resource));
>> + if (ret)
>> + goto err;
>> +
>> + ret = platform_device_add(pdev);
>> + if (ret)
>> + goto err;
>
> You can simplify this a bit by using a static struct platform_device like:
>
I generated another patch to your separate email temporarily. I'll cc here after
you confirm if the file head is valid.
> static struct platform_device rtc_device = {
> .name = "rtc_cmos",
> .id = -1,
> .resource = &malta_platform_rtc_resource,
> .num_resources = ARRAY_SIZE(malta_platform_rtc_resource),
> };
>
>> +
>> + /* Try setting rtc as BCD mode to support
>> + * current alarm code if possible.
>> + */
>> + if (!RTC_ALWAYS_BCD)
>> + CMOS_WRITE(CMOS_READ(RTC_CONTROL) & ~RTC_DM_BINARY, RTC_CONTROL);
>
> RTC_ALWAYS_BCD is 0, so the if condition is always true and the if can be
> eleminated.
>
Ohh... I guess we'd better use this to track something once this macro may be
changed in the future.
Best Regards
Tiejun
> Can you fix that?
>
> Ralf
>
next prev parent reply other threads:[~2008-11-01 8:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-30 11:15 [PATCH] Support RTC on Malta Tiejun Chen
2008-10-30 11:15 ` [PATCH] Reserve stack/heap area for RP program Tiejun Chen
2008-10-30 12:17 ` Ralf Baechle
2008-10-31 1:42 ` tiejun.chen
2008-11-03 11:18 ` tiejun.chen
2008-10-30 12:05 ` [PATCH] Support RTC on Malta Ralf Baechle
2008-10-31 6:44 ` tiejun.chen [this message]
2008-11-26 1:19 ` tiejun.chen
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=490AA937.3050505@windriver.com \
--to=tiejun.chen@windriver.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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 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.