Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140026
b: refs/heads/master
c: 2ceb3ad
h: refs/heads/master
v: v3
  • Loading branch information
Geert Uytterhoeven authored and Kyle McMartin committed Apr 2, 2009
1 parent 1e02974 commit aec320c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3afe6d04626f8de87b15150a30b78df492ab68ee
refs/heads/master: 2ceb3ad705aa1abe6656b038bb9f4a6b1201cc35
7 changes: 5 additions & 2 deletions trunk/arch/m68k/include/asm/rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ static inline unsigned int get_rtc_time(struct rtc_time *time)
* RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated
* by the RTC when initially set to a non-zero value.
*/
mach_hwclk(0, time);
if (mach_hwclk)
mach_hwclk(0, time);
return RTC_24H;
}

static inline int set_rtc_time(struct rtc_time *time)
{
return mach_hwclk(1, time);
if (mach_hwclk)
return mach_hwclk(1, time);
return -EINVAL;
}

static inline unsigned int get_rtc_ss(void)
Expand Down
18 changes: 18 additions & 0 deletions trunk/arch/m68k/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/rtc.h>
#include <linux/platform_device.h>

#include <asm/machdep.h>
#include <asm/io.h>
Expand Down Expand Up @@ -159,3 +160,20 @@ int do_settimeofday(struct timespec *tv)
}

EXPORT_SYMBOL(do_settimeofday);


static int __init rtc_init(void)
{
struct platform_device *pdev;

if (!mach_hwclk)
return -ENODEV;

pdev = platform_device_register_simple("rtc-generic", -1, NULL, 0);
if (IS_ERR(pdev))
return PTR_ERR(pdev);

return 0;
}

module_init(rtc_init);
2 changes: 1 addition & 1 deletion trunk/drivers/rtc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ config RTC_DRV_GENERIC
tristate "Generic RTC support"
# Please consider writing a new RTC driver instead of using the generic
# RTC abstraction
depends on PARISC
depends on PARISC || M68K
help
Say Y or M here to enable RTC support on systems using the generic
RTC abstraction. If you do not know what you are doing, you should
Expand Down

0 comments on commit aec320c

Please sign in to comment.