From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933266AbcGEQXr (ORCPT ); Tue, 5 Jul 2016 12:23:47 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:33251 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752322AbcGEQXi (ORCPT ); Tue, 5 Jul 2016 12:23:38 -0400 From: Ricardo Ribalda Delgado To: Michael Turquette , Stephen Boyd , s.hauer@pengutronix.de, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH v5 0/8] clk: Don't duplicate initialization on platform_dev Date: Tue, 5 Jul 2016 18:23:24 +0200 Message-Id: <1467735814-23518-1-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.8.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clock providers can be probed as a normal platform device, or via of_clk_init() before the rest of the platform devices are initialized using the CLK_OF_DECLARE() macro. If a driver required both initialization methodologies, the core would call both probe/init functions. This changeset prevent the dual initialization using the OF_POPULATE flag. It also creates a new macro, CLK_OF_DECLARE_DRIVER, used by drivers that require double initialization. Finally, it adds module platform driver initialization to fixed-factor and fixed-rate, enabling its use in dt overlays. The order of the patches allows future bisects of the change. This explains why Avoid double initialization of clocks() is done almost at the end. v5: Changes proposed by: Stephen Boyd -Create CLK_OF_DECLARE_DRIVER() macro -use it in clk-artpec6, sunxi,nxp v4: Huge MACRO(), not posted to the list v3: Use OF_POPULATE flag inside fixed-rate and fixed-factor v2: Changes proposed by: Stephen Boyd -Add error check -CodeStyle on of_device_ide -Use builtin_platform_driver() When clock providers are added to the device tree after of_clk_init is called they are not added to the clock provider list. This makes that drivers such as i2c-xiic.c fail to init, as they may depend on the unadded clock provider. Ricardo Ribalda Delgado (8): clk: core: New macro CLK_OF_DECLARE_DRIVER clk: axis: Use new macro CLK_OF_DECLARE_DRIVER clk: npx: Use new macro CLK_OF_DECLARE_DRIVER clk: sunxi: mod0: Use new macro CLK_OF_DECLARE_DRIVER clk: sunxi: apb0: Use new macro CLK_OF_DECLARE_DRIVER clk: core: Avoid double initialization of clocks clk: fixed-factor: Convert into a module platform driver clk: fixed-rate: Convert into a module platform driver drivers/clk/axis/clk-artpec6.c | 4 +-- drivers/clk/clk-fixed-factor.c | 72 +++++++++++++++++++++++++++++++++++--- drivers/clk/clk-fixed-rate.c | 69 +++++++++++++++++++++++++++++++++--- drivers/clk/clk.c | 4 +++ drivers/clk/nxp/clk-lpc18xx-creg.c | 3 +- drivers/clk/sunxi/clk-mod0.c | 3 +- drivers/clk/sunxi/clk-sun8i-apb0.c | 4 +-- include/linux/clk-provider.h | 12 +++++++ 8 files changed, 156 insertions(+), 15 deletions(-) -- 2.8.1