All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: s2mps11: Use kcalloc instead of kzalloc for array allocation
@ 2015-07-22  9:34 ` Vaibhav Hiremath
  0 siblings, 0 replies; 13+ messages in thread
From: Vaibhav Hiremath @ 2015-07-22  9:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Vaibhav Hiremath, Sangbeom Kim, Krzysztof Kozlowski,
	Michael Turquette, Stephen Boyd,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:COMMON CLK FRAMEWORK

This patch cleans up the driver for,

  - Use devm_kcalloc varient instead of devm_kzalloc for array
    allocation.
  - clk_prepare/unprepare, remove "ret" variable as it is not required
  - use __exit for cleanup function

As I am referring this driver as a reference for my 88pm800 clk driver,
applying same changes here as well.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
Since I do not have platform to test, it would be helpful if someone
tests it for me.
I have build tested it.

 drivers/clk/clk-s2mps11.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
index 9b13a30..e17c66a 100644
--- a/drivers/clk/clk-s2mps11.c
+++ b/drivers/clk/clk-s2mps11.c
@@ -58,21 +58,17 @@ static struct s2mps11_clk *to_s2mps11_clk(struct clk_hw *hw)
 static int s2mps11_clk_prepare(struct clk_hw *hw)
 {
 	struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
-	int ret;
 
-	ret = regmap_update_bits(s2mps11->iodev->regmap_pmic,
+	return regmap_update_bits(s2mps11->iodev->regmap_pmic,
 				 s2mps11->reg,
 				 s2mps11->mask, s2mps11->mask);
-
-	return ret;
 }
 
 static void s2mps11_clk_unprepare(struct clk_hw *hw)
 {
 	struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
-	int ret;
 
-	ret = regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg,
+	regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg,
 			   s2mps11->mask, ~s2mps11->mask);
 }
 
@@ -186,15 +182,15 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
 	struct clk_init_data *clks_init;
 	int i, ret = 0;
 
-	s2mps11_clks = devm_kzalloc(&pdev->dev, sizeof(*s2mps11_clk) *
-					S2MPS11_CLKS_NUM, GFP_KERNEL);
+	s2mps11_clks = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM,
+				sizeof(*s2mps11_clk), GFP_KERNEL);
 	if (!s2mps11_clks)
 		return -ENOMEM;
 
 	s2mps11_clk = s2mps11_clks;
 
-	clk_table = devm_kzalloc(&pdev->dev, sizeof(struct clk *) *
-				 S2MPS11_CLKS_NUM, GFP_KERNEL);
+	clk_table = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM,
+				sizeof(struct clk *), GFP_KERNEL);
 	if (!clk_table)
 		return -ENOMEM;
 
@@ -322,7 +318,7 @@ static int __init s2mps11_clk_init(void)
 }
 subsys_initcall(s2mps11_clk_init);
 
-static void __init s2mps11_clk_cleanup(void)
+static void __exit s2mps11_clk_cleanup(void)
 {
 	platform_driver_unregister(&s2mps11_clk_driver);
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH] clk: s2mps11: Use kcalloc instead of kzalloc for array allocation
@ 2015-07-22  9:34 ` Vaibhav Hiremath
  0 siblings, 0 replies; 13+ messages in thread
From: Vaibhav Hiremath @ 2015-07-22  9:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Vaibhav Hiremath, Sangbeom Kim, Krzysztof Kozlowski,
	Michael Turquette, Stephen Boyd,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:COMMON CLK FRAMEWORK

This patch cleans up the driver for,

  - Use devm_kcalloc varient instead of devm_kzalloc for array
    allocation.
  - clk_prepare/unprepare, remove "ret" variable as it is not required
  - use __exit for cleanup function

As I am referring this driver as a reference for my 88pm800 clk driver,
applying same changes here as well.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
Since I do not have platform to test, it would be helpful if someone
tests it for me.
I have build tested it.

 drivers/clk/clk-s2mps11.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
