Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3513554rwb; Tue, 8 Nov 2022 05:32:09 -0800 (PST) X-Google-Smtp-Source: AMsMyM48gGNwU9R6BLSjtMcH+B2+9kkwZHCo8l7ReY/mAZIq0i6lzfLzSoXeEPm4thOoSLJ4c/hI X-Received: by 2002:a05:6402:2947:b0:451:32a:2222 with SMTP id ed7-20020a056402294700b00451032a2222mr54385621edb.376.1667914329509; Tue, 08 Nov 2022 05:32:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667914329; cv=none; d=google.com; s=arc-20160816; b=OcfmQyrI3Xty2cgfEaeUkVw7ZEqD7ZkvdXwenp/dca0bfzN+UdthyvuqEsjAliBF7n 6hxxp2MFmRTwyDS95EwwAGa12Y7Ol6oE4aU1yrYaC5jCaH+wZh8EPc3G7+5IMQzTfCOe 3jAjqaDWJzY3c4DhFjN0AKwyeuyLPTK2TxGpIT03KFjFcExjkV9eSGO5t50mj1T6pP0T ojJFpwcokzcvwWZJc3lAtkp5JvhmEG0JTU3ZAVKFdGk/c8ur5SnO+qVfaUMxNGjPi3QJ akUZZSWGsKGh6nRsCCPf393IALBQHuvK7Qm+LPLDcp5QEdKETo4RaMkhqRmkQaWNs1Gt zjvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=tp5OMnbOjRDcClttdvcSBeqhMkw9nAZs4zoixrpu0Ao=; b=HPw97UfwOuYhUNNGh93fmqrGkX0/wz9ttlH3FTpPRRmjZxnQKzREDw1uMjJSiXHjpd OmxHg7MWdBzr0C+bJYMlsusSbYmPcHgBLsOglPApe2WBJFB2Hue/5HJuQWVuaBJ0f8fz eFjtCGYwoK5gEbce0NLxawCetZR9sTI1yxZrSfqf+1DPJkXEf0G9aYR7RTGouEvQbtkV F8PDy8XtaiLIH5gAJC5WTezHVMS/w2hDYjJZeiLOxCGHykd/egddgdf6ZY/6Bq/ektoV kAOHttQ77o9bJkMu78oFVk1DEGmJfbilVNL/T000iICtgVLy2Qb5HDxQPFAjK5ewMWHx r6Ww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n25-20020a170906165900b0077b4248b138si9279513ejd.127.2022.11.08.05.31.47; Tue, 08 Nov 2022 05:32:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234291AbiKHNJW (ORCPT + 90 others); Tue, 8 Nov 2022 08:09:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233603AbiKHNJV (ORCPT ); Tue, 8 Nov 2022 08:09:21 -0500 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90B291B9E3; Tue, 8 Nov 2022 05:09:20 -0800 (PST) Received: by mail-qk1-f180.google.com with SMTP id p18so4452436qkg.2; Tue, 08 Nov 2022 05:09:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tp5OMnbOjRDcClttdvcSBeqhMkw9nAZs4zoixrpu0Ao=; b=5JbFpnFsykVdYy1yIEdjFcPNjjbTPdP4tVr+X3hsZ0t3lEBfh3BDgoRcctT6ygnE3C GIvTKxuYO8ni/5ekA8Y5ytu1A/jZTH37LGDd1LQg3fGlPYwHX0/S2gmE3B8rZXg4KI3G qW4IKFBMkujpRNOyk7XS8PJTKLB9291oy+aFUF1nE9/ZWxyCgnUTGfDPPYY1L00bZ1am PQBTQhxB6lOextBrYP4Pv1gDOtX2GPGuD4557Fwat6SjtHxHXjyx9bZSTyIUXa7nl5cP VHNgcVMOCHf9htBPFpoQIWrF+g5qVLiWTvyezZQ/Q1dMCO7T7Khuw8LwHjN1QPyOyWkq pWFw== X-Gm-Message-State: ACrzQf0QiSC0sWKCzracyMFLZSUZDKqwfPQgKnuK7CaxRmCIyGlbe04q VFawEYLEDookkaNkEKinsHnqkmhG9+iYdCeXH+k= X-Received: by 2002:a05:620a:d89:b0:6cf:c98b:744c with SMTP id q9-20020a05620a0d8900b006cfc98b744cmr38198402qkl.443.1667912959715; Tue, 08 Nov 2022 05:09:19 -0800 (PST) MIME-Version: 1.0 References: <2276401.ElGaqSPkdT@kreacher> <1850290.tdWV9SEqCh@kreacher> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 8 Nov 2022 14:09:07 +0100 Message-ID: Subject: Re: [PATCH v1 1/5] rtc: rtc-cmos: Call cmos_wake_setup() from cmos_do_probe() To: Zhang Rui Cc: "Rafael J. Wysocki" , Alexandre Belloni , linux-rtc@vger.kernel.org, Linux ACPI , LKML , Linux PM , Alessandro Zummo , Andy Shevchenko Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 8, 2022 at 3:31 AM Zhang Rui wrote: > > On Mon, 2022-11-07 at 20:59 +0100, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > > > Notice that cmos_wake_setup() is the only user of acpi_rtc_info and > > it > > can operate on the cmos_rtc variable directly, so it need not set the > > platform_data pointer before cmos_do_probe() is called. Instead, it > > can be called by cmos_do_probe() in the case when the platform_data > > pointer is not set to implement the default behavior (which is to use > > the FADT information as long as ACPI support is enabled). > > > > ... > > > > > @@ -827,19 +829,27 @@ cmos_do_probe(struct device *dev, struct > > if (info->address_space) > > address_space = info->address_space; > > > > - if (info->rtc_day_alarm && info->rtc_day_alarm < 128) > > - cmos_rtc.day_alrm = info->rtc_day_alarm; > > - if (info->rtc_mon_alarm && info->rtc_mon_alarm < 128) > > - cmos_rtc.mon_alrm = info->rtc_mon_alarm; > > - if (info->rtc_century && info->rtc_century < 128) > > - cmos_rtc.century = info->rtc_century; > > + cmos_rtc.day_alrm = info->rtc_day_alarm; > > + cmos_rtc.mon_alrm = info->rtc_mon_alarm; > > + cmos_rtc.century = info->rtc_century; > > > > if (info->wake_on && info->wake_off) { > > cmos_rtc.wake_on = info->wake_on; > > cmos_rtc.wake_off = info->wake_off; > > } > > + } else { > > + cmos_wake_setup(dev); > > } > > > > > > Previously, before commit a474aaedac99 ("rtc-cmos: move wake setup from > ACPI glue into RTC driver"), dev->platform_data is set in > drivers/acpi/glue.c, and the above commit moves it to cmos_wake_setup() > in this file. > > Now, with this patch, my understanding is that dev->platform_data is > never set, thus we can remove the 'info' variable and the > if (info) > check above. There are other users of this driver which can be found by grepping for cmos_rtc_board_info. They create platform device objects with platform_data set which are then bound to by this driver.