From patchwork Thu Oct 9 19:06:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 5060651 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 551C7C11AC for ; Thu, 9 Oct 2014 19:16:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 879202022A for ; Thu, 9 Oct 2014 19:16:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB0DB20222 for ; Thu, 9 Oct 2014 19:15:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XcJ8w-0006Zp-5a; Thu, 09 Oct 2014 19:12:54 +0000 Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XcJ8s-0006Ve-6S for linux-arm-kernel@lists.infradead.org; Thu, 09 Oct 2014 19:12:50 +0000 Received: by mail-la0-f42.google.com with SMTP id mk6so1894264lab.29 for ; Thu, 09 Oct 2014 12:12:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=jCrfLJIwO7CyBQLogU33e+v/NwwMCrcFFWUtFk0UE28=; b=YNb1+48VXUIvA01v7kwv0hNbnGXVaoYNsYcYciL0w7RPU60ilPZ6uLTGaPFl2KosdS mUugrWAwrvUDk4AsmXWAJ3QF3CYbm3Rn0L267cHiyjzKzi00hFhcyvyZQHOmFI4MDE+N 7dsqqH5CzBYtGHFDrt6TgULf1/Pss9Tt5L0i0yyQp7SLTqS/MISOVmT/LpNTtEfFUBFA euY+bFXE7w6RO9gDm8FujlkGram45fgOS9mICKMunZgQeQljKEuTZJiI1ckz2yhhpPq4 LJscw4v49QLDDHmoqz5VqMGWTIGpIxMZMJoIV7zIivMxILPzeezoMku82YCEVDxUMpWI lRAw== X-Received: by 10.153.6.11 with SMTP id cq11mr20843849lad.55.1412881947374; Thu, 09 Oct 2014 12:12:27 -0700 (PDT) Received: from xi.terra (s83-177-171-8.cust.tele2.se. [83.177.171.8]) by mx.google.com with ESMTPSA id f8sm1181579lbv.39.2014.10.09.12.12.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Oct 2014 12:12:26 -0700 (PDT) X-Google-Original-Sender: Received: from johan by xi.terra with local (Exim 4.84) (envelope-from ) id 1XcJ5o-0006hB-9b; Thu, 09 Oct 2014 21:09:40 +0200 From: Johan Hovold To: Alessandro Zummo , Tony Lindgren , =?UTF-8?q?Beno=C3=AEt=20Cousson?= Subject: [PATCH 02/12] rtc: omap: fix missing wakealarm attribute Date: Thu, 9 Oct 2014 21:06:24 +0200 Message-Id: <1412881594-25678-3-git-send-email-johan@kernel.org> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1412881594-25678-1-git-send-email-johan@kernel.org> References: <1412881594-25678-1-git-send-email-johan@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141009_121250_436442_326A0B0E X-CRM114-Status: GOOD ( 12.42 ) X-Spam-Score: -0.7 (/) Cc: devicetree@vger.kernel.org, rtc-linux@googlegroups.com, Colin Foe-Parker , Lokesh Vutla , j-keerthy@ti.com, nsekhar@ti.com, linux-kernel@vger.kernel.org, Felipe Balbi , Johan Hovold , t-kristo@ti.com, linux-arm-kernel@lists.infradead.org, AnilKumar Ch , stable , Andrew Morton , linux-omap@vger.kernel.org, Guenter Roeck X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The platform device must be registered as wakeup capable before registering the class device, or the wakealarm attribute will not be created. Also make sure to unregister the wakeup source on probe errors. Fixes: 1d2e2b65d098 ("rtc: omap: restore back (hard-code) wakeup support") Cc: stable Signed-off-by: Johan Hovold Reviewed-by: Felipe Balbi --- drivers/rtc/rtc-omap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index f842c216f2dd..828cb9983cc2 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c @@ -416,6 +416,8 @@ static int __init omap_rtc_probe(struct platform_device *pdev) rtc_writel(KICK1_VALUE, OMAP_RTC_KICK1_REG); } + device_init_wakeup(&pdev->dev, true); + rtc = devm_rtc_device_register(&pdev->dev, pdev->name, &omap_rtc_ops, THIS_MODULE); if (IS_ERR(rtc)) { @@ -484,8 +486,6 @@ static int __init omap_rtc_probe(struct platform_device *pdev) * is write-only, and always reads as zero...) */ - device_init_wakeup(&pdev->dev, true); - if (new_ctrl & (u8) OMAP_RTC_CTRL_SPLIT) pr_info("%s: split power mode\n", pdev->name); @@ -495,6 +495,7 @@ static int __init omap_rtc_probe(struct platform_device *pdev) return 0; fail0: + device_init_wakeup(&pdev->dev, false); if (id_entry->driver_data & OMAP_RTC_HAS_KICKER) rtc_writel(0, OMAP_RTC_KICK0_REG); pm_runtime_put_sync(&pdev->dev);