From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suzuki.Poulose@arm.com (Suzuki K. Poulose) Date: Wed, 04 Mar 2015 12:16:49 +0000 Subject: [PATCH 1/5] arm-cci: Rearrange code for splitting PMU vs driver code In-Reply-To: <54F5D4B6.40409@arm.com> References: <1425295754-13376-1-git-send-email-suzuki.poulose@arm.com> <1425295754-13376-2-git-send-email-suzuki.poulose@arm.com> <54F5D4B6.40409@arm.com> Message-ID: <54F6F7B1.1020300@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 03/03/15 15:35, Sudeep Holla wrote: > > > On 02/03/15 11:29, Suzuki K. Poulose wrote: >> From: "Suzuki K. Poulose" >> >> No functional changes, only code re-arrangements for easier split of the >> PMU code vs low level driver code. Extracts the port handling code >> to cci_probe_ports(). >> >> Signed-off-by: Suzuki K. Poulose >> --- >> drivers/bus/arm-cci.c | 330 +++++++++++++++++++++++++------------------------ >> 1 file changed, 168 insertions(+), 162 deletions(-) >> >> diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c >> index 84fd660..f27cf56 100644 >> --- a/drivers/bus/arm-cci.c >> +++ b/drivers/bus/arm-cci.c > > [...] > >> @@ -1395,11 +1412,36 @@ static int cci_probe(void) >> sync_cache_w(&cpu_port); >> __sync_cache_range_w(ports, sizeof(*ports) * nb_cci_ports); >> pr_info("ARM CCI driver probed\n"); >> + >> return 0; >> +} >> + >> +static int cci_probe(void) >> +{ >> + int ret; >> + struct device_node *np; >> + struct resource res; >> + >> + np = of_find_matching_node(NULL, arm_cci_matches); >> + if (!np) >> + return -ENODEV; >> >> -memalloc_err: >> + if (!of_device_is_available(np)) >> + return -ENODEV; >> + >> + ret = of_address_to_resource(np, 0, &res); >> + if (!ret) { >> + cci_ctrl_base = ioremap(res.start, resource_size(&res)); >> + cci_ctrl_phys = res.start; >> + } >> + if (ret || !cci_ctrl_base) { >> + WARN(1, "unable to ioremap CCI ctrl\n"); >> + ret = -ENXIO; >> + goto out; > > IMO you can return directly here and get rid of this goto as nothing is > done there. > Yes, you are right. I will fix that in the next revision. Regards Suzuki From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Suzuki K. Poulose" Subject: Re: [PATCH 1/5] arm-cci: Rearrange code for splitting PMU vs driver code Date: Wed, 04 Mar 2015 12:16:49 +0000 Message-ID: <54F6F7B1.1020300@arm.com> References: <1425295754-13376-1-git-send-email-suzuki.poulose@arm.com> <1425295754-13376-2-git-send-email-suzuki.poulose@arm.com> <54F5D4B6.40409@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: 8BIT Return-path: In-Reply-To: <54F5D4B6.40409-5wv7dgnIgG8@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sudeep Holla , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" Cc: "nico-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org" , "b.zolnierkie-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org" , "kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "a.kesavan-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org" , "arnd-r2nGTMty4D4@public.gmane.org" , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Liviu Dudau , Lorenzo Pieralisi , Pawel Moll , "olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org" , Punit Agrawal , Will Deacon , Catalin Marinas List-Id: devicetree@vger.kernel.org On 03/03/15 15:35, Sudeep Holla wrote: > > > On 02/03/15 11:29, Suzuki K. Poulose wrote: >> From: "Suzuki K. Poulose" >> >> No functional changes, only code re-arrangements for easier split of the >> PMU code vs low level driver code. Extracts the port handling code >> to cci_probe_ports(). >> >> Signed-off-by: Suzuki K. Poulose >> --- >> drivers/bus/arm-cci.c | 330 +++++++++++++++++++++++++------------------------ >> 1 file changed, 168 insertions(+), 162 deletions(-) >> >> diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c >> index 84fd660..f27cf56 100644 >> --- a/drivers/bus/arm-cci.c >> +++ b/drivers/bus/arm-cci.c > > [...] > >> @@ -1395,11 +1412,36 @@ static int cci_probe(void) >> sync_cache_w(&cpu_port); >> __sync_cache_range_w(ports, sizeof(*ports) * nb_cci_ports); >> pr_info("ARM CCI driver probed\n"); >> + >> return 0; >> +} >> + >> +static int cci_probe(void) >> +{ >> + int ret; >> + struct device_node *np; >> + struct resource res; >> + >> + np = of_find_matching_node(NULL, arm_cci_matches); >> + if (!np) >> + return -ENODEV; >> >> -memalloc_err: >> + if (!of_device_is_available(np)) >> + return -ENODEV; >> + >> + ret = of_address_to_resource(np, 0, &res); >> + if (!ret) { >> + cci_ctrl_base = ioremap(res.start, resource_size(&res)); >> + cci_ctrl_phys = res.start; >> + } >> + if (ret || !cci_ctrl_base) { >> + WARN(1, "unable to ioremap CCI ctrl\n"); >> + ret = -ENXIO; >> + goto out; > > IMO you can return directly here and get rid of this goto as nothing is > done there. > Yes, you are right. I will fix that in the next revision. Regards Suzuki -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758714AbbCDMQz (ORCPT ); Wed, 4 Mar 2015 07:16:55 -0500 Received: from service87.mimecast.com ([91.220.42.44]:41816 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750830AbbCDMQx convert rfc822-to-8bit (ORCPT ); Wed, 4 Mar 2015 07:16:53 -0500 Message-ID: <54F6F7B1.1020300@arm.com> Date: Wed, 04 Mar 2015 12:16:49 +0000 From: "Suzuki K. Poulose" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Sudeep Holla , "linux-arm-kernel@lists.infradead.org" CC: "nico@linaro.org" , "b.zolnierkie@samsung.com" , "kgene@kernel.org" , "a.kesavan@samsung.com" , "arnd@arndb.de" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Liviu Dudau , Lorenzo Pieralisi , Pawel Moll , "olof@lixom.net" , Punit Agrawal , Will Deacon , Catalin Marinas Subject: Re: [PATCH 1/5] arm-cci: Rearrange code for splitting PMU vs driver code References: <1425295754-13376-1-git-send-email-suzuki.poulose@arm.com> <1425295754-13376-2-git-send-email-suzuki.poulose@arm.com> <54F5D4B6.40409@arm.com> In-Reply-To: <54F5D4B6.40409@arm.com> X-OriginalArrivalTime: 04 Mar 2015 12:16:50.0380 (UTC) FILETIME=[17C6A0C0:01D05675] X-MC-Unique: 115030412165102801 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/03/15 15:35, Sudeep Holla wrote: > > > On 02/03/15 11:29, Suzuki K. Poulose wrote: >> From: "Suzuki K. Poulose" >> >> No functional changes, only code re-arrangements for easier split of the >> PMU code vs low level driver code. Extracts the port handling code >> to cci_probe_ports(). >> >> Signed-off-by: Suzuki K. Poulose >> --- >> drivers/bus/arm-cci.c | 330 +++++++++++++++++++++++++------------------------ >> 1 file changed, 168 insertions(+), 162 deletions(-) >> >> diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c >> index 84fd660..f27cf56 100644 >> --- a/drivers/bus/arm-cci.c >> +++ b/drivers/bus/arm-cci.c > > [...] > >> @@ -1395,11 +1412,36 @@ static int cci_probe(void) >> sync_cache_w(&cpu_port); >> __sync_cache_range_w(ports, sizeof(*ports) * nb_cci_ports); >> pr_info("ARM CCI driver probed\n"); >> + >> return 0; >> +} >> + >> +static int cci_probe(void) >> +{ >> + int ret; >> + struct device_node *np; >> + struct resource res; >> + >> + np = of_find_matching_node(NULL, arm_cci_matches); >> + if (!np) >> + return -ENODEV; >> >> -memalloc_err: >> + if (!of_device_is_available(np)) >> + return -ENODEV; >> + >> + ret = of_address_to_resource(np, 0, &res); >> + if (!ret) { >> + cci_ctrl_base = ioremap(res.start, resource_size(&res)); >> + cci_ctrl_phys = res.start; >> + } >> + if (ret || !cci_ctrl_base) { >> + WARN(1, "unable to ioremap CCI ctrl\n"); >> + ret = -ENXIO; >> + goto out; > > IMO you can return directly here and get rid of this goto as nothing is > done there. > Yes, you are right. I will fix that in the next revision. Regards Suzuki