From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sylwester Nawrocki Subject: Re: [PATCH V2 1/6] clk: exynos-audss: convert to platform device Date: Tue, 24 Sep 2013 11:47:45 +0200 Message-ID: <52415FC1.4070400@samsung.com> References: <1379711637-5226-1-git-send-email-abrestic@chromium.org> <1379982078-23381-1-git-send-email-abrestic@chromium.org> <3549301.xmRx49e0Zc@amdc1227> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-reply-to: <3549301.xmRx49e0Zc@amdc1227> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Tomasz Figa Cc: Mark Rutland , linux-doc@vger.kernel.org, Padmavathi Venna , Andrew Bresticker , Tushar Behera , linux-samsung-soc@vger.kernel.org, Russell King , Leela Krishna Amudala , Ian Campbell , Grant Likely , devicetree@vger.kernel.org, Pawel Moll , Stephen Warren , Rob Herring , Kukjin Kim , Mike Turquette , Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org, Rahul Sharma , Jiri Kosina , Stephen Boyd , Doug Anderson , Sachin Kamat List-Id: devicetree@vger.kernel.org On 24/09/13 11:20, Tomasz Figa wrote: >> +static int exynos_audss_clk_remove(struct platform_device *pdev) >> +{ >> + int i; >> + >> + for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) { >> + if (clk_table[i]) > > I believe clk_register_* functions return ERR_PTR() in case of failure, > not NULL, so this should be accounted for either here or at probe time. > Possibly checking for registration error in probe() would be the best > solution, although bloating the code a bit (but what error path isn't?). After registering all clocks a loop iterating over all entries of the clk_table[] array could be added and if any of the entries is ERR_PTR() either an error could be just logged or the successfully registered clocks could be freed and probe() could fail. It doesn't really seems much additional code. -- Thanks, Sylwester