index 9b13a30..e17c66a 100644
--- a/drivers/clk/clk-s2mps11.c
+++ b/drivers/clk/clk-s2mps11.c
@@ -58,21 +58,17 @@ static struct s2mps11_clk *to_s2mps11_clk(struct clk_hw *hw)
 static int s2mps11_clk_prepare(struct clk_hw *hw)
 {
 	struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
-	int ret;
 
-	ret = regmap_update_bits(s2mps11->iodev->regmap_pmic,
+	return regmap_update_bits(s2mps11->iodev->regmap_pmic,
 				 s2mps11->reg,
 				 s2mps11->mask, s2mps11->mask);
-
-	return ret;
 }
 
 static void s2mps11_clk_unprepare(struct clk_hw *hw)
 {
 	struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
-	int ret;
 
-	ret = regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg,
+	regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg,
 			   s2mps11->mask, ~s2mps11->mask);
 }
 
@@ -186,15 +182,15 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
 	struct clk_init_data *clks_init;
 	int i, ret = 0;
 
-	s2mps11_clks = devm_kzalloc(&pdev->dev, sizeof(*s2mps11_clk) *
-					S2MPS11_CLKS_NUM, GFP_KERNEL);
+	s2mps11_clks = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM,
+				sizeof(*s2mps11_clk), GFP_KERNEL);
 	if (!s2mps11_clks)
 		return -ENOMEM;
 
 	s2mps11_clk = s2mps11_clks;
 
-	clk_table = devm_kzalloc(&pdev->dev, sizeof(struct clk *) *
-				 S2MPS11_CLKS_NUM, GFP_KERNEL);
+	clk_table = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM,
+				sizeof(struct clk *), GFP_KERNEL);
 	if (!clk_table)
 		return -ENOMEM;
 
@@ -322,7 +318,7 @@ static int __init s2mps11_clk_init(void)
 }
 subsys_initcall(s2mps11_clk_init);
 
-static void __init s2mps11_clk_cleanup(void)
+static void __exit s2mps11_clk_cleanup(void)
 {
 	platform_driver_unregister(&s2mps11_clk_driver);
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH] clk: s2mps11: Use kcalloc instead of kzalloc for array allocation
@ 2015-07-22  9:34 ` Vaibhav Hiremath
  0 siblings, 0 replies; 13+ messages in thread
From: Vaibhav Hiremath @ 2015-07-22  9:34 UTC (permalink / raw)
  To: linux-arm-kernel

This patch cleans up the driver for,

  - Use devm_kcalloc varient instead of devm_kzalloc for array
    allocation.
  - clk_prepare/unprepare, remove "ret" variable as it is not required
  - use __exit for cleanup function

As I am referring this driver as a reference for my 88pm800 clk driver,
applying same changes here as well.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
Since I do not have platform to test, it would be helpful if someone
tests it for me.
I have build tested it.

 drivers/clk/clk-s2mps11.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
index 9b13a30..e17c66a 100644
--- a/drivers/clk/clk-s2mps11.c
+++ b/drivers/clk/clk-s2mps11.c
@@ -58,21 +58,17 @@ static struct s2mps11_clk *to_s2mps11_clk(struct clk_hw *hw)
 static int s2mps11_clk_prepare(struct clk_hw *hw)
 {
 	struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
-	int ret;
 
-	ret = regmap_update_bits(s2mps11->iodev->regmap_pmic,
+	return regmap_update_bits(s2mps11->iodev->regmap_pmic,
 				 s2mps11->reg,
 				 s2mps11->mask, s2mps11->mask);
-
-	return ret;
 }
 
 static void s2mps11_clk_unprepare(struct clk_hw *hw)
 {
 	struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
-	int ret;
 
-	ret = regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg,
+	regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg,
 			   s2mps11->mask, ~s2mps11->mask);
 }
 
@@ -186,15 +182,15 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
 	struct clk_init_data *clks_init;
 	int i, ret = 0;
 
-	s2mps11_clks = devm_kzalloc(&pdev->dev, sizeof(*s2mps11_clk) *
-					S2MPS11_CLKS_NUM, GFP_KERNEL);
+	s2mps11_clks = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM,
+				sizeof(*s2mps11_clk), GFP_KERNEL);
 	if (!s2mps11_clks)
 		return -ENOMEM;
 
 	s2mps11_clk = s2mps11_clks;
 
-	clk_table = devm_kzalloc(&pdev->dev, sizeof(struct clk *) *
-				 S2MPS11_CLKS_NUM, GFP_KERNEL);
+	clk_table = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM,
+				sizeof(struct clk *), GFP_KERNEL);
 	if (!clk_table)
 		return -ENOMEM;
 
@@ -322,7 +318,7 @@ static int __init s2mps11_clk_init(void)
 }
 subsys_initcall(s2mps11_clk_init);
 
-static void __init s2mps11_clk_cleanup(void)
+static void __exit s2mps11_clk_cleanup(void)
 {
 	platform_driver_unregister(&s2mps11_clk_driver);
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] clk: s2mps11: Use kcalloc instead of kzalloc for array allocation
  2015-07-22  9:34 ` Vaibhav Hiremath
  (?)
