Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263655
b: refs/heads/master
c: bf6ed02
h: refs/heads/master
i:
  263653: 908112e
  263651: 4631b79
  263647: 3f53963
v: v3
  • Loading branch information
Axel Lin authored and John Stultz committed Aug 10, 2011
1 parent afe98a4 commit 6a5968a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 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: 6af7e471e5a7746b8024d70b4363d3dfe41d36b8
refs/heads/master: bf6ed027bcc93f8d54d321fe87f0434b25699eb1
16 changes: 8 additions & 8 deletions trunk/drivers/rtc/rtc-ep93xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
*/
struct ep93xx_rtc {
void __iomem *mmio_base;
struct rtc_device *rtc;
};

static int ep93xx_rtc_get_swcomp(struct device *dev, unsigned short *preload,
Expand Down Expand Up @@ -130,7 +131,6 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)
{
struct ep93xx_rtc *ep93xx_rtc;
struct resource *res;
struct rtc_device *rtc;
int err;

ep93xx_rtc = devm_kzalloc(&pdev->dev, sizeof(*ep93xx_rtc), GFP_KERNEL);
Expand All @@ -151,12 +151,12 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)
return -ENXIO;

pdev->dev.platform_data = ep93xx_rtc;
platform_set_drvdata(pdev, rtc);
platform_set_drvdata(pdev, ep93xx_rtc);

rtc = rtc_device_register(pdev->name,
ep93xx_rtc->rtc = rtc_device_register(pdev->name,
&pdev->dev, &ep93xx_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc)) {
err = PTR_ERR(rtc);
if (IS_ERR(ep93xx_rtc->rtc)) {
err = PTR_ERR(ep93xx_rtc->rtc);
goto exit;
}

Expand All @@ -167,7 +167,7 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)
return 0;

fail:
rtc_device_unregister(rtc);
rtc_device_unregister(ep93xx_rtc->rtc);
exit:
platform_set_drvdata(pdev, NULL);
pdev->dev.platform_data = NULL;
Expand All @@ -176,11 +176,11 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)

static int __exit ep93xx_rtc_remove(struct platform_device *pdev)
{
struct rtc_device *rtc = platform_get_drvdata(pdev);
struct ep93xx_rtc *ep93xx_rtc = platform_get_drvdata(pdev);

sysfs_remove_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files);
platform_set_drvdata(pdev, NULL);
rtc_device_unregister(rtc);
rtc_device_unregister(ep93xx_rtc->rtc);
pdev->dev.platform_data = NULL;

return 0;
Expand Down
18 changes: 5 additions & 13 deletions trunk/kernel/time/alarmtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,6 @@ static int alarm_timer_create(struct k_itimer *new_timer)
static void alarm_timer_get(struct k_itimer *timr,
struct itimerspec *cur_setting)
{
memset(cur_setting, 0, sizeof(struct itimerspec));

cur_setting->it_interval =
ktime_to_timespec(timr->it.alarmtimer.period);
cur_setting->it_value =
Expand Down Expand Up @@ -481,17 +479,11 @@ static int alarm_timer_set(struct k_itimer *timr, int flags,
if (!rtcdev)
return -ENOTSUPP;

/*
* XXX HACK! Currently we can DOS a system if the interval
* period on alarmtimers is too small. Cap the interval here
* to 100us and solve this properly in a future patch! -jstultz
*/
if ((new_setting->it_interval.tv_sec == 0) &&
(new_setting->it_interval.tv_nsec < 100000))
new_setting->it_interval.tv_nsec = 100000;

if (old_setting)
alarm_timer_get(timr, old_setting);
/* Save old values */
old_setting->it_interval =
ktime_to_timespec(timr->it.alarmtimer.period);
old_setting->it_value =
ktime_to_timespec(timr->it.alarmtimer.node.expires);

/* If the timer was already set, cancel it */
alarm_cancel(&timr->it.alarmtimer);
Expand Down

0 comments on commit 6a5968a

Please sign in to comment.