Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752687AbbDEIzL (ORCPT ); Sun, 5 Apr 2015 04:55:11 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:35091 "EHLO mail-ob0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752371AbbDEIzH (ORCPT ); Sun, 5 Apr 2015 04:55:07 -0400 MIME-Version: 1.0 In-Reply-To: <20150403170407.GA13898@n2100.arm.linux.org.uk> References: <1428064923-24950-1-git-send-email-geert+renesas@glider.be> <1428064923-24950-6-git-send-email-geert+renesas@glider.be> <20150403125727.GT10964@mwanda> <20150403170407.GA13898@n2100.arm.linux.org.uk> Date: Sun, 5 Apr 2015 10:55:06 +0200 X-Google-Sender-Auth: -iZb5CyUOJomohFhTVVs4iwKuZ4 Message-ID: Subject: Re: [PATCH/RFC 5/6] staging: board: Add support for devices with complex dependencies From: Geert Uytterhoeven To: Russell King - ARM Linux Cc: Dan Carpenter , Geert Uytterhoeven , driverdevel , "devicetree@vger.kernel.org" , Arnd Bergmann , Kuninori Morimoto , Linux PM list , Marc Zyngier , Greg Kroah-Hartman , Linux-sh list , Magnus Damm , "linux-kernel@vger.kernel.org" , Laurent Pinchart , Simon Horman , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2092 Lines: 54 Hi Russell, On Fri, Apr 3, 2015 at 7:04 PM, Russell King - ARM Linux wrote: > On Fri, Apr 03, 2015 at 03:57:27PM +0300, Dan Carpenter wrote: >> On Fri, Apr 03, 2015 at 02:42:02PM +0200, Geert Uytterhoeven wrote: >> > +int __init board_staging_register_clock(const struct board_staging_clk *bsc) >> > +{ >> > + struct clk *clk; >> > + int error; >> > + >> > + pr_debug("Registering clock %s for con_id %s dev_id %s\n", bsc->clk, >> > + bsc->con_id, bsc->dev_id); >> > + clk = clk_get(NULL, bsc->clk); >> > + if (IS_ERR(clk)) { >> > + error = PTR_ERR(clk); >> > + pr_err("Failed to get clock %s (%d)\n", bsc->clk, error); >> > + return error; >> > + } >> > + >> > + error = clk_register_clkdev(clk, bsc->con_id, bsc->dev_id); >> > + if (error) >> > + pr_err("Failed to register clock %s (%d)\n", bsc->clk, error); >> > + return error; >> >> Missing curly braces. Also it's weird that don't we need a clk_put() >> on the error patch as well as the success path? > > What's also concerning is that this is an abuse of this. > > clk_register_clkdev() is supposed to be used with clocks created with > the CCF functions, it's not for creating aliases. > > We have clk_add_alias() which does *everything* that this function does, > only in a less buggy way. Thanks, I didn't know about clk_add_alias(). I had based the above on long gone code under arch/arm/mach-shmobile to use platform devices with CCF. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/