public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] devfreq: exynos4_bus: Use dev_get_drvdata at appropriate places
@ 2012-01-14  8:56 Axel Lin
  0 siblings, 0 replies; 2+ messages in thread
From: Axel Lin @ 2012-01-14  8:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: MyungJoo Ham, Kyungmin Park, Rafael J. Wysocki

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/devfreq/exynos4_bus.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/devfreq/exynos4_bus.c b/drivers/devfreq/exynos4_bus.c
index cd563da..0b67537 100644
--- a/drivers/devfreq/exynos4_bus.c
+++ b/drivers/devfreq/exynos4_bus.c
@@ -622,9 +622,7 @@ static int exynos4_bus_setvolt(struct busfreq_data *data, struct opp *opp,
 static int exynos4_bus_target(struct device *dev, unsigned long *_freq)
 {
 	int err = 0;
-	struct platform_device *pdev = container_of(dev, struct platform_device,
-						    dev);
-	struct busfreq_data *data = platform_get_drvdata(pdev);
+	struct busfreq_data *data = dev_get_drvdata(dev);
 	struct opp *opp = devfreq_recommended_opp(dev, _freq);
 	unsigned long old_freq = opp_get_freq(data->curr_opp);
 	unsigned long freq = opp_get_freq(opp);
@@ -689,9 +687,7 @@ static int exynos4_get_busier_dmc(struct busfreq_data *data)
 static int exynos4_bus_get_dev_status(struct device *dev,
 				      struct devfreq_dev_status *stat)
 {
-	struct platform_device *pdev = container_of(dev, struct platform_device,
-						    dev);
-	struct busfreq_data *data = platform_get_drvdata(pdev);
+	struct busfreq_data *data = dev_get_drvdata(dev);
 	int busier_dmc;
 	int cycles_x2 = 2; /* 2 x cycles */
 	void __iomem *addr;
@@ -739,9 +735,7 @@ static int exynos4_bus_get_dev_status(struct device *dev,
 
 static void exynos4_bus_exit(struct device *dev)
 {
-	struct platform_device *pdev = container_of(dev, struct platform_device,
-						    dev);
-	struct busfreq_data *data = platform_get_drvdata(pdev);
+	struct busfreq_data *data = dev_get_drvdata(dev);
 
 	devfreq_unregister_opp_notifier(dev, data->devfreq);
 }
@@ -1087,9 +1081,7 @@ static __devexit int exynos4_busfreq_remove(struct platform_device *pdev)
 
 static int exynos4_busfreq_resume(struct device *dev)
 {
-	struct platform_device *pdev = container_of(dev, struct platform_device,
-						    dev);
-	struct busfreq_data *data = platform_get_drvdata(pdev);
+	struct busfreq_data *data = dev_get_drvdata(dev);
 
 	busfreq_mon_reset(data);
 	return 0;
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 2+ messages in thread
* Re: [PATCH] devfreq: exynos4_bus: Use dev_get_drvdata at appropriate places
@ 2012-01-16  0:54 함명주
  0 siblings, 0 replies; 2+ messages in thread
From: 함명주 @ 2012-01-16  0:54 UTC (permalink / raw)
  To: Axel Lin, linux-kernel@vger.kernel.org
  Cc: 박경민, Rafael J. Wysocki

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 4951 bytes --]

> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>

Looks good. I'll apply this one.

> ---
>  drivers/devfreq/exynos4_bus.c |   16 ++++------------
>  1 files changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/devfreq/exynos4_bus.c b/drivers/devfreq/exynos4_bus.c
> index cd563da..0b67537 100644
> --- a/drivers/devfreq/exynos4_bus.c
> +++ b/drivers/devfreq/exynos4_bus.c
> @@ -622,9 +622,7 @@ static int exynos4_bus_setvolt(struct busfreq_data *data, struct opp *opp,
>  static int exynos4_bus_target(struct device *dev, unsigned long *_freq)
>  {
>   int err = 0;
> - struct platform_device *pdev = container_of(dev, struct platform_device,
> -          dev);
> - struct busfreq_data *data = platform_get_drvdata(pdev);
> + struct busfreq_data *data = dev_get_drvdata(dev);
>   struct opp *opp = devfreq_recommended_opp(dev, _freq);
>   unsigned long old_freq = opp_get_freq(data->curr_opp);
>   unsigned long freq = opp_get_freq(opp);
> @@ -689,9 +687,7 @@ static int exynos4_get_busier_dmc(struct busfreq_data *data)
>  static int exynos4_bus_get_dev_status(struct device *dev,
>            struct devfreq_dev_status *stat)
>  {
> - struct platform_device *pdev = container_of(dev, struct platform_device,
> -          dev);
> - struct busfreq_data *data = platform_get_drvdata(pdev);
> + struct busfreq_data *data = dev_get_drvdata(dev);
>   int busier_dmc;
>   int cycles_x2 = 2; /* 2 x cycles */
>   void __iomem *addr;
> @@ -739,9 +735,7 @@ static int exynos4_bus_get_dev_status(struct device *dev,
>  
>  static void exynos4_bus_exit(struct device *dev)
>  {
> - struct platform_device *pdev = container_of(dev, struct platform_device,
> -          dev);
> - struct busfreq_data *data = platform_get_drvdata(pdev);
> + struct busfreq_data *data = dev_get_drvdata(dev);
>  
>   devfreq_unregister_opp_notifier(dev, data->devfreq);
>  }
> @@ -1087,9 +1081,7 @@ static __devexit int exynos4_busfreq_remove(struct platform_device *pdev)
>  
>  static int exynos4_busfreq_resume(struct device *dev)
>  {
> - struct platform_device *pdev = container_of(dev, struct platform_device,
> -          dev);
> - struct busfreq_data *data = platform_get_drvdata(pdev);
> + struct busfreq_data *data = dev_get_drvdata(dev);
>  
>   busfreq_mon_reset(data);
>   return 0;
> -- 
> 1.7.5.4
> 
> 


------- Original Message -------
Sender : Axel Lin<axel.lin@gmail.com>
Date : 2012-01-14 17:56 (GMT+09:00)
Title : [PATCH] devfreq: exynos4_bus: Use dev_get_drvdata at appropriate places

Signed-off-by: Axel Lin 
---
drivers/devfreq/exynos4_bus.c |   16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/devfreq/exynos4_bus.c b/drivers/devfreq/exynos4_bus.c
index cd563da..0b67537 100644
--- a/drivers/devfreq/exynos4_bus.c
+++ b/drivers/devfreq/exynos4_bus.c
@@ -622,9 +622,7 @@ static int exynos4_bus_setvolt(struct busfreq_data *data, struct opp *opp,
static int exynos4_bus_target(struct device *dev, unsigned long *_freq)
{
int err = 0;
- struct platform_device *pdev = container_of(dev, struct platform_device,
-     dev);
- struct busfreq_data *data = platform_get_drvdata(pdev);
+ struct busfreq_data *data = dev_get_drvdata(dev);
struct opp *opp = devfreq_recommended_opp(dev, _freq);
unsigned long old_freq = opp_get_freq(data->curr_opp);
unsigned long freq = opp_get_freq(opp);
@@ -689,9 +687,7 @@ static int exynos4_get_busier_dmc(struct busfreq_data *data)
static int exynos4_bus_get_dev_status(struct device *dev,
      struct devfreq_dev_status *stat)
{
- struct platform_device *pdev = container_of(dev, struct platform_device,
-     dev);
- struct busfreq_data *data = platform_get_drvdata(pdev);
+ struct busfreq_data *data = dev_get_drvdata(dev);
int busier_dmc;
int cycles_x2 = 2; /* 2 x cycles */
void __iomem *addr;
@@ -739,9 +735,7 @@ static int exynos4_bus_get_dev_status(struct device *dev,

static void exynos4_bus_exit(struct device *dev)
{
- struct platform_device *pdev = container_of(dev, struct platform_device,
-     dev);
- struct busfreq_data *data = platform_get_drvdata(pdev);
+ struct busfreq_data *data = dev_get_drvdata(dev);

devfreq_unregister_opp_notifier(dev, data->devfreq);
}
@@ -1087,9 +1081,7 @@ static __devexit int exynos4_busfreq_remove(struct platform_device *pdev)

static int exynos4_busfreq_resume(struct device *dev)
{
- struct platform_device *pdev = container_of(dev, struct platform_device,
-     dev);
- struct busfreq_data *data = platform_get_drvdata(pdev);
+ struct busfreq_data *data = dev_get_drvdata(dev);

busfreq_mon_reset(data);
return 0;
-- 
1.7.5.4






 MyungJoo Ham (ÇÔ¸íÁÖ)
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: +82-10-6714-2858 / office: +82-31-279-8033ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

end of thread, other threads:[~2012-01-16  0:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-14  8:56 [PATCH] devfreq: exynos4_bus: Use dev_get_drvdata at appropriate places Axel Lin
  -- strict thread matches above, loose matches on Subject: below --
2012-01-16  0:54 함명주

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox