From patchwork Fri Jan 20 19:01:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Berger X-Patchwork-Id: 13110412 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C7F7BC05027 for ; Fri, 20 Jan 2023 19:03:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jcOUWM0jPbJ9zLkpDbZy6qcRMf8OvIylzOVpLet58lQ=; b=sIIFR0W7mqdKTk y/TUt0aDih17fRk+zGyOL/dTJy1UCvLgelnBHxC7Zv7WECgJhRw6aI+r5V7KjgDJtxQOszwv5Ttgz sjm1WtMOMnZH54n362IrmzP6uywH//j1zlVDuYmHQDOXnPjPTSNfAuoyzhre0Hb856NChKsNrIgGO W2nuEe99c/GbBP5a08LHz8bKsRqh8IF1+AJJOBUaNbNtLDptJwWcKm3+Q2OchCCG0nIHgjlgpE57E m9DobuS7THTVjN9lmq2o7szhX/J5c5SFppcnGvfUgDCxaiZklf9Ga742HA62GyNnfH/jdF6ln56Dm sMrpI5Jfil/trd6sI57A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIwf4-00BwnW-RF; Fri, 20 Jan 2023 19:02:51 +0000 Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIweh-00Bwdz-Bi for linux-arm-kernel@lists.infradead.org; Fri, 20 Jan 2023 19:02:28 +0000 Received: by mail-il1-x12e.google.com with SMTP id m15so3178035ilq.2 for ; Fri, 20 Jan 2023 11:02:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PT42Zl2MuPs/Wu9jh4sQMK4BVAdg3CNaxRS3csl2Gmk=; b=YgMU1Tm/SWN5kuzg9KE0Cq1L9BqLdj77L+ImuL3FdAEO30CVMjJzhspc7fXWo45AOw fBcRb0NkdP9N3aY+rceOTA7NNYEzQimVr2aq4Nw3ram5kpP0Gs9YNTZnO53nc6VpEmXd Imue2WitnqlW/k6aNpZe0+rU1oesQiKsfdIMrGIf+JvdE4UC4A25Jgndwscx57+MK2iL Aw26dwMqQu/IWcQDok3S8jzIWw+bEknjwhBMIMliCBF2uSJDrarjlKj568SFleWZJ3Um +CKC6EjY0GIs403gJqLiZESoCFY7h7VBwt5KvYAbhH3Hn/54Zr0yhi+j4fVsV7Gi3V// edTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PT42Zl2MuPs/Wu9jh4sQMK4BVAdg3CNaxRS3csl2Gmk=; b=BzxQ88LxaNekSXBw2kJ0CI/xRuQToVRoZtKyx4HHNZ8ox4Q7VVQ7PZz2Ax1FrQM84h +TG/aKv4lY8EFG3r1p3dxr5Mwe/qPbXRtg49WpRF6wXoqOMnVh0ghEIFaaMSGmpVFsaV wXOaeoF4Y+/Cl7kHI5KB0fT+n1x72Z4MeTEdVVT22n/uHbrV9eMTRal7WtBJ/ljwtf7T qYlUa2JCS8Nw3g1lreXOsEPDMv1WAjD/D1XHjXKy1Z/tQE/z8yaFCPJshcPoaYu30ois ZFWlick/PHJwKBVz8fZLGRi895jzHvLALL1d7bI2D952McPc9JrvhWWpOg84HkxVsh47 BGSA== X-Gm-Message-State: AFqh2kolpUfNeZ3DzRaJIlq4XjiqpRBZOQKM1b7HnwCXGUs83jGRQA6N Bsnm1FzISK/cUHSyXZ1EM+o= X-Google-Smtp-Source: AMrXdXvZu4EKcElFlDs9p4MYW7HJf6M/QTeoUR8FTyxRiUnhim6OBaeJFtX0+Tx5ki+8TU0bfImN6Q== X-Received: by 2002:a05:6e02:1ba2:b0:30f:63f0:b215 with SMTP id n2-20020a056e021ba200b0030f63f0b215mr854272ili.26.1674241346839; Fri, 20 Jan 2023 11:02:26 -0800 (PST) Received: from stbirv-lnx-3.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id y13-20020a37f60d000000b006fa2b1c3c1esm10379806qkj.58.2023.01.20.11.02.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 11:02:26 -0800 (PST) From: Doug Berger To: Alessandro Zummo , Alexandre Belloni Cc: Brian Norris , Markus Mayer , Rob Herring , Krzysztof Kozlowski , Florian Fainelli , Broadcom internal kernel review list , linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Doug Berger Subject: [PATCH 2/6] rtc: brcmstb-waketimer: non-functional code changes Date: Fri, 20 Jan 2023 11:01:43 -0800 Message-Id: <20230120190147.718976-3-opendmb@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230120190147.718976-1-opendmb@gmail.com> References: <20230120190147.718976-1-opendmb@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230120_110227_460999_5FDE2DC9 X-CRM114-Status: GOOD ( 17.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org These changes are not intended to affect functionality, but simplify the source code. They are performed here to simplify review and reduce confusion with other changes in this set. Since set_alarm includes the alarm_irq_enable functionality call it directly from that function for simplicity (even though it does nothing at the moment). The order of the declarations is changed to prevent the need for a prototype. The function device_init_wakeup() is used to replace the functions device_set_wakeup_capable() and device_wakeup_enable() since it is equivalent. Signed-off-by: Doug Berger Acked-by: Florian Fainelli --- drivers/rtc/rtc-brcmstb-waketimer.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/rtc/rtc-brcmstb-waketimer.c b/drivers/rtc/rtc-brcmstb-waketimer.c index fbeb8be6664b..582c23793550 100644 --- a/drivers/rtc/rtc-brcmstb-waketimer.c +++ b/drivers/rtc/rtc-brcmstb-waketimer.c @@ -169,6 +169,16 @@ static int brcmstb_waketmr_getalarm(struct device *dev, return 0; } +/* + * Does not do much but keep the RTC class happy. We always support + * alarms. + */ +static int brcmstb_waketmr_alarm_enable(struct device *dev, + unsigned int enabled) +{ + return 0; +} + static int brcmstb_waketmr_setalarm(struct device *dev, struct rtc_wkalrm *alarm) { @@ -182,17 +192,7 @@ static int brcmstb_waketmr_setalarm(struct device *dev, brcmstb_waketmr_set_alarm(timer, sec); - return 0; -} - -/* - * Does not do much but keep the RTC class happy. We always support - * alarms. - */ -static int brcmstb_waketmr_alarm_enable(struct device *dev, - unsigned int enabled) -{ - return 0; + return brcmstb_waketmr_alarm_enable(dev, alarm->enabled); } static const struct rtc_class_ops brcmstb_waketmr_ops = { @@ -228,8 +228,7 @@ static int brcmstb_waketmr_probe(struct platform_device *pdev) * Set wakeup capability before requesting wakeup interrupt, so we can * process boot-time "wakeups" (e.g., from S5 soft-off) */ - device_set_wakeup_capable(dev, true); - device_wakeup_enable(dev); + device_init_wakeup(dev, true); timer->irq = platform_get_irq(pdev, 0); if (timer->irq < 0)