@ 2015-07-22 11:39   ` Anand Moon
  -1 siblings, 0 replies; 13+ messages in thread
From: Anand Moon @ 2015-07-22 11:39 UTC (permalink / raw)
  To: Vaibhav Hiremath
  Cc: linux-arm-kernel, Sangbeom Kim, Krzysztof Kozlowski,
	Michael Turquette, Stephen Boyd,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:COMMON CLK FRAMEWORK

Hi Vaibhav,

On 22 July 2015 at 15:04, Vaibhav Hiremath <vaibhav.hiremath@linaro.org> wrote:
> This patch cleans up the driver for,
>
>   - Use devm_kcalloc varient instead of devm_kzalloc for array
>     allocation.
>   - clk_prepare/unprepare, remove "ret" variable as it is not required
>   - use __exit for cleanup function
>
> As I am referring this driver as a reference for my 88pm800 clk driver,
> applying same changes here as well.
>
> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
> ---
> Since I do not have platform to test, it would be helpful if someone
> tests it for me.
> I have build tested it.
>
>  drivers/clk/clk-s2mps11.c | 18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
> index 9b13a30..e17c66a 100644
> --- a/drivers/clk/clk-s2mps11.c
> +++ b/drivers/clk/clk-s2mps11.c
> @@ -58,21 +58,17 @@ static struct s2mps11_clk *to_s2mps11_clk(struct clk_hw *hw)
>  static int s2mps11_clk_prepare(struct clk_hw *hw)
>  {
>         struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
> -       int ret;
>
> -       ret = regmap_update_bits(s2mps11->iodev->regmap_pmic,
> +       return regmap_update_bits(s2mps11->iodev->regmap_pmic,
>                                  s2mps11->reg,
>                                  s2mps11->mask, s2mps11->mask);
> -
> -       return ret;
>  }
>
>  static void s2mps11_clk_unprepare(struct clk_hw *hw)
>  {
>         struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
> -       int ret;
>
> -       ret = regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg,
> +       regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg,
>                            s2mps11->mask, ~s2mps11->mask);
>  }
>
> @@ -186,15 +182,15 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
>         struct clk_init_data *clks_init;
>         int i, ret = 0;
>
> -       s2mps11_clks = devm_kzalloc(&pdev->dev, sizeof(*s2mps11_clk) *
> -                                       S2MPS11_CLKS_NUM, GFP_KERNEL);
> +       s2mps11_clks = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM,
> +                               sizeof(*s2mps11_clk), GFP_KERNEL);
>         if (!s2mps11_clks)
>                 return -ENOMEM;
>
>         s2mps11_clk = s2mps11_clks;
>
> -       clk_table = devm_kzalloc(&pdev->dev, sizeof(struct clk *) *
> -                                S2MPS11_CLKS_NUM, GFP_KERNEL);
> +       clk_table = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM,
> +                               sizeof(struct clk *), GFP_KERNEL);
>         if (!clk_table)
>                 return -ENOMEM;
>
> @@ -322,7 +318,7 @@ static int __init s2mps11_clk_init(void)
>  }
>  subsys_initcall(s2mps11_clk_init);
>
> -static void __init s2mps11_clk_cleanup(void)
> +static void __exit s2mps11_clk_cleanup(void)
>  {
>         platform_driver_unregister(&s2mps11_clk_driver);
>  }
> --
> 1.9.1
>

Tested on Odroid-XU3 board.

Tested-by: Anand Moon <linux.amoon@gmail.com>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] clk: s2mps11: Use kcalloc instead of kzalloc for array allocation
@ 2015-07-22 11:39   ` Anand Moon
  0 siblings, 0 replies; 13+ messages in thread
