From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 88A83C433F5 for ; Mon, 20 Dec 2021 08:44:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:CC:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=a5nSm3M/0GZnekUepb0qg6Z6jA4U5X4zzWldmoJWFig=; b=unspVod/e6A1jBpxsWhn2/wycU CNCMkKyyMV4I19Ec3Qe4yEptHrbL/83NkOYv8wPTSodogGpZIdyQzOFasJB5F5orOj2wL6SX90yuq qvsSgmk1rgoaOjUWl99w08WKcGYT/a5oeB8qSEKjsvRaiOA7uXgrIjChSqgoIwrCMgKC6g1goWxbs HlgWfETsM8naRkJT3fgdCDcxnjUdEIMeTtm9hIOB4+1JUXxetrw481yXe06ODDeIcKqitx3qLPmIp +IykV7LaxQ2pCMnJ6OPmexo7LqydqUCEB8nIbRNpOlqZtxai3b0cmS1zvknkfoONQNiACIDwAT5l2 zu61XAeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzEFx-001Fp7-Kz; Mon, 20 Dec 2021 08:42:53 +0000 Received: from mx07-00178001.pphosted.com ([185.132.182.106]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzEFt-001Fnr-RH for linux-arm-kernel@lists.infradead.org; Mon, 20 Dec 2021 08:42:51 +0000 Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BK5928F012996; Mon, 20 Dec 2021 09:42:45 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=QY0s/csgPzxmWp7XZ6tfn4xXQVKcVcYdt9S/9mW+2co=; b=de+BHSb/atkeCtUs25ayXT0rV6HjIDBw+yxPpFv1mM8BLeenPreXYO3VHw5URvsFfgAt teIAkYgKqiBh586FwK+LAAqOd6MMV6DcKSsdgxScTRxjXqJIGVX2DBU71euXZ8goh11w 9Ba2Xf/mhrMN+U7F7qbZlMmrwnjn2UCLPFEG2C/7uq5fZbyqFTvaop6L3fRqF+gTvo72 IPqcQ2LE8GAC+gQRqu1WeVGtlVNJcaIf3amEoclvgJ2Ng0sDjwFwKIVlsdCrGukixW0g 8CggAx/M6ofVKkuQtHs59uY+lAIotjp7QpyXac3nYhllPlRXGmvvridGE9GLu2Dai9l4 2w== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3d2kearyqf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Dec 2021 09:42:44 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 81288100034; Mon, 20 Dec 2021 09:42:44 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 7818F226972; Mon, 20 Dec 2021 09:42:44 +0100 (CET) Received: from lmecxl0573.lme.st.com (10.75.127.48) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Mon, 20 Dec 2021 09:42:43 +0100 Subject: Re: [PATCH v2 2/2] clk: st: clkgen-mux: search reg within node or parent To: Alain Volmat , Michael Turquette , Stephen Boyd , Rob Herring CC: Lee Jones , , , , References: <20211218211157.188214-1-avolmat@me.com> <20211218211157.188214-3-avolmat@me.com> From: Patrice CHOTARD Message-ID: <674eb592-ec2a-0ff9-bbf5-eb4f0aff4251@foss.st.com> Date: Mon, 20 Dec 2021 09:42:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211218211157.188214-3-avolmat@me.com> Content-Language: en-US X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-20_04,2021-12-16_01,2021-12-02_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211220_004250_234882_27D19A94 X-CRM114-Status: GOOD ( 25.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Alain On 12/18/21 10:11 PM, Alain Volmat wrote: > In order to avoid having duplicated addresses within the DT, > only have one unit-address per clockgen and each driver within > the clockgen should look at the parent node (overall clockgen) > to figure out the reg property. Such behavior is already in > place in other STi platform clock drivers such as clk-flexgen > and clkgen-pll. Keep backward compatibility by first looking > at reg within the node before looking into the parent node. > > Signed-off-by: Alain Volmat > --- > v2: identical to v1 > > drivers/clk/st/clkgen-mux.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/drivers/clk/st/clkgen-mux.c b/drivers/clk/st/clkgen-mux.c > index ce583ded968a..ee39af7a0b72 100644 > --- a/drivers/clk/st/clkgen-mux.c > +++ b/drivers/clk/st/clkgen-mux.c > @@ -57,10 +57,17 @@ static void __init st_of_clkgen_mux_setup(struct device_node *np, > const char **parents; > int num_parents = 0; > > + /* > + * First check for reg property within the node to keep backward > + * compatibility, then if reg doesn't exist look at the parent node > + */ > reg = of_iomap(np, 0); > if (!reg) { > - pr_err("%s: Failed to get base address\n", __func__); > - return; > + reg = of_iomap(of_get_parent(np), 0); > + if (!reg) { > + pr_err("%s: Failed to get base address\n", __func__); > + return; > + } > } > > parents = clkgen_mux_get_parents(np, &num_parents); > Reviewed-by: Patrice Chotard Thanks Patrice _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel