From patchwork Fri Nov 2 12:34:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 10665401 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B166717D5 for ; Fri, 2 Nov 2018 12:35:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9623D2B25A for ; Fri, 2 Nov 2018 12:35:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 897B42B39F; Fri, 2 Nov 2018 12:35:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E5BC12B25A for ; Fri, 2 Nov 2018 12:35:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=S5QkwvOngfcHkuMK1z7i/6Y3XiY7hv0EnC3MQMWPQbo=; b=M4+op/Ke81VlEg JS8Q+WuNzHNkIykfRfNRG1cpib6wa2OM7kiC5+QVx4d1eTAaF0mv0u2g8SXDh3PtpQUiJr7i/Ksx/ YF8qEc4MQknnlnDOfDMD3OMpFyi8MKOGutIXtO70N1yx6xmOHM3oi6kveiGW4qDF/a1fxZApIn5t4 y94HqClp6L+kEeOg0LcvIoWngcpxjERyPfoc+FTgTSy98IT9x6rpf7CC5iS0E9qo0vYnu3GY9T+aL NWlPUTELxlVT8AlXWmsTLmHHYAs7VzL7xZ+KKJ0jZdDby5Jmlrfe6vJiQ7c4SmF58gjLH5a0gjgG2 DYtEEcjjZgb5h0nlm1mQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYff-00087O-Nh; Fri, 02 Nov 2018 12:35:27 +0000 Received: from mail-lf1-f66.google.com ([209.85.167.66]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYfa-0007BP-8N for linux-arm-kernel@lists.infradead.org; Fri, 02 Nov 2018 12:35:25 +0000 Received: by mail-lf1-f66.google.com with SMTP id n26-v6so1239322lfl.1 for ; Fri, 02 Nov 2018 05:35:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=i+KZ9+62AmBi6LwLI4MDe8trUcZvmkQ3tsEjwOIjYlM=; b=Vt9XZx0HbZjGiUI9GWzCzYMNIf2eEoWnotM0v8S4d1cIjs5lWX5wxgztmzs66eUBnj QpKsuGK2nJ+FudznNVvQRRLPVJm8Daoj6715YrUQKx6cINYjAqgGy0rzrq2W08dvtv5J xojbnPeHk2/1ZsmPhShKfRMasdbN4Ax1cYgnCn6+Vb3P5Gj8XnhKyR0nOQEVq50DedXJ 3CRWBXZxpGG/AK/Oc+3sltFAEFfKn+sEeEkjivaqelXw+Yqs1l/V0zNFyCwRvI2jTg/o pZp6zQLraG8bPC4bwAQLibfu2P4/w4TY+Tj5ej9Nzp1Cd5kQQ2vtQ39MLl44Te86X/fs ZgwA== X-Gm-Message-State: AGRZ1gJoWOKnrsd/a0mveHp5KDbjaUzVDrSEeNPO+uWZDFXINY3dgvv+ mL1+BDRZC/NxFt9qTydywXc= X-Google-Smtp-Source: AJdET5ekL+rqBiWy+f43HQiSZGs4Wf/P2izmKoxyjfRRn6q2+4yTzzfzbxxoEWw9VOQunRKqdgPNcg== X-Received: by 2002:a19:2906:: with SMTP id p6mr4801931lfp.17.1541162110450; Fri, 02 Nov 2018 05:35:10 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id m64-v6sm403821lfm.89.2018.11.02.05.35.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Nov 2018 05:35:09 -0700 (PDT) Date: Fri, 2 Nov 2018 14:34:55 +0200 From: Matti Vaittinen To: Jonathan Corbet , Michael Turquette , Stephen Boyd , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Russell King , Andy Gross , David Brown , Kukjin Kim , Sylwester Nawrocki , Tomasz Figa , Andrey Smirnov , Sebastian Reichel , Guenter Roeck , Rob Herring , Matti Vaittinen , Huang Shijie , Akshu Agrawal , "Rafael J. Wysocki" , Daniel Kurtz , mazziesaccount@gmail.com Subject: [PATCH v3 1/7] clk: clkdev/of_clk - add managed lookup and provider registrations Message-ID: <1ab16de50fe98a8cdbc0aebc8eced41d7c04f14d.1541161503.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181102_053522_298199_BF42E478 X-CRM114-Status: GOOD ( 23.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, matti.vaittinen@fi.rohmeurope.com, linux-kernel@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP With MFD devices the clk properties may be contained in MFD (parent) DT node. Current devm_of_clk_add_hw_provider assumes the clk is bound to MFD subdevice not to MFD device (parent). Add devm_of_clk_add_hw_provider_parent to tackle this issue. Also clkdev registration lacks of managed registration functions and it seems few drivers do not drop clkdev lookups at exit. Add devm_clk_hw_register_clkdev and devm_clk_release_clkdev to ease lookup releasing at exit. Signed-off-by: Matti Vaittinen --- Documentation/driver-model/devres.txt | 3 + drivers/clk/clk.c | 28 ++++++-- drivers/clk/clkdev.c | 122 ++++++++++++++++++++++++++-------- include/linux/clk-provider.h | 11 +++ include/linux/clkdev.h | 4 ++ 5 files changed, 136 insertions(+), 32 deletions(-) diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt index 43681ca0837f..fac63760b01c 100644 --- a/Documentation/driver-model/devres.txt +++ b/Documentation/driver-model/devres.txt @@ -238,6 +238,9 @@ CLOCK devm_clk_put() devm_clk_hw_register() devm_of_clk_add_hw_provider() + devm_of_clk_add_parent_hw_provider() + devm_clk_hw_register_clkdev() + devm_clk_release_clkdev() DMA dmaenginem_async_device_register() diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index af011974d4ec..9bb921eb90f6 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -3893,12 +3893,12 @@ static void devm_of_clk_release_provider(struct device *dev, void *res) of_clk_del_provider(*(struct device_node **)res); } -int devm_of_clk_add_hw_provider(struct device *dev, +static int __devm_of_clk_add_hw_provider(struct device *dev, struct clk_hw *(*get)(struct of_phandle_args *clkspec, void *data), - void *data) + struct device_node *of_node, void *data) { - struct device_node **ptr, *np; + struct device_node **ptr; int ret; ptr = devres_alloc(devm_of_clk_release_provider, sizeof(*ptr), @@ -3906,10 +3906,9 @@ int devm_of_clk_add_hw_provider(struct device *dev, if (!ptr) return -ENOMEM; - np = dev->of_node; - ret = of_clk_add_hw_provider(np, get, data); + *ptr = of_node; + ret = of_clk_add_hw_provider(of_node, get, data); if (!ret) { - *ptr = np; devres_add(dev, ptr); } else { devres_free(ptr); @@ -3917,8 +3916,25 @@ int devm_of_clk_add_hw_provider(struct device *dev, return ret; } +int devm_of_clk_add_hw_provider(struct device *dev, + struct clk_hw *(*get)(struct of_phandle_args *clkspec, + void *data), + void *data) +{ + return __devm_of_clk_add_hw_provider(dev, get, dev->of_node, data); +} EXPORT_SYMBOL_GPL(devm_of_clk_add_hw_provider); +int devm_of_clk_add_parent_hw_provider(struct device *dev, + struct clk_hw *(*get)(struct of_phandle_args *clkspec, + void *data), + void *data) +{ + return __devm_of_clk_add_hw_provider(dev, get, dev->parent->of_node, + data); +} +EXPORT_SYMBOL_GPL(devm_of_clk_add_parent_hw_provider); + /** * of_clk_del_provider() - Remove a previously registered clock provider * @np: Device node pointer associated with clock provider diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index 9ab3db8b3988..f6100b6e06fd 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c @@ -401,6 +401,25 @@ static struct clk_lookup *__clk_register_clkdev(struct clk_hw *hw, return cl; } +static int do_clk_register_clkdev(struct clk_hw *hw, + struct clk_lookup **cl, const char *con_id, const char *dev_id) +{ + + if (IS_ERR(hw)) + return PTR_ERR(hw); + /* + * Since dev_id can be NULL, and NULL is handled specially, we must + * pass it as either a NULL format string, or with "%s". + */ + if (dev_id) + *cl = __clk_register_clkdev(hw, con_id, "%s", + dev_id); + else + *cl = __clk_register_clkdev(hw, con_id, NULL); + + return *cl ? 0 : -ENOMEM; +} + /** * clk_register_clkdev - register one clock lookup for a struct clk * @clk: struct clk to associate with all clk_lookups @@ -420,20 +439,10 @@ int clk_register_clkdev(struct clk *clk, const char *con_id, { struct clk_lookup *cl; - if (IS_ERR(clk)) - return PTR_ERR(clk); - - /* - * Since dev_id can be NULL, and NULL is handled specially, we must - * pass it as either a NULL format string, or with "%s". - */ - if (dev_id) - cl = __clk_register_clkdev(__clk_get_hw(clk), con_id, "%s", - dev_id); - else - cl = __clk_register_clkdev(__clk_get_hw(clk), con_id, NULL); - - return cl ? 0 : -ENOMEM; + if (!IS_ERR(clk)) + return do_clk_register_clkdev(__clk_get_hw(clk), &cl, con_id, + dev_id); + return PTR_ERR(clk); } EXPORT_SYMBOL(clk_register_clkdev); @@ -456,18 +465,79 @@ int clk_hw_register_clkdev(struct clk_hw *hw, const char *con_id, { struct clk_lookup *cl; - if (IS_ERR(hw)) - return PTR_ERR(hw); + return do_clk_register_clkdev(hw, &cl, con_id, dev_id); +} +EXPORT_SYMBOL(clk_hw_register_clkdev); - /* - * Since dev_id can be NULL, and NULL is handled specially, we must - * pass it as either a NULL format string, or with "%s". - */ - if (dev_id) - cl = __clk_register_clkdev(hw, con_id, "%s", dev_id); - else - cl = __clk_register_clkdev(hw, con_id, NULL); +static void devm_clkdev_release(struct device *dev, void *res) +{ + clkdev_drop(*(struct clk_lookup **)res); +} - return cl ? 0 : -ENOMEM; +static int devm_clk_match_clkdev(struct device *dev, void *res, void *data) +{ + struct clk_lookup **l = res; + + if (!l || !*l) { + WARN_ON(!l || !*l); + return 0; + } + return *l == data; } -EXPORT_SYMBOL(clk_hw_register_clkdev); + +/** + * devm_clk_release_clkdev - Resource managed clkdev lookup release + * @dev: device this lookup is bound + * @con_id: connection ID string on device + * @dev_id: format string describing device name + * + * Drop the clkdev lookup created with devm_clk_hw_register_clkdev. + * Normally this function will not need to be called and the resource + * management code will ensure that the resource is freed. + */ +void devm_clk_release_clkdev(struct device *dev, const char *con_id, + const char *dev_id) +{ + struct clk_lookup *cl; + int rval; + + cl = clk_find(dev_id, con_id); + WARN_ON(!cl); + rval = devres_release(dev, devm_clkdev_release, + &devm_clk_match_clkdev, cl); + WARN_ON(rval); +} +EXPORT_SYMBOL(devm_clk_release_clkdev); + +/** + * devm_clk_hw_register_clkdev - managed clk lookup registration for clk_hw + * @dev: device this lookup is bound + * @hw: struct clk_hw to associate with all clk_lookups + * @con_id: connection ID string on device + * @dev_id: format string describing device name + * + * con_id or dev_id may be NULL as a wildcard, just as in the rest of + * clkdev. + * + * To make things easier for mass registration, we detect error clk_hws + * from a previous clk_hw_register_*() call, and return the error code for + * those. This is to permit this function to be called immediately + * after clk_hw_register_*(). + */ +int devm_clk_hw_register_clkdev(struct device *dev, struct clk_hw *hw, + const char *con_id, const char *dev_id) +{ + int rval = -ENOMEM; + struct clk_lookup **cl; + + cl = devres_alloc(devm_clkdev_release, sizeof(*cl), GFP_KERNEL); + if (cl) { + rval = do_clk_register_clkdev(hw, cl, con_id, dev_id); + if (!rval) + devres_add(dev, cl); + else + devres_free(cl); + } + return rval; +} +EXPORT_SYMBOL(devm_clk_hw_register_clkdev); diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 60c51871b04b..a6663f084cf1 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -916,6 +916,10 @@ int devm_of_clk_add_hw_provider(struct device *dev, struct clk_hw *(*get)(struct of_phandle_args *clkspec, void *data), void *data); +int devm_of_clk_add_parent_hw_provider(struct device *dev, + struct clk_hw *(*get)(struct of_phandle_args *clkspec, + void *data), + void *data); void of_clk_del_provider(struct device_node *np); void devm_of_clk_del_provider(struct device *dev); struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, @@ -953,6 +957,13 @@ static inline int devm_of_clk_add_hw_provider(struct device *dev, { return 0; } +static inline int devm_of_clk_add_parent_hw_provider(struct device *dev, + struct clk_hw *(*get)(struct of_phandle_args *clkspec, + void *data), + void *data) +{ + return 0; +} static inline void of_clk_del_provider(struct device_node *np) {} static inline void devm_of_clk_del_provider(struct device *dev) {} static inline struct clk *of_clk_src_simple_get( diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h index 4890ff033220..ccb32af5848b 100644 --- a/include/linux/clkdev.h +++ b/include/linux/clkdev.h @@ -52,4 +52,8 @@ int clk_add_alias(const char *, const char *, const char *, struct device *); int clk_register_clkdev(struct clk *, const char *, const char *); int clk_hw_register_clkdev(struct clk_hw *, const char *, const char *); +int devm_clk_hw_register_clkdev(struct device *dev, struct clk_hw *hw, + const char *con_id, const char *dev_id); +void devm_clk_release_clkdev(struct device *dev, const char *con_id, + const char *dev_id); #endif From patchwork Fri Nov 2 12:35:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 10665409 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E03D317D5 for ; Fri, 2 Nov 2018 12:36:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7D232B3AF for ; Fri, 2 Nov 2018 12:36:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BAC332B3BA; Fri, 2 Nov 2018 12:36:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6FB5A2B3AF for ; Fri, 2 Nov 2018 12:36:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5roY6ddPA04HjK+bqcMgpSafoJdNGOP9MmuvfTvrX+8=; b=oAgK2ovx/pyvLX Zm4LDPHWFV+s+/2oDp3qpoagAST9JlvJ0+axGQR5uxzlThtEkydvfYe9w0qEWGUADdJw9riZhwC3g u/9nkKC4N5exNjD6RSZibmPsUDDbO0i4Trj7ByiUzf2b2rlAcixTYDGh18/e7+wXVVDnWm5I3gZoq Uzi0ST/jPVyGar57J8hXSpOjlEofnPVUsvQlxprNI7/MWNgMjLsQu7PkvG6ughfMevY3AyQeZjGhv +NZgjJ+2MBtoN7WQlKtbVS6RJJ0xlOiT1yUW93Yy9hPJy+etdAsiKK9tDSp5a8bzcTcdmV9y9teDU t2iOYYgF9YORKRTQHeCQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYgT-0008Sq-ED; Fri, 02 Nov 2018 12:36:17 +0000 Received: from mail-lf1-f66.google.com ([209.85.167.66]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYgQ-0008RB-S8 for linux-arm-kernel@lists.infradead.org; Fri, 02 Nov 2018 12:36:16 +0000 Received: by mail-lf1-f66.google.com with SMTP id o2-v6so1203415lfl.13 for ; Fri, 02 Nov 2018 05:36:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Y5x+Ok5Ed4t9w7g5J7qXI1OurGBp0O2MAJGG1HebFLU=; b=oK/Fx/lVLp4L5rIw4gRyHoVunUnT5jOga5c4VgWND+/0XOi5WPRZSx1RG30QvNt15g 9AsYUy/0OhoLIu2SKHYero6H5JqoyQFQGyipZJAyjFQgvsHVpehSuS+74I2BU6nLPA1r 0mWO69+6HScF0Z5WRJEBDjGIyBMLgD1/DU6Nwh72y9AQIiY4KrONqi/3oyCXy2Dzpdco A22GUqxlf8SOE90cxdLSl+JxZAdAygsnk0mIHsBbqv7UhWwgxEr2k/UiQAdFHMUg+CUa oIgXfc+6XO1PMSFfgqNaUvoL3F8lhXFgLRz2581MoelheFQ1Ov3hcCSrO4BZynjkk1W0 KOmw== X-Gm-Message-State: AGRZ1gK4PouL7eQsOG8nKeJWM7k9Kn/fvalkF50RZsdZXveADFsQwXS+ CAy+AZ9yR4f/X7DdUBKmR94= X-Google-Smtp-Source: AJdET5dlM7Gl67fYKCTdLIuaFdbAX7CuFNVR37Z6KObOdFlosdpkknsAqp9MQje21OG0cpsW28nYRQ== X-Received: by 2002:a19:48d0:: with SMTP id v199mr6949047lfa.104.1541162163233; Fri, 02 Nov 2018 05:36:03 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id a63-v6sm5537119ljf.54.2018.11.02.05.36.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Nov 2018 05:36:02 -0700 (PDT) Date: Fri, 2 Nov 2018 14:35:49 +0200 From: Matti Vaittinen To: Jonathan Corbet , Michael Turquette , Stephen Boyd , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Russell King , Andy Gross , David Brown , Kukjin Kim , Sylwester Nawrocki , Tomasz Figa , Andrey Smirnov , Sebastian Reichel , Guenter Roeck , Rob Herring , Matti Vaittinen , Huang Shijie , Akshu Agrawal , "Rafael J. Wysocki" , Daniel Kurtz , mazziesaccount@gmail.com Subject: [PATCH v3 2/7] clk: clk-max77686: Clean clkdev lookup leak and use devm Message-ID: <0be8b4ce5554e8539a458cc6152facc88a3e1804.1541161503.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181102_053614_906172_4DFD370B X-CRM114-Status: GOOD ( 17.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, matti.vaittinen@fi.rohmeurope.com, linux-kernel@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP clk-max77686 never clean clkdev lookup at remove. This can cause oops if clk-max77686 is removed and inserted again. Fix leak by using new devm clkdev lookup registration. Simplify also error path by using new devm_of_clk_add_parent_hw_provider. Signed-off-by: Matti Vaittinen Reviewed-by: Krzysztof Kozlowski --- drivers/clk/clk-max77686.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c index 02551fe4b87c..51a46179f6f8 100644 --- a/drivers/clk/clk-max77686.c +++ b/drivers/clk/clk-max77686.c @@ -235,8 +235,9 @@ static int max77686_clk_probe(struct platform_device *pdev) return ret; } - ret = clk_hw_register_clkdev(&max_clk_data->hw, - max_clk_data->clk_idata.name, NULL); + ret = devm_clk_hw_register_clkdev(dev, &max_clk_data->hw, + max_clk_data->clk_idata.name, + NULL); if (ret < 0) { dev_err(dev, "Failed to clkdev register: %d\n", ret); return ret; @@ -244,8 +245,9 @@ static int max77686_clk_probe(struct platform_device *pdev) } if (parent->of_node) { - ret = of_clk_add_hw_provider(parent->of_node, of_clk_max77686_get, - drv_data); + ret = devm_of_clk_add_parent_hw_provider(dev, + of_clk_max77686_get, + drv_data); if (ret < 0) { dev_err(dev, "Failed to register OF clock provider: %d\n", @@ -261,27 +263,11 @@ static int max77686_clk_probe(struct platform_device *pdev) 1 << MAX77802_CLOCK_LOW_JITTER_SHIFT); if (ret < 0) { dev_err(dev, "Failed to config low-jitter: %d\n", ret); - goto remove_of_clk_provider; + return ret; } } return 0; - -remove_of_clk_provider: - if (parent->of_node) - of_clk_del_provider(parent->of_node); - - return ret; -} - -static int max77686_clk_remove(struct platform_device *pdev) -{ - struct device *parent = pdev->dev.parent; - - if (parent->of_node) - of_clk_del_provider(parent->of_node); - - return 0; } static const struct platform_device_id max77686_clk_id[] = { @@ -297,7 +283,6 @@ static struct platform_driver max77686_clk_driver = { .name = "max77686-clk", }, .probe = max77686_clk_probe, - .remove = max77686_clk_remove, .id_table = max77686_clk_id, }; From patchwork Fri Nov 2 12:36:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 10665417 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C087214E2 for ; Fri, 2 Nov 2018 12:36:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6EF72B3C8 for ; Fri, 2 Nov 2018 12:36:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 952BA2B3D8; Fri, 2 Nov 2018 12:36:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4C7132B3C8 for ; Fri, 2 Nov 2018 12:36:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YX7Qq+bZ3x2DU+p/Er8NbB7nz53k+0Ud/2ekuIcEckM=; b=JOczF+blgD2fio 7YKnm8J7WmTutUvt942MH7DIUJ0ZaC8Kndm2+ocqWjukWn4v5wUpGiXSatJTJ3/h3+gJzaUiR9+8e 9sf04BgR01AffIkyLMt1GaTOUGDsvtTS7PZYE7eAspjRWi8sW0AiX/a9wxKw05u6Mwo9j6kPUzO3M Z7iHaDSwFFFT4HFaylGXhCdqtMMGw8DIUvCZ1lEH+1s/fOFAwCj0y8HDn6QVU2qWWKWS4Q0xjqlWo KxDH4PGWWcvISUZuOw0IG5V5Y7vcJN+/aH+p0LNP31EHF6Vz3yA4ZC/NOs3VJR1IpG3WcK9QgNkCH P/d8m+IuLPguX7Rm2t0w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYh1-0000Lr-KW; Fri, 02 Nov 2018 12:36:51 +0000 Received: from mail-lf1-f68.google.com ([209.85.167.68]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYgu-0000HC-Tk for linux-arm-kernel@lists.infradead.org; Fri, 02 Nov 2018 12:36:49 +0000 Received: by mail-lf1-f68.google.com with SMTP id o2-v6so1204449lfl.13 for ; Fri, 02 Nov 2018 05:36:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=XHBuXIz+/k/o9sHwadx6Xj4e5igjCAket6IT5Fa5bu0=; b=bJeaWu3yDLUicEd0dSkKgIajOIiUxX0Fj7O9X0oZJ+DK+SqojinEu5vOKOi5VQdECh W4yhi/gbGlTEsqX8+5MHijMZfv91tpYmgnaQCikRPT33tEOqGiBye20bt2d13D/o1VNB PULHkC25H7movYtzGQUnV2eL7hltBX3S2zqi5nC7Qp2e+7gxfVcyHJksf6ew0VoppNX+ T8NGAlFfoP1H4h8Q+xyF+82PlWBu88h1Uht9vxrxp/XcIdo2zHeCK4BMHNdQaoblMDFV b+dbzwjF/UvQTKQtbkGhT/Srs7q5gjg5H/7C8We87FoKTutZhT9qYvq1e6G3LQ+Mzi3D NFNw== X-Gm-Message-State: AGRZ1gJAEdxLczmOZvhTMIQSzpzXAbQieXg5DjocCxH4zYOCNMiKa35E yrlWG5l6MT7VUE2f+Ghevuk= X-Google-Smtp-Source: AJdET5f98WmhOgjNCCnLbQqOo8CLgXCsjGIuZLUhIOODJZO3xhN5eWHpj2rx7Fh8LSIu5G+mG87uzw== X-Received: by 2002:a19:d04f:: with SMTP id h76mr6541421lfg.52.1541162193044; Fri, 02 Nov 2018 05:36:33 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id t77-v6sm5708146lfi.63.2018.11.02.05.36.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Nov 2018 05:36:32 -0700 (PDT) Date: Fri, 2 Nov 2018 14:36:20 +0200 From: Matti Vaittinen To: Jonathan Corbet , Michael Turquette , Stephen Boyd , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Russell King , Andy Gross , David Brown , Kukjin Kim , Sylwester Nawrocki , Tomasz Figa , Andrey Smirnov , Sebastian Reichel , Guenter Roeck , Rob Herring , Matti Vaittinen , Huang Shijie , Akshu Agrawal , "Rafael J. Wysocki" , Daniel Kurtz , mazziesaccount@gmail.com Subject: [PATCH v3 3/7] clk: clk-st: avoid clkdev lookup leak at remove Message-ID: <5f79250d8055016b3a3c815e478ece889b8f80d2.1541161503.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181102_053645_036341_4F87B68F X-CRM114-Status: GOOD ( 15.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, matti.vaittinen@fi.rohmeurope.com, linux-kernel@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm based clkdev lookup registration to avoid leaking lookup structures. Signed-off-by: Matti Vaittinen --- drivers/clk/x86/clk-st.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/x86/clk-st.c b/drivers/clk/x86/clk-st.c index fb62f3938008..32d8df9bd853 100644 --- a/drivers/clk/x86/clk-st.c +++ b/drivers/clk/x86/clk-st.c @@ -52,7 +52,8 @@ static int st_clk_probe(struct platform_device *pdev) 0, st_data->base + MISCCLKCNTL1, OSCCLKENB, CLK_GATE_SET_TO_DISABLE, NULL); - clk_hw_register_clkdev(hws[ST_CLK_GATE], "oscout1", NULL); + devm_clk_hw_register_clkdev(&pdev->dev, hws[ST_CLK_GATE], "oscout1", + NULL); return 0; } From patchwork Fri Nov 2 12:36:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 10665427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 475C617D5 for ; Fri, 2 Nov 2018 12:37:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F25C2B3D6 for ; Fri, 2 Nov 2018 12:37:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22EF92B3E2; Fri, 2 Nov 2018 12:37:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C56552B3D6 for ; Fri, 2 Nov 2018 12:37:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/QpH8HecrNR1pLzLREtiGkpldbGFuuAbIQrkjJyF/58=; b=TwTckAf3CMJ+wq wZacnKhuoa4Ihq0qVTt+uJw2fU2VRdIrcDen0OYytvOx2QymccQV7CMbyazVDzrPd8U4h8ohsNsRU hjddMcfWst+ElduCNcEn988je2w7D/p9hZDw/+jqYz0Ot+zdLSxqI5O2VwWUJCK1v/fU+w+jILqmW +Rk5/zEBRUWgj1rKxkpB0ew9rxaXGHdkbUfqZn+sBkrSJRMdHmGPDunzqwLkR3mP+wnWTbDpcW/PL vDOr26puzPiaERqfU0V97pfJ+2ZeIy8kYfOQ42YfEwU6f5GrFgY9N+r8ttxydFDQKPH2o3EDeFGSe wPqZ3WKw6RM1wLkTruHA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYhQ-0000wP-JF; Fri, 02 Nov 2018 12:37:16 +0000 Received: from mail-lj1-f195.google.com ([209.85.208.195]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYhH-0000SN-Kp for linux-arm-kernel@lists.infradead.org; Fri, 02 Nov 2018 12:37:14 +0000 Received: by mail-lj1-f195.google.com with SMTP id u6-v6so1630903ljd.1 for ; Fri, 02 Nov 2018 05:36:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GkHc1XDfS2zAEG1O6tNrzFVGgOycf/0Y3wU3cQalzu0=; b=U3MQqTcn/Zox33hGxof05z5waRHKebS7e6btMjErq/Z7DvHrSTMJOYtzb4hBHgdhms wAh3w96r9ThhkkMBBj3UJbj0iL0z8xU2plsxQ0+j5pDxLlKs5RC3lnaE0Z6IxhoHfF/z 0TEup2FoiaO2u5utE7sY0pqkrXd5xuUnWxfOB9IsRM6L1CN/2ql8XFdZt2/+vjO6Xcea x7ojmnkQaiD+P5yJIciHXocyxbwBl+YFayvYUklTvrQ6uRzs7n68xR2mGcSLERSJgenw Ixnl056+pMf2CJiTZr1LOMAPSh2+SAXLjdNIkE8RLlqQAIlgDrXkJAcdnM1iAQksZDCn 6pOA== X-Gm-Message-State: AGRZ1gKDUnyb6pPCLU+NG5MpiXV/D9Q8T5UI4/cveMEH9yOO7oMscj6u KIgrpjRS30qyaPf9JW49K5I= X-Google-Smtp-Source: AJdET5dhkQJ4jFduLKkaHHDNMMXHLuYY6WY03oYUynBUpLEg/UFwtz/6PJeLj3M6DtVoCDXnQnipaQ== X-Received: by 2002:a2e:9ad0:: with SMTP id p16-v6mr8148863ljj.102.1541162215626; Fri, 02 Nov 2018 05:36:55 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id j66-v6sm5641477ljb.45.2018.11.02.05.36.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Nov 2018 05:36:55 -0700 (PDT) Date: Fri, 2 Nov 2018 14:36:42 +0200 From: Matti Vaittinen To: Jonathan Corbet , Michael Turquette , Stephen Boyd , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Russell King , Andy Gross , David Brown , Kukjin Kim , Sylwester Nawrocki , Tomasz Figa , Andrey Smirnov , Sebastian Reichel , Guenter Roeck , Rob Herring , Matti Vaittinen , Huang Shijie , Akshu Agrawal , "Rafael J. Wysocki" , Daniel Kurtz , mazziesaccount@gmail.com Subject: [PATCH v3 4/7] clk: clk-hi655x: Free of_provider at remove Message-ID: <0f66b67315e67192ada302304e2d133fff4989f9.1541161503.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181102_053708_361950_50BECDF2 X-CRM114-Status: GOOD ( 15.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, matti.vaittinen@fi.rohmeurope.com, linux-kernel@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP use devm variant for of_provider registration so provider is freed at exit. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-hi655x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-hi655x.c b/drivers/clk/clk-hi655x.c index 403a0188634a..394d0109104d 100644 --- a/drivers/clk/clk-hi655x.c +++ b/drivers/clk/clk-hi655x.c @@ -107,8 +107,8 @@ static int hi655x_clk_probe(struct platform_device *pdev) if (ret) return ret; - return of_clk_add_hw_provider(parent->of_node, of_clk_hw_simple_get, - &hi655x_clk->clk_hw); + return devm_of_clk_add_parent_hw_provider(&pdev->dev, + of_clk_hw_simple_get, &hi655x_clk->clk_hw); } static struct platform_driver hi655x_clk_driver = { From patchwork Fri Nov 2 12:37:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 10665435 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 209C517D5 for ; Fri, 2 Nov 2018 12:37:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 095DE2B245 for ; Fri, 2 Nov 2018 12:37:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F17572B3D8; Fri, 2 Nov 2018 12:37:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B2912B245 for ; Fri, 2 Nov 2018 12:37:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=u4NgRMFJFa0TfBza8StczUhLEE0Y2X4iOZYPVqRRx4A=; b=rbaUZMEG5DzrxS FPwa822LkVAUoymlP4Eer9O+fW1X6haIlpBQUV3siKqMqtXnCGFZ7WgH3ncJ0qyyTvTiKUkFth5dH oJ0j0aM1PkAl2c6VnZze15ZrIhyT2OmuY9UTTOkhqRmMl8EtbZbvJ3ovzLeIwPxZ1/QN24QIMLx8W pEUOEKYUEoVtT1bm/vyUFs7j5NZMvijWWQwJWcMz008vpwbLz1KksV5oSBMEw1oTpxxuLG9dUG/0t mTcGCM9fkjBZImiLmS2QtvR/LLHwuytP+q7inhi29kYiyrSg4iK8jirComwl9/IaxHvJuAJ3ymzs8 7VDEkCqg7ViTD+mOrPwA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYhv-0001Nk-1j; Fri, 02 Nov 2018 12:37:47 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYhs-0001LH-TG for linux-arm-kernel@bombadil.infradead.org; Fri, 02 Nov 2018 12:37:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4b7mWWvbRMSl/BrY6BXSv/3823MeAc6TDJ2DxbTG2QU=; b=aar7YaEkfq3CNKNMiaTgZOjWh E6ueNu2s1h/U9HPWeLDf9jeI3c2gBrDDjbhRh2LaAqWybCVDFIrEdkZLj5r5xqgtY/cqhA89NoDgP gTMgMJ8xBfL54K2yCnNqZCMgVu5e9x2PQyizGiAs0YPMHS9oB4WZ3Bz/Q3m3rm79ywRDhJ4s9LGh9 fnAB+dZpU4Izf9LjCvPX9GTYzhM5tXa4VrJk6PV4r4cPbNbwCXu7BzO12y1xaBtKErqtHpVOifmO4 f64HqBFXS/hgV2R202bYo0L/tknhdB75HHomg7fIYdK4yAmg4psbUjkhIYjrSb1eJTb8wRPHAoJIB K8i+10Y0A==; Received: from mail-lf1-f66.google.com ([209.85.167.66]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYho-0002NC-7g for linux-arm-kernel@lists.infradead.org; Fri, 02 Nov 2018 12:37:43 +0000 Received: by mail-lf1-f66.google.com with SMTP id d7-v6so1240693lfi.2 for ; Fri, 02 Nov 2018 05:37:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4b7mWWvbRMSl/BrY6BXSv/3823MeAc6TDJ2DxbTG2QU=; b=Q8bkA60yzpXcf4svqzRGdkYRI92vK8+AyuOXw719N6qb+GdqLpvelw3P/6LNh5uhQ+ e4WtGPNNvk0DYaXYGIQRvdCo66T1kHLaLJfrYqq3wah2tVlLV3g4zE8WtHI9GPCMbVuf jrUVMrmAlsd2DLllFo72wefHb0aRd2ZFB6vPHYEsCPYIeE1ouD/EibEqMhj+uS6Xlerf e8sj09iQ7z11+As9wqZANOk3PMmwZ7AENA8/iaQpXDkC8S0/cvqkT+0wqnYDWSyqLiCI idP/810S+dgXk2gSpyGKSGqZFf9GSaxzOKPpOus9Ai/EhbmNGzUbwvmWZlByMZG0wYd4 k89A== X-Gm-Message-State: AGRZ1gItQr5WxJV1ErUJI10Pg037Q351tWZHKpXyE20SD1MW8/WEuj5V u2xwRmUPnHka7cnkD7dc1hw= X-Google-Smtp-Source: AJdET5ey2hQGFTMu+Rc2Rtu+S/newd6zf17RtA9SMIAuBBhpOQg4DfiVCl26dLZMvX6mlbt7D/wc7w== X-Received: by 2002:a19:c396:: with SMTP id t144mr6633017lff.110.1541162248798; Fri, 02 Nov 2018 05:37:28 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id a9sm2639656lfi.57.2018.11.02.05.37.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Nov 2018 05:37:28 -0700 (PDT) Date: Fri, 2 Nov 2018 14:37:14 +0200 From: Matti Vaittinen To: Jonathan Corbet , Michael Turquette , Stephen Boyd , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Russell King , Andy Gross , David Brown , Kukjin Kim , Sylwester Nawrocki , Tomasz Figa , Andrey Smirnov , Sebastian Reichel , Guenter Roeck , Rob Herring , Matti Vaittinen , Huang Shijie , Akshu Agrawal , "Rafael J. Wysocki" , Daniel Kurtz , mazziesaccount@gmail.com Subject: [PATCH v3 5/7] clk: rk808: use managed version of of_provider registration Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181102_123740_366437_82B0FC92 X-CRM114-Status: GOOD ( 18.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, matti.vaittinen@fi.rohmeurope.com, linux-kernel@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Simplify clean-up for rk808 by using managed version of of_provider registration. Signed-off-by: Matti Vaittinen --- drivers/clk/clk-rk808.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/clk/clk-rk808.c b/drivers/clk/clk-rk808.c index 6461f2820a5b..177340edaae5 100644 --- a/drivers/clk/clk-rk808.c +++ b/drivers/clk/clk-rk808.c @@ -138,23 +138,12 @@ static int rk808_clkout_probe(struct platform_device *pdev) if (ret) return ret; - return of_clk_add_hw_provider(node, of_clk_rk808_get, rk808_clkout); -} - -static int rk808_clkout_remove(struct platform_device *pdev) -{ - struct rk808 *rk808 = dev_get_drvdata(pdev->dev.parent); - struct i2c_client *client = rk808->i2c; - struct device_node *node = client->dev.of_node; - - of_clk_del_provider(node); - - return 0; + return devm_of_clk_add_parent_hw_provider(&pdev->dev, + of_clk_rk808_get, rk808_clkout); } static struct platform_driver rk808_clkout_driver = { .probe = rk808_clkout_probe, - .remove = rk808_clkout_remove, .driver = { .name = "rk808-clkout", }, From patchwork Fri Nov 2 12:37:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 10665443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E755714E2 for ; Fri, 2 Nov 2018 12:38:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF6092818E for ; Fri, 2 Nov 2018 12:38:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFEF72B3DC; Fri, 2 Nov 2018 12:38:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7AD092818E for ; Fri, 2 Nov 2018 12:38:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AV/0q8ofR4yyrilKKmOSW3f08L1jPC1DPcp2W27Z5ro=; b=p24PPUgnTJNJMH 6/u2Qb68H+0oXSD89qrdHJY6q6rTQalhHKIyC3RgC0GSliEHAa5bHyyoJwwnEbP+lNrkGK49h2SRZ yn33xJAX60bofr5BI2SZNhoRDxYAcWx8uiREnIbnSCaDBcD91YJuhQeF2BLOAW3f04l+BBY3owibp fDCn97FhxcTVzBtHmR48NyCcVSYsrRNdJFecvhE70GCBO7PjowjH8mizO7t1p2Or2i9QqzzHzRDnB jszy66d0oOLUGBhqWzA3S6QQ9FAFGs40KbQ6jd2XnO8jrV6czT5XBAeHMprxvXXxBbOQ4q6j/sIti xTq3kZr7WHZZqKr308Yw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYiZ-0001zN-17; Fri, 02 Nov 2018 12:38:27 +0000 Received: from mail-lj1-f193.google.com ([209.85.208.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYiW-0001rR-5U for linux-arm-kernel@lists.infradead.org; Fri, 02 Nov 2018 12:38:25 +0000 Received: by mail-lj1-f193.google.com with SMTP id g26-v6so1592861lja.10 for ; Fri, 02 Nov 2018 05:38:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+s3r/08+Ga/YxLK3dh6bw5wWfEcqvsWpac0ppTzEu1E=; b=JEA8nI6bXePjOTLKlWdg3i8ZVdz23cdy1Qj6T/Vz1khBvbh2Gvfvk4TlEO+lsAjYpI teFlPIEWonPAcUqkaUP79UmuvdBUVN8P58QVBvmIPF41fUVfv+rQOGljjhUqo0/cvQOE 0/xokrcuAZkSgVnRz3Xh5LglhWdG3oImcBIs38i1gqzx3QSgAsTNOfKbNwlESUsSTe2l sehcJwS07nomPb/ERobHxYdQhe8rz5RoSwSUrRr1Bi6zIFdsArWoUxXvckV90SEZiwsy yrBSOGBiMIHOiHj/5z1FZjX05TouZ9/I6LkuXivYR7KDW+KguwYS0HhQZSYLvayMtZt5 sm5g== X-Gm-Message-State: AGRZ1gLTXZovqimBnrWRXoErdg+seJ6fBxqSJphoNq2MY7gu6gBywila indzkrP+b1xIeGBuym+nTc1jgJ6Dv10= X-Google-Smtp-Source: AJdET5dyI91CdFj4DIaV7N3G9PaIKfCXsdJECg4xdUCO3IiKDOsNO4UkznNkquewRrPj9d2c3cMI5A== X-Received: by 2002:a2e:9783:: with SMTP id y3-v6mr7533376lji.167.1541162292222; Fri, 02 Nov 2018 05:38:12 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id k21-v6sm454793ljc.15.2018.11.02.05.38.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Nov 2018 05:38:11 -0700 (PDT) Date: Fri, 2 Nov 2018 14:37:58 +0200 From: Matti Vaittinen To: Jonathan Corbet , Michael Turquette , Stephen Boyd , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Russell King , Andy Gross , David Brown , Kukjin Kim , Sylwester Nawrocki , Tomasz Figa , Andrey Smirnov , Sebastian Reichel , Guenter Roeck , Rob Herring , Matti Vaittinen , Huang Shijie , Akshu Agrawal , "Rafael J. Wysocki" , Daniel Kurtz , mazziesaccount@gmail.com Subject: [PATCH v3 6/7] clk: clk-twl6040: Free of_provider at remove Message-ID: <855d60c35f092de196b131838fe0b07e9d3080d3.1541161503.git.matti.vaittinen@fi.rohmeurope.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181102_053824_204270_B415F7F4 X-CRM114-Status: GOOD ( 15.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, matti.vaittinen@fi.rohmeurope.com, linux-kernel@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP use devm variant for of_provider registration so provider is freed at exit. Signed-off-by: Matti Vaittinen Acked-by: Peter Ujfalusi --- drivers/clk/clk-twl6040.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-twl6040.c b/drivers/clk/clk-twl6040.c index 25dfe050ae9f..e9da09453eb2 100644 --- a/drivers/clk/clk-twl6040.c +++ b/drivers/clk/clk-twl6040.c @@ -108,9 +108,8 @@ static int twl6040_pdmclk_probe(struct platform_device *pdev) platform_set_drvdata(pdev, clkdata); - return of_clk_add_hw_provider(pdev->dev.parent->of_node, - of_clk_hw_simple_get, - &clkdata->pdmclk_hw); + return devm_of_clk_add_parent_hw_provider(&pdev->dev, + of_clk_hw_simple_get, &clkdata->pdmclk_hw); } static struct platform_driver twl6040_pdmclk_driver = { From patchwork Fri Nov 2 12:38:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vaittinen, Matti" X-Patchwork-Id: 10665451 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BC1814E2 for ; Fri, 2 Nov 2018 12:39:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 233E32B40F for ; Fri, 2 Nov 2018 12:39:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16D2A2B412; Fri, 2 Nov 2018 12:39:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A421D2B40F for ; Fri, 2 Nov 2018 12:39:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XOWnGMkNNfEczf7WOLTGam7sB/E2h5C0IZ3MLBy4y70=; b=eoYvCoB11ekFmF zw+kLHmF7e8/fW0/ZdEeQwXyG9kcooNagmHA++wBIQB3NCM/d5wNjEghf+X63vWY7Xssms8p+4oc5 +oz3bISBaBrIUHvGUTuSegng3KO+12gGZn0Hffjr2fLcagsZZGXU53T3j7nckZw+RvJzlV+UF1iGp zfXa4ajmfFKQdWl0GbTCWz/a8JIRpjn/XRZi64dNuB10nWWx9e4tj5lGW6RHm0lnUp9Auj7RJCBxN 0y8L52MSV7t8Kin2u6Gbo8I0BZr5xflefYXdqDSzQzwr5TgP9xk+J45Lk3iJVqe3JUy1pP/TE06+1 zxJjBEnZn90U8bzyJyzw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYj4-0002Mj-Pz; Fri, 02 Nov 2018 12:38:58 +0000 Received: from mail-lf1-f65.google.com ([209.85.167.65]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gIYiy-0002IL-HZ for linux-arm-kernel@lists.infradead.org; Fri, 02 Nov 2018 12:38:56 +0000 Received: by mail-lf1-f65.google.com with SMTP id o2-v6so1208300lfl.13 for ; Fri, 02 Nov 2018 05:38:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=UWFrztTGBGBvTlJ4yv0DEf/05EQvWoHnl+hl24Atexs=; b=VLcApKehsF1zAOaOmhHe/vUxPCgUHlJ/YiOnxnzW5/nqu7lqNeriGmR3ImgdGQvbtB CZ2ob960mPAvDdBRggPbbdT4mXRMFtBvgYiXpFIz9v+TpUCFBvLgUvXaApd12tgqkA95 jhHO7fIKXXDUCvZGJ79FSKPrnDjjDGXeAtO1ryCm4I5hjMPzqkzBtYU/1PyMqNmnnUsl daYkyAKuzL59KOJAIAJA3oZfjUdDI+zsNuVOhgiaTmA9M9Pxg/wlPe0pkJiYYnuPv/Cp bdhiXPJPJiuBlNzTjAYfb6qQUYlB1GSuqHsu4KQM0AZDUk99ANpHyIJ7SRZbHAU5ahz4 YVFg== X-Gm-Message-State: AGRZ1gJXIIaKLO2J672fFDNDs0q2RcNeVXryPFYYw6GAphL6pCqCRUfm QMRiVCaaw3yBDk+/mWXLhro= X-Google-Smtp-Source: AJdET5f59gj3giKEcfA7HmG//zPzEs+DCu7u8ul4wUV+I0FfLYxpMxxOuqZLix2NlyPzlXp1uIUySQ== X-Received: by 2002:a19:d04f:: with SMTP id h76mr6545138lfg.52.1541162320578; Fri, 02 Nov 2018 05:38:40 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id t5-v6sm5605393lfg.90.2018.11.02.05.38.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Nov 2018 05:38:40 -0700 (PDT) Date: Fri, 2 Nov 2018 14:38:27 +0200 From: Matti Vaittinen To: Jonathan Corbet , Michael Turquette , Stephen Boyd , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Russell King , Andy Gross , David Brown , Kukjin Kim , Sylwester Nawrocki , Tomasz Figa , Andrey Smirnov , Sebastian Reichel , Guenter Roeck , Rob Herring , Matti Vaittinen , Huang Shijie , Akshu Agrawal , "Rafael J. Wysocki" , Daniel Kurtz , mazziesaccount@gmail.com Subject: [PATCH v3 7/7] clk: apcs-msm8916: simplify probe cleanup by using devm Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181102_053852_667144_21EA97D6 X-CRM114-Status: GOOD ( 15.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, matti.vaittinen@fi.rohmeurope.com, linux-kernel@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP use devm variant for of_provider registration. Signed-off-by: Matti Vaittinen --- drivers/clk/qcom/apcs-msm8916.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c index b1cc8dbcd327..f4e0c136ab1a 100644 --- a/drivers/clk/qcom/apcs-msm8916.c +++ b/drivers/clk/qcom/apcs-msm8916.c @@ -96,8 +96,8 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) goto err; } - ret = of_clk_add_hw_provider(parent->of_node, of_clk_hw_simple_get, - &a53cc->clkr.hw); + ret = devm_of_clk_add_parent_hw_provider(dev, of_clk_hw_simple_get, + &a53cc->clkr.hw); if (ret) { dev_err(dev, "failed to add clock provider: %d\n", ret); goto err; @@ -118,7 +118,6 @@ static int qcom_apcs_msm8916_clk_remove(struct platform_device *pdev) struct device *parent = pdev->dev.parent; clk_notifier_unregister(a53cc->pclk, &a53cc->clk_nb); - of_clk_del_provider(parent->of_node); return 0; }