Skip to content

Commit f18ddc1

Browse files
Thadeu Lima de Souza CascardoKAGA-KOKO
authored andcommitted
alarmtimer: Use EOPNOTSUPP instead of ENOTSUPP
ENOTSUPP is not supposed to be returned to userspace. This was found on an OpenPower machine, where the RTC does not support set_alarm. On that system, a clock_nanosleep(CLOCK_REALTIME_ALARM, ...) results in "524 Unknown error 524" Replace it with EOPNOTSUPP which results in the expected "95 Operation not supported" error. Fixes: 1c6b39a (alarmtimers: Return -ENOTSUPP if no RTC device is present) Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent 3b47fd5 commit f18ddc1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/time/alarmtimer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ static int alarm_timer_create(struct k_itimer *new_timer)
672672
enum alarmtimer_type type;
673673

674674
if (!alarmtimer_get_rtcdev())
675-
return -ENOTSUPP;
675+
return -EOPNOTSUPP;
676676

677677
if (!capable(CAP_WAKE_ALARM))
678678
return -EPERM;
@@ -790,7 +790,7 @@ static int alarm_timer_nsleep(const clockid_t which_clock, int flags,
790790
int ret = 0;
791791

792792
if (!alarmtimer_get_rtcdev())
793-
return -ENOTSUPP;
793+
return -EOPNOTSUPP;
794794

795795
if (flags & ~TIMER_ABSTIME)
796796
return -EINVAL;

0 commit comments

Comments
 (0)