Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2805129rwb; Mon, 7 Nov 2022 18:49:22 -0800 (PST) X-Google-Smtp-Source: AMsMyM4KR2/6O1fjSZVfByXQjyvRB6hKaH5Ry00bYxzBQg/hT/NtJDKXtR02Wu2KiqYfaA+YD5hb X-Received: by 2002:aa7:cd92:0:b0:456:cbb5:2027 with SMTP id x18-20020aa7cd92000000b00456cbb52027mr53410156edv.384.1667875761924; Mon, 07 Nov 2022 18:49:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667875761; cv=none; d=google.com; s=arc-20160816; b=vM/EAk5gARgo58+5Sh4FRpkCs4igNgzkW/CCz/Pf69GcRBRXkAhr2IRY1Xr4/uWZIN FqCKvdCrBDK0xDlJnlToz9ZTGJf73GBQUApVjBErdFZ/Q3KVSpnZjBTDYM4dfB39SQ/d mC+gaUtEjibyL8let2RmVpxljHRu11agSViiR3tixbrLJNzqRCpRfKlFd17xTl1rT4vR eW0OLccrkvpBsvi2Q5TSgiQXB0TLvNT4Gd6V+8gBYoHTLIgprD7QSRVSRjPzEq8kM4W1 IukcIRkQhJ40AMa+OvBHeTjNpHqsspSDT2uPLo6m3S88XME3v8sfwMx4eTIGckmgG2Qr YC/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=tzKWXxaw2bQ7cYvkLEpW7FrabLPbJKKDth0rPNHG0GY=; b=gZKwbcbljZgOPtDQb6ZmbjgRlM20LBAtfV3G+WDXbzNNQZIvr12BYzeq/QFqCnSwFA M082ui/cfGp/wy7c5Zvk6QUDsrpD9BXfYSJLskiXlZhscFF4bJSIAMgZ7aPM37B/7gMd MWPfDyiEyefeKcRtBgPhzmmNEco/FgETnRPAPW217WNC6KJBhgj6Qo/NxcsVUHjnDEPR Lbccr32XVG+LsTDQ3OzGRrO5jL9QT9wKKVM+K/6337Fu4XEATREDIPDy1We3FGtbOpzj BacweFJTXvNZT3OQwMjAICqgDbES2kImFJUlk0kAfSAqRsTQgj4SyzIQCxtCufEMzXqt ixMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KPQxqcVw; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw30-20020a1709066a1e00b0078cffd3ce3esi11065982ejc.654.2022.11.07.18.49.00; Mon, 07 Nov 2022 18:49:21 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=KPQxqcVw; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229651AbiKHCb1 (ORCPT + 91 others); Mon, 7 Nov 2022 21:31:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233664AbiKHCbE (ORCPT ); Mon, 7 Nov 2022 21:31:04 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D96DF140B6; Mon, 7 Nov 2022 18:30:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667874653; x=1699410653; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=v5JfCjrostcFM57ehzBq1YAw5lngVCrvuFrcq8Fs8LI=; b=KPQxqcVwd0zGsSxuMmVIgm9AL5kfdDK+kZ0BCiy1Jpu9e36UHgLb9iyL eXH1PoOD/3ueHn1ayOStEu6vuGO6QpIx0BiyVH54jWT/A623FcWVy8CR/ L7ASyg3ykPX/70E4sp/gkIFXs2ENNQNo+M0Rs2TrMUQVl1mHKzYp8x4o1 aPek3ES9L9pqoV4fYEuFWGTntF1u6fRs4id0dEbQqfKl3SOvJl9WaiX2j /wx8+fQXRGrYVeCiB5eyrdHov1BTWmSrhvDwRPB3P7rhn799vM6jFMFER SRkI0gT+hPrtEzalSdkUi5J9u7BqSKa/cnYSm/cS1F65YUrYmz8OJ5QYb w==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="396879231" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="396879231" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 18:30:39 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="669373099" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="669373099" Received: from hushengh-mobl.ccr.corp.intel.com ([10.254.212.182]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 18:30:36 -0800 Message-ID: Subject: Re: [PATCH v1 1/5] rtc: rtc-cmos: Call cmos_wake_setup() from cmos_do_probe() From: Zhang Rui To: "Rafael J. Wysocki" , Alexandre Belloni , linux-rtc@vger.kernel.org Cc: Linux ACPI , LKML , Linux PM , Alessandro Zummo , Andy Shevchenko Date: Tue, 08 Nov 2022 10:30:33 +0800 In-Reply-To: <1850290.tdWV9SEqCh@kreacher> References: <2276401.ElGaqSPkdT@kreacher> <1850290.tdWV9SEqCh@kreacher> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham 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 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. thanks, rui