Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp122503yba; Mon, 20 May 2019 06:05:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8wjd4YH1JHSP0rrlIMqgoIqKeGst6677c0pjeG1ZXPY8Crd5BhXWUk8W968nmwIkaFyjY X-Received: by 2002:a17:902:70c6:: with SMTP id l6mr58177344plt.84.1558357553417; Mon, 20 May 2019 06:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558357553; cv=none; d=google.com; s=arc-20160816; b=mB5VpQJGTAe3Ai5pudvsF5iTKITg7Cv3wjlYg4paDMTqPLp9ezs7nT/r5jhkwrrHo6 kh5n+yyqP9h+UdIPKYvkU6JChwvvP44VlZDyS9qxC5+IO9ZHh9QaSLltf1vdbpBgwUGl xh2hhnTT8hNBQ2kKuED85YbE3bll3ryUi7J/cXrLtDmyUbA/TH7RHMtYbCIcLPq/3owm eieqlXP6bKQhdwsHUGnHezpN3bggmJHmTxNxVVptKRQ6J9F8lnvjwqrbWO7J+HI2uLjC fJGyzUO5EwUAG12qHh8vhYCUvAMs13B9sZGM80TLrt1xZtpfKFAwU2M0WPMwcPWU/085 lHZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=p7q91HfXOnPm/FpJTO+Ztn/QM+kjxPalHNX9mCdRoJs=; b=kLPYL3Hp/pkbMvj8N1NB3qBuGWvWMjXQrwBZ4dJ5BA7N6yObsfjYMpxBpckLipZulP fpoLI8GvCB6uIoWHUklChsZppu3pAoaGR3PvBRNIJQP1j4dyoJu18g6ukOFYV95cTdPW XeK1EkV7VT39JxqX6M1P+0fN2P3HpYTz0TMClRsO4vL0ckvZAZjoy75qkIa4g8BWQGHx Gh6Y5A4rPyoAz/80zdpGUA5pWwU8FyhRlzeNYHg2YYZznt5iYowIy0/IS8YSCVvSPC+/ DNoSSKuyDElX3mmKyseRKu1kpYGAiHCcsC7r3maBZajE+VQGMf7gTlmlfgOMg0JgGMYu sCEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d24si7901066plr.260.2019.05.20.06.05.34; Mon, 20 May 2019 06:05:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731666AbfETI4u (ORCPT + 99 others); Mon, 20 May 2019 04:56:50 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:47730 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725372AbfETI4u (ORCPT ); Mon, 20 May 2019 04:56:50 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 197348021D; Mon, 20 May 2019 10:56:38 +0200 (CEST) Date: Mon, 20 May 2019 10:56:47 +0200 From: Pavel Machek To: Ran Wang Cc: Pavel Machek , Leo Li , Rob Herring , Mark Rutland , "Rafael J . Wysocki" , Len Brown , Greg Kroah-Hartman , "linuxppc-dev@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" Subject: Re: [PATCH V2 3/3] soc: fsl: add RCPM driver Message-ID: <20190520085647.GA9748@amd> References: <20190517033946.30763-1-ran.wang_1@nxp.com> <20190517033946.30763-3-ran.wang_1@nxp.com> <20190519213844.GH31403@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nFreZHaLTZJo0R7j" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > > +static int rcpm_pm_prepare(struct device *dev) { > > > + struct device_node *np =3D dev->of_node; > > > + struct wakeup_source *ws; > > > + struct rcpm *rcpm; > > > + u32 value[RCPM_WAKEUP_CELL_MAX_SIZE + 1], tmp; > > > + int i, ret; > > > + > > > + rcpm =3D dev_get_drvdata(dev); > > > + if (!rcpm) > > > + return -EINVAL; > > > + > > > + /* Begin with first registered wakeup source */ > > > + ws =3D wakeup_source_get_next(NULL); > > > + while (ws) { > >=20 > > while (ws =3D wakeup_source_get_next(NULL)) ? >=20 > Actually, we only pass NULL to wakeup_source_get_next() at very first > call to get 1st wakeup source. Then in the while loop, we will fetch > next source but not 1st, that's different. I am afraid your suggestion > is not quite correct. Sorry, I seen your next version before seeing this explanation. You are right, but the current code is "interesting". What about ws =3D NULL; while (ws =3D wakeup_source_get_next(NULL)) ... then? Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --nFreZHaLTZJo0R7j Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlzia88ACgkQMOfwapXb+vLCHQCdEiZVnts+sVGDltC60TnL3F9y ltIAn0M2k/oHNFq1zm74JskvAw6PG/L7 =/fdT -----END PGP SIGNATURE----- --nFreZHaLTZJo0R7j--