From: Anand Moon @ 2015-07-22 11:39 UTC (permalink / raw)
  To: Vaibhav Hiremath
  Cc: linux-arm-kernel, Sangbeom Kim, Krzysztof Kozlowski,
	Michael Turquette, Stephen Boyd,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:COMMON CLK FRAMEWORK

Hi Vaibhav,

On 22 July 2015 at 15:04, Vaibhav Hiremath <vaibhav.hiremath@linaro.org> wrote:
> This patch cleans up the driver for,
>
>   - Use devm_kcalloc varient instead of devm_kzalloc for array
>     allocation.
>   - clk_prepare/unprepare, remove "ret" variable as it is not required
>   - use __exit for cleanup function
>
> As I am referring this driver as a reference for my 88pm800 clk driver,
> applying same changes here as well.
>
> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
> ---
> Since I do not have platform to test, it would be helpful if someone
> tests it for me.
> I have build tested it.
>
>  drivers/clk/clk-s2mps11.c | 18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
> index 9b13a30..e17c66a 100644
> --- a/drivers/clk/clk-s2mps11.c
> +++ b/drivers/clk/clk-s2mps11.c
> @@ -58,21 +58,17 @@ static struct s2mps11_clk *to_s2mps11_clk(struct clk_hw *hw)
>  static int s2mps11_clk_prepare(struct clk_hw *hw)
>  {
>         struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
> -       int ret;
>
> -       ret = regmap_update_bits(s2mps11->iodev->regmap_pmic,
> +       return regmap_update_bits(s2mps11->iodev->regmap_pmic,
>                                  s2mps11->reg,
>                                  s2mps11->mask, s2mps11->mask);
> -
> -       return ret;
>  }
>
>  static void s2mps11_clk_unprepare(struct clk_hw *hw)
>  {
>         struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
> -       int ret;
>
> -       ret = regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg,
> +       regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg,
>                            s2mps11->mask, ~s2mps11->mask);
>  }
>
> @@ -186,15 +182,15 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
>         struct clk_init_data *clks_init;
>         int i, ret = 0;
>
> -       s2mps11_clks = devm_kzalloc(&pdev->dev, sizeof(*s2mps11_clk) *
> -                                       S2MPS11_CLKS_NUM, GFP_KERNEL);
> +       s2mps11_clks = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM,
> +                               sizeof(*s2mps11_clk), GFP_KERNEL);
>         if (!s2mps11_clks)
>                 return -ENOMEM;
>
>         s2mps11_clk = s2mps11_clks;
>
> -       clk_table = devm_kzalloc(&pdev->dev, sizeof(struct clk *) *
> -                                S2MPS11_CLKS_NUM, GFP_KERNEL);
> +       clk_table = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM,
> +                               sizeof(struct clk *), GFP_KERNEL);
>         if (!clk_table)
>                 return -ENOMEM;
>
> @@ -322,7 +318,7 @@ static int __init s2mps11_clk_init(void)
>  }
>  subsys_initcall(s2mps11_clk_init);
>
> -static void __init s2mps11_clk_cleanup(void)
> +static void __exit s2mps11_clk_cleanup(void)
>  {
>         platform_driver_unregister(&s2mps11_clk_driver);
>  }
> --
> 1.9.1
>

Tested on Odroid-XU3 board.

