From patchwork Thu Sep 15 10:43:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 9333099 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5CF236077F for ; Thu, 15 Sep 2016 10:47:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 537D429536 for ; Thu, 15 Sep 2016 10:47:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4801D29548; Thu, 15 Sep 2016 10:47:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E15FB29536 for ; Thu, 15 Sep 2016 10:46:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bkUC0-0007D1-TR; Thu, 15 Sep 2016 10:46:56 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bkU9g-0003nd-Iz; Thu, 15 Sep 2016 10:44:35 +0000 Received: by mail-lf0-x242.google.com with SMTP id k12so1866638lfb.1; Thu, 15 Sep 2016 03:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=RzMiE2XmIihZhyFOVSgKhJ+nUKxpBcOfsSjmKrHKSSQ=; b=K9Ah/J2jequ2LXTgs2azxmh3tdt74K87K5fwjYhQGo/f/aGoIVYfToB52vcUzNpSCN 0EmVn4kDpxpGh+g8nsh6wpNkus3VqstFXPwcNKTDMkf6rypT6q9Xxye7vxeuVCjRhCkN BsTSNLjd5bHTIGUiFGTAOHhNKrDSAvf48uBWhLfEm1BwbrxkOV6MjYrMDrcMc5+MDr3w wJwnduAsAPqxgLw48OHpyXJwERP9hdCn0KIiDPLFHXxe0OqiqXuXLrqyh/desZ+BaJAW FErrKfgxOVqcpTaCt7ffjNTNwaQy0G1Wm00tLBXVQjwYzvDj/KKN1+5oaxcVFGAmpryU +45A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=RzMiE2XmIihZhyFOVSgKhJ+nUKxpBcOfsSjmKrHKSSQ=; b=IhHqxlyr0EquJYMzHDLDwgpBvLXx32fq53Rfyu/4N7FRR7MXgabL9IZfZOoDtCNC2D CryI5cG5Oz7eEUMIP+/smyizLenz4rAy5uLWfDpKBze7XyE6Z6NaSkLgraEV9a1fbgdu RiV6GETUhOXNHqWajEf8tLYO4CITq/5InFMG3cgZz7+y7Zwsbk4zK5QAbMkSppf+cTeJ mAMkKkNjZUbfDmHjK8UB1V2DxJYf/OHjIO74aRPxtYb26aUMcrJY8k/ymYcZIxHkMmtG VZdjR57h1J7Bg3OQ32OVoL3og7DmSSMtZHU98BvJDEKs3RSiEIxH3H7m5GjgcvZaOGN+ R+gA== X-Gm-Message-State: AE9vXwM7eF+N7RW0HGAgt1yXn95717wKAbStVgCgVqR0DOZP45JYMoWEYe3PCyThnrxFdQ== X-Received: by 10.195.10.132 with SMTP id ea4mr7403410wjd.19.1473936250092; Thu, 15 Sep 2016 03:44:10 -0700 (PDT) Received: from cizrna.lan ([109.72.12.249]) by smtp.gmail.com with ESMTPSA id bj11sm2818164wjd.35.2016.09.15.03.44.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Sep 2016 03:44:09 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Subject: [PATCH] soc: rockchip: power-domain: Handle errors from of_genpd_add_provider_onecell Date: Thu, 15 Sep 2016 12:43:41 +0200 Message-Id: <1473936221-9248-1-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160915_034432_993047_6A4F3251 X-CRM114-Status: UNSURE ( 9.74 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Heiko Stuebner , Tomeu Vizoso , Caesar Wang MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP It was a bit surprising that the device was reported to have probed just fine, but the provider hadn't been registered. So handle any errors when registering the provider and fail the probe accordingly. Signed-off-by: Tomeu Vizoso Cc: Caesar Wang --- drivers/soc/rockchip/pm_domains.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c index 7acd1517dd37..57e920128cb2 100644 --- a/drivers/soc/rockchip/pm_domains.c +++ b/drivers/soc/rockchip/pm_domains.c @@ -627,7 +627,11 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) goto err_out; } - of_genpd_add_provider_onecell(np, &pmu->genpd_data); + error = of_genpd_add_provider_onecell(np, &pmu->genpd_data); + if (error) { + dev_err(dev, "failed to add provider: %d\n", error); + goto err_out; + } return 0;