From patchwork Wed Sep 16 07:16:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 518274 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-la0-x23a.google.com (mail-la0-x23a.google.com [IPv6:2a00:1450:4010:c03::23a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 14C3814016A for ; Wed, 16 Sep 2015 17:16:58 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b=L/w16W6m; dkim-atps=neutral Received: by lahg1 with SMTP id g1sf37268430lah.1 for ; Wed, 16 Sep 2015 00:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe; bh=UUBOIAqZOY85oPSjQBzYQ/zcED5r3asa0T1XvzG9R7s=; b=L/w16W6mIfpAKBGy/4X1WL/FwyEgn3aBk4s3GPl1RZYg+J7sAitLdZuAXrjNjr1T5c ht6nMOiPALMAnX9zrZz7fHN2xcozEX13MvRU4eQPuWo44MZcZuXwawTlrxyhHUZeif3C m4LEVYBoPB8uKE7J0/WxS0SCmEHQUs0VB/Lo7ckRHcUBAteNvbJmvURpsaa/9t7qUzOS sm/QB1Jr6q6dED0t8+2R4Ro2E6V3uxGAgKhcwLKerZvUNRYEcxjmguHgkWRX3/vTh7uf UqGGhCOUIM+sqLq8CcXoEgdAUvM6agEcYuWjryKMX6OpSQ350yW+6zEx0qA1eMWrWptY DbfQ== X-Received: by 10.152.3.130 with SMTP id c2mr23870lac.24.1442387815207; Wed, 16 Sep 2015 00:16:55 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.152.180.201 with SMTP id dq9ls493447lac.53.gmail; Wed, 16 Sep 2015 00:16:54 -0700 (PDT) X-Received: by 10.152.224.129 with SMTP id rc1mr642096lac.10.1442387814517; Wed, 16 Sep 2015 00:16:54 -0700 (PDT) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de. [2001:67c:670:201:290:27ff:fe1d:cc33]) by gmr-mx.google.com with ESMTPS id b7si105344wiz.1.2015.09.16.00.16.54 for (version=TLS1_2 cipher=AES128-SHA256 bits=128/128); Wed, 16 Sep 2015 00:16:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of ukl@pengutronix.de designates 2001:67c:670:201:290:27ff:fe1d:cc33 as permitted sender) client-ip=2001:67c:670:201:290:27ff:fe1d:cc33; Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Zc6xZ-0005iI-Re; Wed, 16 Sep 2015 09:16:53 +0200 Received: from ukl by dude.hi.pengutronix.de with local (Exim 4.86) (envelope-from ) id 1Zc6xZ-0001PY-JZ; Wed, 16 Sep 2015 09:16:53 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Alexandre Belloni , rtc-linux@googlegroups.com Cc: Alessandro Zummo , kernel@pengutronix.de Subject: [rtc-linux] [PATCH] rtc: rtctest: enabling UIE for a chip that doesn't support it returns EINVAL Date: Wed, 16 Sep 2015 09:16:51 +0200 Message-Id: <1442387811-5384-1-git-send-email-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.5.0 In-Reply-To: <20150916071545.GA28635@pengutronix.de> References: <20150916071545.GA28635@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: rtc-linux@googlegroups.com X-Original-Sender: u.kleine-koenig@pengutronix.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of ukl@pengutronix.de designates 2001:67c:670:201:290:27ff:fe1d:cc33 as permitted sender) smtp.mailfrom=ukl@pengutronix.de Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: rtc-linux@googlegroups.com X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Calling ioctl(..., RTC_UIE_ON, ...) without CONFIG_RTC_INTF_DEV_UIE_EMUL either ends in rtc_update_irq_enable if rtc->uie_unsupported is true or in __rtc_set_alarm in the if (!rtc->ops->set_alarm) branch. In both cases the return value is -EINVAL. So check for that one instead of ENOTTY. Signed-off-by: Uwe Kleine-König --- tools/testing/selftests/timers/rtctest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/timers/rtctest.c b/tools/testing/selftests/timers/rtctest.c index d80ae852334d..624bce51b27d 100644 --- a/tools/testing/selftests/timers/rtctest.c +++ b/tools/testing/selftests/timers/rtctest.c @@ -61,7 +61,7 @@ int main(int argc, char **argv) /* Turn on update interrupts (one per second) */ retval = ioctl(fd, RTC_UIE_ON, 0); if (retval == -1) { - if (errno == ENOTTY) { + if (errno == EINVAL) { fprintf(stderr, "\n...Update IRQs not supported.\n"); goto test_READ;