Skip to content

Commit 65b7a5a

Browse files
Thadeu Lima de Souza Cascardogregkh
authored andcommitted
alarmtimer: Use EOPNOTSUPP instead of ENOTSUPP
commit f18ddc1 upstream. 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] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1347c74 commit 65b7a5a

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
@@ -544,7 +544,7 @@ static int alarm_timer_create(struct k_itimer *new_timer)
544544
enum alarmtimer_type type;
545545

546546
if (!alarmtimer_get_rtcdev())
547-
return -ENOTSUPP;
547+
return -EOPNOTSUPP;
548548

549549
if (!capable(CAP_WAKE_ALARM))
550550
return -EPERM;
@@ -772,7 +772,7 @@ static int alarm_timer_nsleep(const clockid_t which_clock, int flags,
772772
struct restart_block *restart;
773773

774774
if (!alarmtimer_get_rtcdev())
775-
return -ENOTSUPP;
775+
return -EOPNOTSUPP;
776776

777777
if (flags & ~TIMER_ABSTIME)
778778
return -EINVAL;

0 commit comments

Comments
 (0)