Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp863319imp; Wed, 20 Feb 2019 10:19:54 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia4Q4YJpI/cKFyJHsnTaHrWo1tU+Iz4Vgv6zp0Wa4OOpudWExyq1ZANGKeXrMTnmIfAXwbu X-Received: by 2002:a62:1bd4:: with SMTP id b203mr35694877pfb.144.1550686794642; Wed, 20 Feb 2019 10:19:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550686794; cv=none; d=google.com; s=arc-20160816; b=Kb2mz9X9JA4S9hMiQ6scG8nVCLm/JN9KlBpAUX7i9bc7Y/Mma0TCxEXa2TNlQSeCab 3FuNW/IIs8jUBoCls2Elik6t7ySIN9lR1OC3ZGlrY+ASbvE7dd2qq43N0pPH9KKUIQuL RT/VZD2i1Syu1v4R6aeqNrqRBl5gHOAmvoC5V+WU0ot74Ipe3YdiLSHe5EJfYP3rCU/O A9cCWrBLRNyApco2UxR8NbNQRrgxhiKh43S5Jfg/9sYg6a070ZMJiU9Jag1OjIlW1ZCE ClZPiY6XnfZ3qToHR1Z+f2K2KdowYtZ21o7OGAzLnYPiTmH6SMtRxLGj/gIMoRHIK3g/ 4pBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from; bh=NzZTzSQ9mPWhsJ9iTycIlxlFYclNH6B/tvx9ocWPSHM=; b=Uq5SBRoJWS55jfHt+yNZhGluoElxUqTFf5Y2gKVlbI4C+vt6I1zLFUhkcKU3bUqNp9 /Dg1D74AwEhHKpcAC7G9JAsMMuZ0r7eJfRRVHoYEslrzMrO2zr66eRzPmnqXGymIkJRc GrWFqz65AcQnQJrQC0HKRYl4uki01aInwpESM5tzN6qm304YhL3T+MRdwL1Ysu5fQEUN Dl1M1rv+0pGF0nTHaw9rXDdoQuZwvXonH0fETkT+AaXRBo38V9VKVJAQ+Sru2JwU5/8n fNaX5osaGrPCZxqKVXmEfpJ2vcRy++OkarCJ0gnYmCr3xRfvWrkkHzjPTv384HAK2anl uDpg== 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 o188si3332889pga.297.2019.02.20.10.19.39; Wed, 20 Feb 2019 10:19:54 -0800 (PST) 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 S1726428AbfBTSS5 (ORCPT + 99 others); Wed, 20 Feb 2019 13:18:57 -0500 Received: from anholt.net ([50.246.234.109]:51082 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726078AbfBTSS5 (ORCPT ); Wed, 20 Feb 2019 13:18:57 -0500 Received: from localhost (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id 11B7310A2D1A; Wed, 20 Feb 2019 10:18:57 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at anholt.net Received: from anholt.net ([127.0.0.1]) by localhost (kingsolver.anholt.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id twHIuxoTdFbx; Wed, 20 Feb 2019 10:18:55 -0800 (PST) Received: from eliezer.anholt.net (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id B737310A047F; Wed, 20 Feb 2019 10:18:55 -0800 (PST) Received: by eliezer.anholt.net (Postfix, from userid 1000) id 27B912FE464C; Wed, 20 Feb 2019 10:18:55 -0800 (PST) From: Eric Anholt To: Florian Fainelli , Stefan Wahren , Florian Fainelli Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com Subject: Re: [PATCH 2/2] soc: bcm: bcm2835-pm: Fix error paths of initialization. In-Reply-To: References: <20190213003324.15224-1-eric@anholt.net> <20190213003324.15224-2-eric@anholt.net> <648bbc3e-6690-9b05-cae5-bf81edbec74a@i2se.com> <87tvh7v8yd.fsf@anholt.net> <1278623750.602548.1550097191567@email.ionos.de> User-Agent: Notmuch/0.22.2+1~gb0bcfaa (http://notmuchmail.org) Emacs/25.2.2 (x86_64-pc-linux-gnu) Date: Wed, 20 Feb 2019 10:18:54 -0800 Message-ID: <87va1e492p.fsf@anholt.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Florian Fainelli writes: > On 2/13/19 2:33 PM, Stefan Wahren wrote: >>=20 >>> Eric Anholt hat am 13. Februar 2019 um 19:28 geschrie= ben: >>> >>> >>> Stefan Wahren writes: >>> >>>> Hi Eric, >>>> >>>> Am 13.02.19 um 01:33 schrieb Eric Anholt: >>>>> The clock driver may probe after ours and so we need to pass the >>>>> -EPROBE_DEFER out. Fix the other error path while we're here. >>>>> >>>>> Signed-off-by: Eric Anholt >>>>> Fixes: 670c672608a1 ("soc: bcm: bcm2835-pm: Add support for power dom= ains under a new binding.") >>>>> --- >>>>> drivers/soc/bcm/bcm2835-power.c | 30 +++++++++++++++++++++++++----- >>>>> 1 file changed, 25 insertions(+), 5 deletions(-) >>>>> >>>>> diff --git a/drivers/soc/bcm/bcm2835-power.c b/drivers/soc/bcm/bcm283= 5-power.c >>>>> index 4a1b99b773c0..11f9469423f7 100644 >>>>> --- a/drivers/soc/bcm/bcm2835-power.c >>>>> +++ b/drivers/soc/bcm/bcm2835-power.c >>>>> @@ -485,7 +485,7 @@ static int bcm2835_power_pd_power_off(struct gene= ric_pm_domain *domain) >>>>> } >>>>> } >>>>>=20=20 >>>>> -static void >>>>> +static int >>>>> bcm2835_init_power_domain(struct bcm2835_power *power, >>>>> int pd_xlate_index, const char *name) >>>>> { >>>>> @@ -493,6 +493,12 @@ bcm2835_init_power_domain(struct bcm2835_power *= power, >>>>> struct bcm2835_power_domain *dom =3D &power->domains[pd_xlate_index= ]; >>>>>=20=20 >>>>> dom->clk =3D devm_clk_get(dev->parent, name); >>>>> + if (IS_ERR(dom->clk)) { >>>>> + int ret =3D PTR_ERR(dom->clk); >>>>> + >>>>> + if (ret =3D=3D -EPROBE_DEFER) >>>>> + return ret; >>>> is it safe to proceed in the other error cases? >>>> Even it would be more consistent with clk_prepare_enable() to print an >>>> error here. >>> >>> Yes, not all domains have a clk, so we want to ignore the other error. >>=20 >> But shouldn't we set dom->clk to NULL instead of keeping the error >> pointer? AFAIK clk_prepare_enable is aware of NULL instead of error >> pointer. > > If the clock is really optional, then yes, this should be the way to go. Sigh, error pointers. Fixed, sending a v2. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlxtmg4ACgkQtdYpNtH8 nugrsQ/6AnksEI2djGnvqEdVo5nnWAMKLPElVVqFFDLpApiEGwaMjFjMWZ9EhwMk cv7LZ9er+jxz8w0uyXxe2e5gzCcbF/5h7zPwUO6J4Rq9IvH0mfTaoWCY594vNroK NIPSuzrPkThUYetnkItoNiWs02gfeImh/DeLSFs1lJD+uSpyzQa3YAXjKELeII9G TE/EnWw5kFPLiGNdUJMyQ/il9FitX4Kou6Vk09VvwMc3wIDwgepCkBXekULskcSI j3Hr4KSApMVH/R8efEW44FEoxHPf8rDCZ9PgBzk/hLTO1UW8hQOEadq4+Y+yFa+Z 8LuoBHQaHbmHewOgYGtymAF3R/k/WfsrSwbQ0ENqPjMYK+qPqyMqTQlvRJRJYxjG PnPdEChXCUQBFRdbLrqWY9ngvDE06EZ50P9CpYqSB7EpiXJL8K7ffXGarC2HWD1S Vz8t/lqCpu1n1ZNTygIIHYk5VPyxInbTz0MQrauTzYd6MbjwMM3jUq99+wMlnDW7 iiIlwgsiNE27dhACBWx5R9pcJq5ySoOJ33L493pdhkOeMUtRqwnnyozJ2ijiCpZC cacYDR86xGVOhCDxTCQc+VgiOSjlPrloVz4wPZsFpIt3iQpM25x3KOr3t821sQc4 EeFdBQKG+Q6VvXxyvfD/AHdPZ9k3h9/LdULQhGDuO+Yuma1l5vQ= =YqZL -----END PGP SIGNATURE----- --=-=-=--