From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752053AbbIKIH6 (ORCPT ); Fri, 11 Sep 2015 04:07:58 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:35385 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751294AbbIKIHq (ORCPT ); Fri, 11 Sep 2015 04:07:46 -0400 Date: Fri, 11 Sep 2015 13:37:41 +0530 From: Viresh Kumar To: Bai Ping Cc: rjw@rjwysocki.net, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] cpufreq: imx: update the clock switch flow to support imx6ul Message-ID: <20150911080741.GJ9650@linux> References: <1441986065-8821-1-git-send-email-b51503@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1441986065-8821-1-git-send-email-b51503@freescale.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11-09-15, 23:41, Bai Ping wrote: > + if (of_machine_is_compatible("fsl,imx6ul")) { > + pll2_bus_clk = clk_get(cpu_dev, "pll2_bus"); > + secondary_sel_clk = clk_get(cpu_dev, "secondary_sel"); > + if (IS_ERR(pll2_bus_clk) || IS_ERR(secondary_sel_clk)) { > + dev_err(cpu_dev, "failed to get clocks specific to imx6ul\n"); > + ret = -ENOENT; > + goto put_clk; > + } > + } > + > arm_reg = regulator_get(cpu_dev, "arm"); > pu_reg = regulator_get_optional(cpu_dev, "pu"); > soc_reg = regulator_get(cpu_dev, "soc"); > @@ -331,6 +365,10 @@ put_clk: > clk_put(step_clk); > if (!IS_ERR(pll2_pfd2_396m_clk)) > clk_put(pll2_pfd2_396m_clk); > + if (!IS_ERR(pll2_bus_clk)) > + clk_put(pll2_bus_clk); > + if (!IS_ERR(secondary_sel_clk)) > + clk_put(secondary_sel_clk); > of_node_put(np); > return ret; > } As part of good coding practices, you should free resources in the reverse order to which they were allocated. The clocks don't follow that, but its not a problem with just your patch. That's how it is present today. Maybe you can write another patch to fix that. Acked-by: Viresh Kumar -- viresh