Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3728165rwb; Tue, 8 Nov 2022 07:47:02 -0800 (PST) X-Google-Smtp-Source: AMsMyM5wwjirYF/Jh3qFIq1+GXe7d2ii21oKrzX+Wa5S+JuF4cKxMTmfJSPhz7Da7WsS9ALvsrWL X-Received: by 2002:aa7:c3ca:0:b0:463:4784:bcec with SMTP id l10-20020aa7c3ca000000b004634784bcecmr48576224edr.315.1667922422102; Tue, 08 Nov 2022 07:47:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667922422; cv=none; d=google.com; s=arc-20160816; b=wk7QGn7p8GD9OJu54prruVTc/wdcH2zYsIS8rwV6yGbglNNadmsxLIFXG/mOh/Bjh9 uhqCCcYdYKtW20ATSqbqFdsOIrX5S9FZyyip8YFsXnpRDK9sS6gm9x1kMCzH51xX6mif +lBAiooxKeNPGZ1EeLRxF4n+gakxn7gS0e7Qt8rDH+MU8jHav88Db1DOq4BRBDKdvM8P 4oT5oVd+XsaFvtYbNqP96PUBXrphCJ70plSVmDiG/XCxVE5X7ZRZ3pLEmr77fED8gOMV KZIMN6WQwuVSgpCZuQlEx6w0IXL4eQ4vZzMpDfTbfMic4HRc2hyqmH+YqHTQ1uAzADeo /WpQ== 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=NnASYwkcIG3wsl5/rYpesB2Vtj7udnxahOEFsbRSteI=; b=lhrD1yhSn3/iJfh5omQO3NgO5PN0lS98IceLdel1VnSDy7G7L8V6sTR4gZa/uUr2sd bxBLPpYWW6OVVEb8Czk2umTjbJ/mU0MM0IcS0q+mqehMrFhIi6rF809e9BiX0RvlEYZM xrfJYkKkGRyCGhAZ3sACiK8gA8Vf+aHMOMmYBrZcYYQJw0yREcFR7Fn5VA+spr6Rc6xd jQow8Nrl667tODiYbH9EkNIocokAietWU4EkzYjEkrOUNgajMlQPLir6DepZ4ZiWNbln b3ZAluZoyew0dfQCmt7rH6IhkHzLwDwUD5UamkhGhzGA+A2ESjtDF/0IFupcuEWAABtc DfVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WJCQ17IG; 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 a16-20020aa7cf10000000b00461bbc0aa47si11356629edy.117.2022.11.08.07.46.38; Tue, 08 Nov 2022 07:47:02 -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=WJCQ17IG; 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 S234401AbiKHPlz (ORCPT + 91 others); Tue, 8 Nov 2022 10:41:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234424AbiKHPlx (ORCPT ); Tue, 8 Nov 2022 10:41:53 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C32F95C751; Tue, 8 Nov 2022 07:41:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667922112; x=1699458112; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=Fj2cRf0yfLP9Hty6jDMoaxrwsB/IsUZhdIEv+NMr+lk=; b=WJCQ17IGIH0C/eLm+QAik0jtkVN2S7YfJVpUalNQfjx2/xNPmMfVCTiZ ppg1EorRy7HsyGn20Ly00AvEnSqD9wyzpYfQZZC2u/DsCAEgFHUMgNyQu 1zxtMvshpKBJvE0IqcGbZAGOYaD95kx4ZT6d4F2dM9QKDSzVMdkfA9vBI glur8/yq53SojqKajMS09TV2lY4yCzkCLt8cRPYaS+G6OQYJzDH2JkFZR gY9iKSpnXFCGic50UE6e78vMwqivZa3H+FMudHxAkBfA2OhRE/b3RfhSW IvfYrOQR0z4TfA0UCqu2O/tcWLzyFsmJTkDXC9JaZW0NV7VgN57outFLf Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="290445132" X-IronPort-AV: E=Sophos;i="5.96,148,1665471600"; d="scan'208";a="290445132" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 07:41:52 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="669591064" X-IronPort-AV: E=Sophos;i="5.96,148,1665471600"; d="scan'208";a="669591064" Received: from liuc3-mobl1.ccr.corp.intel.com ([10.254.214.201]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 07:41:49 -0800 Message-ID: <0ab36c3ac0841296227b96ec0a5cadca0c4ac2ed.camel@intel.com> Subject: Re: [PATCH v1 1/5] rtc: rtc-cmos: Call cmos_wake_setup() from cmos_do_probe() From: Zhang Rui To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Alexandre Belloni , linux-rtc@vger.kernel.org, Linux ACPI , LKML , Linux PM , Alessandro Zummo , Andy Shevchenko Date: Tue, 08 Nov 2022 23:41:47 +0800 In-Reply-To: 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_PASS,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 Tue, 2022-11-08 at 14:09 +0100, Rafael J. Wysocki wrote: > 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. yeah, I overlooked this. thanks, rui