Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E45EC433FE for ; Thu, 18 Nov 2021 17:44:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81BFA61131 for ; Thu, 18 Nov 2021 17:44:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234200AbhKRRrK (ORCPT ); Thu, 18 Nov 2021 12:47:10 -0500 Received: from mxout03.lancloud.ru ([45.84.86.113]:40670 "EHLO mxout03.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234191AbhKRRrJ (ORCPT ); Thu, 18 Nov 2021 12:47:09 -0500 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout03.lancloud.ru B3E27205EC18 Received: from LanCloud Received: from LanCloud Received: from LanCloud Subject: Re: [PATCH 3/4] clk: renesas: cpg-mssr: Check return value of pm_genpd_init() To: Geert Uytterhoeven , Lad Prabhakar CC: Michael Turquette , Stephen Boyd , Jiri Kosina , Linux-Renesas , linux-clk , Linux Kernel Mailing List , Prabhakar , Biju Das References: <20211117115101.28281-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20211117115101.28281-4-prabhakar.mahadev-lad.rj@bp.renesas.com> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: Date: Thu, 18 Nov 2021 20:44:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/18/21 6:29 PM, Geert Uytterhoeven wrote: [...] >> Make sure we check the return value of pm_genpd_init() which might fail. >> Also add a devres action to remove the power-domain in-case the probe >> callback fails further down in the code flow. >> >> Signed-off-by: Lad Prabhakar > > Reviewed-by: Geert Uytterhoeven > i.e. will queue in renesas-clk-for-v5.17. > >> @@ -574,7 +580,13 @@ static int __init cpg_mssr_add_clk_domain(struct device *dev, >> GENPD_FLAG_ACTIVE_WAKEUP; >> genpd->attach_dev = cpg_mssr_attach_dev; >> genpd->detach_dev = cpg_mssr_detach_dev; >> - pm_genpd_init(genpd, &pm_domain_always_on_gov, false); >> + ret = pm_genpd_init(genpd, &pm_domain_always_on_gov, false); >> + if (ret) >> + return ret; >> + ret = devm_add_action_or_reset(dev, cpg_mssr_genpd_remove, genpd); > > Will insert a blank line here. You mean after *return*? Else I don't think we need an empty line. :-) > >> + if (ret) >> + return ret; >> + >> cpg_mssr_clk_domain = pd; >> >> of_genpd_add_provider_simple(np, genpd); > > Gr{oetje,eeting}s, > > Geert MBR, Sergey