Tested-by: Anand Moon <linux.amoon@gmail.com>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] clk: s2mps11: Use kcalloc instead of kzalloc for array allocation
@ 2015-07-22 11:39   ` Anand Moon
  0 siblings, 0 replies; 13+ messages in thread
From: Anand Moon @ 2015-07-22 11:39 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Vaibhav,

On 22 July 2015 at 15:04, Vaibhav Hiremath <vaibhav.hiremath@linaro.org> wrote:
> This patch cleans up the driver for,
>
>   - Use devm_kcalloc varient instead of devm_kzalloc for array
>     allocation.
>   - clk_prepare/unprepare, remove "ret" variable as it is not required
>   - use __exit for cleanup function
>
> As I am referring this driver as a reference for my 88pm800 clk driver,
> applying same changes here as well.
>
> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
> ---
> Since I do not have platform to test, it would be helpful if someone
> tests it for me.
> I have build tested it.
>
>  drivers/clk/clk-s2mps11.c | 18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
> index 9b13a30..e17c66a 100644
> --- a/drivers/clk/clk-s2mps11.c
> +++ b/drivers/clk/clk-s2mps11.c
> @@ -58,21 +58,17 @@ static struct s2mps11_clk *to_s2mps11_clk(struct clk_hw *hw)
>  static int s2mps11_clk_prepare(struct clk_hw *hw)
>  {
>         struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
> -       int ret;
>
> -       ret = regmap_update_bits(s2mps11->iodev->regmap_pmic,
> +       return regmap_update_bits(s2mps11->iodev->regmap_pmic,
>                                  s2mps11->reg,
>                                  s2mps11->mask, s2mps11->mask);
> -
> -       return ret;
>  }
>
>  static void s2mps11_clk_unprepare(struct clk_hw *hw)
>  {
>         struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
> -       int ret;
>
> -       ret = regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg,
> +       regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg,
>                            s2mps11->mask, ~s2mps11->mask);
>  }
>
> @@ -186,15 +182,15 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
>         struct clk_init_data *clks_init;
>         int i, ret = 0;
>
> -       s2mps11_clks = devm_kzalloc(&pdev->dev, sizeof(*s2mps11_clk) *
> -                                       S2MPS11_CLKS_NUM, GFP_KERNEL);
> +       s2mps11_clks = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM,
> +                               sizeof(*s2mps11_clk), GFP_KERNEL);
>         if (!s2mps11_clks)
>                 return -ENOMEM;
>
>         s2mps11_clk = s2mps11_clks;
>
> -       clk_table = devm_kzalloc(&pdev->dev, sizeof(struct clk *) *
> -                                S2MPS11_CLKS_NUM, GFP_KERNEL);
> +       clk_table = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM,
> +                               sizeof(struct clk *), GFP_KERNEL);
>         if (!clk_table)
>                 return -ENOMEM;
>
> @@ -322,7 +318,7 @@ static int __init s2mps11_clk_init(void)
>  }
>  subsys_initcall(s2mps11_clk_init);
>
> -static void __init s2mps11_clk_cleanup(void)
> +static void __exit s2mps11_clk_cleanup(void)
>  {
>         platform_driver_unregister(&s2mps11_clk_driver);
>  }
> --
> 1.9.1
>

Tested on Odroid-XU3 board.

Tested-by: Anand Moon <linux.amoon@gmail.com>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] clk: s2mps11: Use kcalloc instead of kzalloc for array allocation
  2015-07-22 11:39   ` Anand Moon
  (?)
  (?)
