Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp9419732ybc; Sat, 30 Nov 2019 07:02:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxd2w8K1Rt6FqpIqwgTqADsjk3ZDC4xmTXZx11S/yiVgyJXVWhoNNn8VRmsaEWbZEUb4mLK X-Received: by 2002:a05:6402:c08:: with SMTP id co8mr27282590edb.197.1575126138071; Sat, 30 Nov 2019 07:02:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575126138; cv=none; d=google.com; s=arc-20160816; b=rk7HMLAKjfSQyC19ai2xcZ/lzsSg6Zo2AsDY4ruJJQfA+B0qTxja29Yr8AfN4ZBz4o DA0lBfS/XQRitfwjRF5UBbYDlZqBtveK1DIQQTZp4sBHmcUosSNJuwQRJ8QVei9cslXV Ohj4ea6ExU2PkNEg7Z0hrkF63djtlEYii1nN9IsVQD7BJMX/pBWAej/VVr399JFzkVPl Dx88bxgya9T+g9AUq7AdWNm5QtQBcImy83w8EuT9+2hEbV8BJjyI8Vr1LYM1jTRaNeeu Vj17J7H9042v4utt3VTAQwnAKawTiJm5rBVDjSIoeOqe+IxJvjPhESpcSDPgt/SWs1dK pg6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bUD5FdR6g2ASiBzE14YJrcmNzasb1Y2tz62iUE7N/xc=; b=UR9tO3dggZzSbT2uQOpx5Loqz44EIY6bKZ4BTTWjLxYMQB8mq02Dp1K7vi58/8khEW n/a3jUQiFKqFqD2rl+7Jq7CPsaTFwPY0m0G2mjf/DYkrF/bYgGnZhH+dR2lfCyQT11fC hdh4xmM8YkyjWn/sdwjoyWqBpXP2JPxwLOEre2NrGClUqDJ7Gyz38yk1mr4Ht+WGxCcb DpEpKTiQQ/I8JWlnp3cTFwcy01bjgOwkbNP4sW/R58ZWaT2Etf2RU4PJf26quH/CsMra JL1P+ZcMcZvvkWxMPcUaRQ+JZJI6qy5kZS9h5JQyVWUWMRvKTKfO3rBbc0BHrADLXOQV 4JwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b="UBvp/ytW"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q12si16794611ejt.308.2019.11.30.07.01.53; Sat, 30 Nov 2019 07:02:18 -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; dkim=pass header.i=@googlemail.com header.s=20161025 header.b="UBvp/ytW"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727279AbfK3O6c (ORCPT + 99 others); Sat, 30 Nov 2019 09:58:32 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:35474 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726376AbfK3O6c (ORCPT ); Sat, 30 Nov 2019 09:58:32 -0500 Received: by mail-wr1-f65.google.com with SMTP id g17so6424137wro.2 for ; Sat, 30 Nov 2019 06:58:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bUD5FdR6g2ASiBzE14YJrcmNzasb1Y2tz62iUE7N/xc=; b=UBvp/ytW4dLm9uvAfDdpEY+sIk0DHBNJsf9eC1RyWRYMIsvDbpmkW8ofy4BC422sTB +M1vbn1upImJvydQUcRb4uFJUGQ1E5v6u5UUXQmjkpNllnVCIKwLpd/Loc1l0imHGbNh vGOWZTXZ/SHfuhcvMyCAtqoL3oewv7FnK3qiAL4MVjFYXNpK7qUD09bx+r6UDzuqvVqT 7Q/uxFF/rrWw9q3VcXMdweNFjbc4ehrHVXkXTRN6bX7tGo6FHh3ZqvzJNv9vbfG29tl7 3TUbqM4XsXs+xz8ovggd2m9Mvwlk81d855Xx9aBSCZjxWhua+JIFgMgcO0zHtV8/riLJ MaIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bUD5FdR6g2ASiBzE14YJrcmNzasb1Y2tz62iUE7N/xc=; b=obYCl3ZDfVNwCfWlKOtLOshiygViHOP3EEhAMOgEY8xxkMDI9XBXlzvcw3zRhwqUQI CDBnNsPVFjVPch1FrI+uc6IfMN1IK4kYciquQ32XsUCKFOazsW0t0lXysMN96PYgOVNI XkYmZsbcSc/DAPhpGqfXMMgs+qP2S9ehmRWauySF5MZOh9i+0gPaHlUZB33sr8FSgWJL ZK/lh8LlFjVGMYW8ZY7SFDXcJywhgdXKvfuv2E9ctA0iEaRCzqridBanze/9GSjyNqmI KfmWqC7P8Ka3zpsspnj+zni2QVDxTuJ7mZP8MtCQNdZ18vgBJ+gBiUrOYH+si91ma573 1H0w== X-Gm-Message-State: APjAAAVN179UzsropXZocTdyHxd8obgyjdw4ELUoakfTgKyzDonsKCCK lY7VVUgpKcdKIytYswi+TtM= X-Received: by 2002:adf:da4d:: with SMTP id r13mr42788144wrl.307.1575125909679; Sat, 30 Nov 2019 06:58:29 -0800 (PST) Received: from localhost.localdomain (p200300F1371CB100428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:f1:371c:b100:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id c9sm3510202wmc.47.2019.11.30.06.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Nov 2019 06:58:28 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, khilman@baylibre.com, narmstrong@baylibre.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [PATCH RESEND v1 2/2] soc: amlogic: meson-ee-pwrc: propagate errors from pm_genpd_init() Date: Sat, 30 Nov 2019 15:58:21 +0100 Message-Id: <20191130145821.1490349-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191130145821.1490349-1-martin.blumenstingl@googlemail.com> References: <20191130145821.1490349-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pm_genpd_init() can return an error. Propagate the error code to prevent the driver from indicating that it successfully probed while there were errors during pm_genpd_init(). Fixes: eef3c2ba0a42a6 ("soc: amlogic: Add support for Everything-Else power domains controller") Signed-off-by: Martin Blumenstingl --- drivers/soc/amlogic/meson-ee-pwrc.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/soc/amlogic/meson-ee-pwrc.c b/drivers/soc/amlogic/meson-ee-pwrc.c index df734a45da56..3f0261d53ad9 100644 --- a/drivers/soc/amlogic/meson-ee-pwrc.c +++ b/drivers/soc/amlogic/meson-ee-pwrc.c @@ -323,6 +323,8 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev, struct meson_ee_pwrc *pwrc, struct meson_ee_pwrc_domain *dom) { + int ret; + dom->pwrc = pwrc; dom->num_rstc = dom->desc.reset_names_count; dom->num_clks = dom->desc.clk_names_count; @@ -368,15 +370,21 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev, * prepare/enable counters won't be in sync. */ if (dom->num_clks && dom->desc.get_power && !dom->desc.get_power(dom)) { - int ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks); + ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks); if (ret) return ret; - pm_genpd_init(&dom->base, &pm_domain_always_on_gov, false); - } else - pm_genpd_init(&dom->base, NULL, - (dom->desc.get_power ? - dom->desc.get_power(dom) : true)); + ret = pm_genpd_init(&dom->base, &pm_domain_always_on_gov, + false); + if (ret) + return ret; + } else { + ret = pm_genpd_init(&dom->base, NULL, + (dom->desc.get_power ? + dom->desc.get_power(dom) : true)); + if (ret) + return ret; + } return 0; } -- 2.24.0