Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1298374 > unrolled thread

[PATCH 09/10] watchdog: cadence_wdt: use to_platform_device()

Started byGeliang Tang <geliangtang@163.com>
First post2015-12-27 14:20 +0100
Last post2015-12-28 03:50 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 09/10] watchdog: cadence_wdt: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
    Re: [PATCH 09/10] watchdog: cadence_wdt: use to_platform_device() Guenter Roeck <linux@roeck-us.net> - 2015-12-27 16:30 +0100
    Re: [PATCH 09/10] watchdog: cadence_wdt: use to_platform_device() Wim Van Sebroeck <wim@iguana.be> - 2015-12-28 03:50 +0100

#1298374 — [PATCH 09/10] watchdog: cadence_wdt: use to_platform_device()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-27 14:20 +0100
Subject[PATCH 09/10] watchdog: cadence_wdt: use to_platform_device()
Message-ID<qKjoR-7uf-3@gated-at.bofh.it>
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/watchdog/cadence_wdt.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
index abf64eb..4dda902 100644
--- a/drivers/watchdog/cadence_wdt.c
+++ b/drivers/watchdog/cadence_wdt.c
@@ -421,8 +421,7 @@ static void cdns_wdt_shutdown(struct platform_device *pdev)
  */
 static int __maybe_unused cdns_wdt_suspend(struct device *dev)
 {
-	struct platform_device *pdev = container_of(dev,
-			struct platform_device, dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct cdns_wdt *wdt = platform_get_drvdata(pdev);
 
 	cdns_wdt_stop(&wdt->cdns_wdt_device);
@@ -440,8 +439,7 @@ static int __maybe_unused cdns_wdt_suspend(struct device *dev)
 static int __maybe_unused cdns_wdt_resume(struct device *dev)
 {
 	int ret;
-	struct platform_device *pdev = container_of(dev,
-			struct platform_device, dev);
+	struct platform_device *pdev = to_platform_device(dev);
 	struct cdns_wdt *wdt = platform_get_drvdata(pdev);
 
 	ret = clk_prepare_enable(wdt->clk);
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1298406

FromGuenter Roeck <linux@roeck-us.net>
Date2015-12-27 16:30 +0100
Message-ID<qKlqG-1CY-7@gated-at.bofh.it>
In reply to#1298374
On Sun, Dec 27, 2015 at 09:15:47PM +0800, Geliang Tang wrote:
> Use to_platform_device() instead of open-coding it.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/cadence_wdt.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
> index abf64eb..4dda902 100644
> --- a/drivers/watchdog/cadence_wdt.c
> +++ b/drivers/watchdog/cadence_wdt.c
> @@ -421,8 +421,7 @@ static void cdns_wdt_shutdown(struct platform_device *pdev)
>   */
>  static int __maybe_unused cdns_wdt_suspend(struct device *dev)
>  {
> -	struct platform_device *pdev = container_of(dev,
> -			struct platform_device, dev);
> +	struct platform_device *pdev = to_platform_device(dev);
>  	struct cdns_wdt *wdt = platform_get_drvdata(pdev);
>  
>  	cdns_wdt_stop(&wdt->cdns_wdt_device);
> @@ -440,8 +439,7 @@ static int __maybe_unused cdns_wdt_suspend(struct device *dev)
>  static int __maybe_unused cdns_wdt_resume(struct device *dev)
>  {
>  	int ret;
> -	struct platform_device *pdev = container_of(dev,
> -			struct platform_device, dev);
> +	struct platform_device *pdev = to_platform_device(dev);
>  	struct cdns_wdt *wdt = platform_get_drvdata(pdev);
>  
>  	ret = clk_prepare_enable(wdt->clk);
> -- 
> 2.5.0
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298461

FromWim Van Sebroeck <wim@iguana.be>
Date2015-12-28 03:50 +0100
Message-ID<qKw3f-3Io-663@gated-at.bofh.it>
In reply to#1298374
Hi Geliang,

> Use to_platform_device() instead of open-coding it.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  drivers/watchdog/cadence_wdt.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
> index abf64eb..4dda902 100644
> --- a/drivers/watchdog/cadence_wdt.c
> +++ b/drivers/watchdog/cadence_wdt.c
> @@ -421,8 +421,7 @@ static void cdns_wdt_shutdown(struct platform_device *pdev)
>   */
>  static int __maybe_unused cdns_wdt_suspend(struct device *dev)
>  {
> -	struct platform_device *pdev = container_of(dev,
> -			struct platform_device, dev);
> +	struct platform_device *pdev = to_platform_device(dev);
>  	struct cdns_wdt *wdt = platform_get_drvdata(pdev);
>  
>  	cdns_wdt_stop(&wdt->cdns_wdt_device);
> @@ -440,8 +439,7 @@ static int __maybe_unused cdns_wdt_suspend(struct device *dev)
>  static int __maybe_unused cdns_wdt_resume(struct device *dev)
>  {
>  	int ret;
> -	struct platform_device *pdev = container_of(dev,
> -			struct platform_device, dev);
> +	struct platform_device *pdev = to_platform_device(dev);
>  	struct cdns_wdt *wdt = platform_get_drvdata(pdev);
>  
>  	ret = clk_prepare_enable(wdt->clk);
> -- 
> 2.5.0
> 
> 

Patch added to linux-watchdog-next.

Kind regards,
Wim.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web