[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230609180955.4357-1-zeming@nfschina.com>
Date: Sat, 10 Jun 2023 02:09:55 +0800
From: Li zeming <zeming@...china.com>
To: jstultz@...gle.com, tglx@...utronix.de, sboyd@...nel.org
Cc: linux-kernel@...r.kernel.org, Li zeming <zeming@...china.com>
Subject: [PATCH] time: alarmtimer: Optimization function return value
Replace -1 return values with -EPERM.
Signed-off-by: Li zeming <zeming@...china.com>
---
kernel/time/alarmtimer.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 82b28ab0f328..e918d556dd51 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -92,9 +92,9 @@ static int alarmtimer_rtc_add_device(struct device *dev)
return -EBUSY;
if (!test_bit(RTC_FEATURE_ALARM, rtc->features))
- return -1;
+ return -EPERM;
if (!device_may_wakeup(rtc->dev.parent))
- return -1;
+ return -EPERM;
pdev = platform_device_register_data(dev, "alarmtimer",
PLATFORM_DEVID_AUTO, NULL, 0);
@@ -104,7 +104,7 @@ static int alarmtimer_rtc_add_device(struct device *dev)
spin_lock_irqsave(&rtcdev_lock, flags);
if (!IS_ERR(pdev) && !rtcdev) {
if (!try_module_get(rtc->owner)) {
- ret = -1;
+ ret = -EPERM;
goto unlock;
}
@@ -113,7 +113,7 @@ static int alarmtimer_rtc_add_device(struct device *dev)
get_device(dev);
pdev = NULL;
} else {
- ret = -1;
+ ret = -EPERM;
}
unlock:
spin_unlock_irqrestore(&rtcdev_lock, flags);
--
2.18.2
Powered by blists - more mailing lists