@ 2015-07-22 12:02   ` Vaibhav Hiremath
  -1 siblings, 0 replies; 13+ messages in thread
From: Vaibhav Hiremath @ 2015-07-22 12:02 UTC (permalink / raw)
  To: Anand Moon
  Cc: linux-arm-kernel, Sangbeom Kim, Krzysztof Kozlowski,
	Michael Turquette, Stephen Boyd,
	SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS, open



On Wednesday 22 July 2015 05:09 PM, Anand Moon wrote:
> Hi Vaibhav,
>
> On 22 July 2015 at 15:04, Vaibhav Hiremath <vaibhav.hiremath@linaro.org> wrote:
>> This patch cleans up the driver for,
>>
>>    - Use devm_kcalloc varient instead of devm_kzalloc for array
>>      allocation.
>>    - clk_prepare/unprepare, remove "ret" variable as it is not required
>>    - use __exit for cleanup function
>>
>> As I am referring this driver as a reference for my 88pm800 clk driver,
>> applying same changes here as well.
>>
>> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
>> ---
>> Since I do not have platform to test, it would be helpful if someone
>> tests it for me.
>> I have build tested it.
>>
>>   drivers/clk/clk-s2mps11.c | 18 +++++++-----------
>>   1 file changed, 7 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
>> index 9b13a30..e17c66a 100644
>> --- a/drivers/clk/clk-s2mps11.c
>> +++ b/drivers/clk/clk-s2mps11.c
>> @@ -58,21 +58,17 @@ static struct s2mps11_clk *to_s2mps11_clk(struct clk_hw *hw)
>>   static int s2mps11_clk_prepare(struct clk_hw *hw)
>>   {
>>          struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
>> -       int ret;
>>
>> -       ret = regmap_update_bits(s2mps11->iodev->regmap_pmic,
>> +       return regmap_update_bits(s2mps11->iodev->regmap_pmic,
>>                                   s2mps11->reg,
>>                                   s2mps11->mask, s2mps11->mask);
>> -
>> -       return ret;
>>   }
>>
>>   static void s2mps11_clk_unprepare(struct clk_hw *hw)
>>   {
>>          struct s2mps11_clk *s2mps11 = to_s2mps11_clk(hw);
>> -       int ret;
>>
>> -       ret = regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg,
>> +       regmap_update_bits(s2mps11->iodev->regmap_pmic, s2mps11->reg,
>>                             s2mps11->mask, ~s2mps11->mask);
>>   }
>>
>> @@ -186,15 +182,15 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
>>          struct clk_init_data *clks_init;
>>          int i, ret = 0;
>>
>> -       s2mps11_clks = devm_kzalloc(&pdev->dev, sizeof(*s2mps11_clk) *
>> -                                       S2MPS11_CLKS_NUM, GFP_KERNEL);
>> +       s2mps11_clks = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM,
>> +                               sizeof(*s2mps11_clk), GFP_KERNEL);
>>          if (!s2mps11_clks)
>>                  return -ENOMEM;
>>
>>          s2mps11_clk = s2mps11_clks;
>>
>> -       clk_table = devm_kzalloc(&pdev->dev, sizeof(struct clk *) *
>> -                                S2MPS11_CLKS_NUM, GFP_KERNEL);
>> +       clk_table = devm_kcalloc(&pdev->dev, S2MPS11_CLKS_NUM,
>> +                               sizeof(struct clk *), GFP_KERNEL);
>>          if (!clk_table)
>>                  return -ENOMEM;
>>
>> @@ -322,7 +318,7 @@ static int __init s2mps11_clk_init(void)
>>   }
>>   subsys_initcall(s2mps11_clk_init);
>>
>> -static void __init s2mps11_clk_cleanup(void)
>> +static void __exit s2mps11_clk_cleanup(void)
>>   {
>>          platform_driver_unregister(&s2mps11_clk_driver);
>>   }
>> --
>> 1.9.1
>>
>
> Tested on Odroid-XU3 board.
>
> Tested-by: Anand Moon <linux.amoon@gmail.com>

Thanks Anand, really appreciate your help here.


Thanks,
Vaibhav

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] clk: s2mps11: Use kcalloc instead of kzalloc for array allocation
  2015-07-22  9:34 ` Vaibhav Hiremath
  (?)
@ 2015-07-23  0:38   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2015-07-23  0:38 UTC (permalink / raw)
  To: Vaibhav Hiremath, linux-arm-kernel
  Cc: Sangbeom Kim, Michael Turquette, Stephen Boyd,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:COMMON CLK FRAMEWORK

On 22.07.2015 18:34, Vaibhav Hiremath wrote:
> This patch cleans up the driver for,
> 
>   - Use devm_kcalloc varient instead of devm_kzalloc for array
>     allocation.
>   - clk_prepare/unprepare, remove "ret" variable as it is not required
>   - use __exit for cleanup function
> 
> As I am referring this driver as a reference for my 88pm800 clk driver,
> applying same changes here as well.
> 
> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
> ---
> Since I do not have platform to test, it would be helpful if someone
> tests it for me.
> I have build tested it.
> 
>  drivers/clk/clk-s2mps11.c | 18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)

Looks good, simplifies the code and fixes the __init/__exit.

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] clk: s2mps11: Use kcalloc instead of kzalloc for array allocation
@ 2015-07-23  0:38   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2015-07-23  0:38 UTC (permalink / raw)
  To: Vaibhav Hiremath, linux-arm-kernel
  Cc: Sangbeom Kim, Michael Turquette, Stephen Boyd,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:COMMON CLK FRAMEWORK

On 22.07.2015 18:34, Vaibhav Hiremath wrote:
> This patch cleans up the driver for,
> 
>   - Use devm_kcalloc varient instead of devm_kzalloc for array
>     allocation.
>   - clk_prepare/unprepare, remove "ret" variable as it is not required
>   - use __exit for cleanup function
> 
> As I am referring this driver as a reference for my 88pm800 clk driver,
> applying same changes here as well.
> 
> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
> ---
> Since I do not have platform to test, it would be helpful if someone
> tests it for me.
> I have build tested it.
> 
>  drivers/clk/clk-s2mps11.c | 18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)

