diff mbox series

[7/8] clk: clk-twl6040: Free of_provider at remove

Message ID 5281ac8223e5ec2673341e2655abf1144e997d10.1540970653.git.matti.vaittinen@fi.rohmeurope.com (mailing list archive)
State New, archived
Headers show
Series clk: clkdev: managed clk lookup and provider registrations | expand

Commit Message

Vaittinen, Matti Oct. 31, 2018, 8:34 a.m. UTC
use devm variant for of_provider registration so provider is freed
at exit.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
---
 drivers/clk/clk-twl6040.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

kernel test robot Oct. 31, 2018, 1:24 p.m. UTC | #1
Hi Matti,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on clk/clk-next]
[also build test ERROR on v4.19 next-20181031]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Matti-Vaittinen/clk-clkdev-managed-clk-lookup-and-provider-registrations/20181031-182055
base:   https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
config: i386-randconfig-x075-201843 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers//clk/clk-twl6040.c: In function 'twl6040_pdmclk_probe':
>> drivers//clk/clk-twl6040.c:111:9: error: implicit declaration of function 'devm_of_clk_add_parent_hw_provider'; did you mean 'devm_of_clk_add_hw_provider'? [-Werror=implicit-function-declaration]
     return devm_of_clk_add_parent_hw_provider(&pdev->dev,
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            devm_of_clk_add_hw_provider
   cc1: some warnings being treated as errors

vim +111 drivers//clk/clk-twl6040.c

    90	
    91	static int twl6040_pdmclk_probe(struct platform_device *pdev)
    92	{
    93		struct twl6040 *twl6040 = dev_get_drvdata(pdev->dev.parent);
    94		struct twl6040_pdmclk *clkdata;
    95		int ret;
    96	
    97		clkdata = devm_kzalloc(&pdev->dev, sizeof(*clkdata), GFP_KERNEL);
    98		if (!clkdata)
    99			return -ENOMEM;
   100	
   101		clkdata->dev = &pdev->dev;
   102		clkdata->twl6040 = twl6040;
   103	
   104		clkdata->pdmclk_hw.init = &twl6040_pdmclk_init;
   105		ret = devm_clk_hw_register(&pdev->dev, &clkdata->pdmclk_hw);
   106		if (ret)
   107			return ret;
   108	
   109		platform_set_drvdata(pdev, clkdata);
   110	
 > 111		return devm_of_clk_add_parent_hw_provider(&pdev->dev,
   112				of_clk_hw_simple_get, &clkdata->pdmclk_hw);
   113	}
   114	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot Oct. 31, 2018, 2:26 p.m. UTC | #2
Hi Matti,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on clk/clk-next]
[also build test ERROR on v4.19 next-20181031]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Matti-Vaittinen/clk-clkdev-managed-clk-lookup-and-provider-registrations/20181031-182055
base:   https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
config: x86_64-randconfig-r0-10311818 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/clk/clk-twl6040.c: In function 'twl6040_pdmclk_probe':
>> drivers/clk/clk-twl6040.c:111:9: error: implicit declaration of function 'devm_of_clk_add_parent_hw_provider' [-Werror=implicit-function-declaration]
     return devm_of_clk_add_parent_hw_provider(&pdev->dev,
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/devm_of_clk_add_parent_hw_provider +111 drivers/clk/clk-twl6040.c

    90	
    91	static int twl6040_pdmclk_probe(struct platform_device *pdev)
    92	{
    93		struct twl6040 *twl6040 = dev_get_drvdata(pdev->dev.parent);
    94		struct twl6040_pdmclk *clkdata;
    95		int ret;
    96	
    97		clkdata = devm_kzalloc(&pdev->dev, sizeof(*clkdata), GFP_KERNEL);
    98		if (!clkdata)
    99			return -ENOMEM;
   100	
   101		clkdata->dev = &pdev->dev;
   102		clkdata->twl6040 = twl6040;
   103	
   104		clkdata->pdmclk_hw.init = &twl6040_pdmclk_init;
   105		ret = devm_clk_hw_register(&pdev->dev, &clkdata->pdmclk_hw);
   106		if (ret)
   107			return ret;
   108	
   109		platform_set_drvdata(pdev, clkdata);
   110	
 > 111		return devm_of_clk_add_parent_hw_provider(&pdev->dev,
   112				of_clk_hw_simple_get, &clkdata->pdmclk_hw);
   113	}
   114	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox series

Patch

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 = {