Looks good, simplifies the code and fixes the __init/__exit.

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] clk: s2mps11: Use kcalloc instead of kzalloc for array allocation
@ 2015-07-23  0:38   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2015-07-23  0:38 UTC (permalink / raw)
  To: linux-arm-kernel

On 22.07.2015 18:34, Vaibhav Hiremath wrote:
> This patch cleans up the driver for,
> 
>   - Use devm_kcalloc varient instead of devm_kzalloc for array
>     allocation.
>   - clk_prepare/unprepare, remove "ret" variable as it is not required
>   - use __exit for cleanup function
> 
> As I am referring this driver as a reference for my 88pm800 clk driver,
> applying same changes here as well.
> 
> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
> ---
> Since I do not have platform to test, it would be helpful if someone
> tests it for me.
> I have build tested it.
> 
>  drivers/clk/clk-s2mps11.c | 18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)

Looks good, simplifies the code and fixes the __init/__exit.

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] clk: s2mps11: Use kcalloc instead of kzalloc for array allocation
  2015-07-22  9:34 ` Vaibhav Hiremath
  (?)
@ 2015-07-24 21:39   ` Stephen Boyd
  -1 siblings, 0 replies; 13+ messages in thread
From: Stephen Boyd @ 2015-07-24 21:39 UTC (permalink / raw)
  To: Vaibhav Hiremath
  Cc: linux-arm-kernel, Sangbeom Kim, Krzysztof Kozlowski,
	Michael Turquette,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:COMMON CLK FRAMEWORK

On 07/22, Vaibhav Hiremath wrote:
> This patch cleans up the driver for,
> 
>   - Use devm_kcalloc varient instead of devm_kzalloc for array
>     allocation.
>   - clk_prepare/unprepare, remove "ret" variable as it is not required
>   - use __exit for cleanup function
> 
> As I am referring this driver as a reference for my 88pm800 clk driver,
> applying same changes here as well.
> 
> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] clk: s2mps11: Use kcalloc instead of kzalloc for array allocation
@ 2015-07-24 21:39   ` Stephen Boyd
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Boyd @ 2015-07-24 21:39 UTC (permalink / raw)
  To: Vaibhav Hiremath
  Cc: linux-arm-kernel, Sangbeom Kim, Krzysztof Kozlowski,
	Michael Turquette,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS,
	open list:COMMON CLK FRAMEWORK

On 07/22, Vaibhav Hiremath wrote:
> This patch cleans up the driver for,
> 
>   - Use devm_kcalloc varient instead of devm_kzalloc for array
>     allocation.
>   - clk_prepare/unprepare, remove "ret" variable as it is not required
>   - use __exit for cleanup function
> 
> As I am referring this driver as a reference for my 88pm800 clk driver,
> applying same changes here as well.
> 
> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] clk: s2mps11: Use kcalloc instead of kzalloc for array allocation
@ 2015-07-24 21:39   ` Stephen Boyd
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Boyd @ 2015-07-24 21:39 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/22, Vaibhav Hiremath wrote:
> This patch cleans up the driver for,
> 
>   - Use devm_kcalloc varient instead of devm_kzalloc for array
>     allocation.
>   - clk_prepare/unprepare, remove "ret" variable as it is not required
>   - use __exit for cleanup function
> 
> As I am referring this driver as a reference for my 88pm800 clk driver,
> applying same changes here as well.
> 
> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-07-24 21:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-22  9:34 [PATCH] clk: s2mps11: Use kcalloc instead of kzalloc for array allocation Vaibhav Hiremath
2015-07-22  9:34 ` Vaibhav Hiremath
2015-07-22  9:34 ` Vaibhav Hiremath
2015-07-22 11:39 ` Anand Moon
2015-07-22 11:39   ` Anand Moon
2015-07-22 11:39   ` Anand Moon
2015-07-22 12:02   ` Vaibhav Hiremath
2015-07-23  0:38 ` Krzysztof Kozlowski
2015-07-23  0:38   ` Krzysztof Kozlowski
2015-07-23  0:38   ` Krzysztof Kozlowski
2015-07-24 21:39 ` Stephen Boyd
2015-07-24 21:39   ` Stephen Boyd
2015-07-24 21:39   ` Stephen Boyd

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.