diff mbox series

[v2,3/4] watchdog: cadence_wdt: Group struct member init statements

Message ID 20190705114522.42565-4-tomas.melin@vaisala.com (mailing list archive)
State Changes Requested
Headers show
Series watchdog: cadence_wdt: Support all available prescaler values | expand

Commit Message

Tomas Melin July 5, 2019, 11:46 a.m. UTC
Move init statement and remove stray comment.

Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
---
 drivers/watchdog/cadence_wdt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Guenter Roeck July 8, 2019, 6:09 p.m. UTC | #1
On Fri, Jul 05, 2019 at 11:46:03AM +0000, Melin Tomas wrote:
> Move init statement and remove stray comment.
> 
> Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
> ---
>  drivers/watchdog/cadence_wdt.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
> index 87b767c87bb6..4657800d9d8e 100644
> --- a/drivers/watchdog/cadence_wdt.c
> +++ b/drivers/watchdog/cadence_wdt.c
> @@ -313,6 +313,7 @@ static int cdns_wdt_probe(struct platform_device *pdev)
>  	}
>  	
>  	cdns_wdt_device = &wdt->cdns_wdt_device;
> +	cdns_wdt_device->parent = &pdev->dev;

In the upstream kernel, we have
	struct device *dev = &pdev->dev;
and
	cdns_wdt_device->parent = dev;

so this patch no longer applies.

>  	cdns_wdt_device->info = &cdns_wdt_info;
>  	cdns_wdt_device->ops = &cdns_wdt_ops;
>  	cdns_wdt_device->timeout = CDNS_WDT_DEFAULT_TIMEOUT;
> @@ -340,9 +341,6 @@ static int cdns_wdt_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> -	/* Initialize the members of cdns_wdt structure */
> -	cdns_wdt_device->parent = &pdev->dev;
> -
>  	ret = watchdog_init_timeout(cdns_wdt_device, wdt_timeout, &pdev->dev);
>  	if (ret) {
>  		dev_err(&pdev->dev, "unable to set timeout value\n");
diff mbox series

Patch

diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
index 87b767c87bb6..4657800d9d8e 100644
--- a/drivers/watchdog/cadence_wdt.c
+++ b/drivers/watchdog/cadence_wdt.c
@@ -313,6 +313,7 @@  static int cdns_wdt_probe(struct platform_device *pdev)
 	}
 	
 	cdns_wdt_device = &wdt->cdns_wdt_device;
+	cdns_wdt_device->parent = &pdev->dev;
 	cdns_wdt_device->info = &cdns_wdt_info;
 	cdns_wdt_device->ops = &cdns_wdt_ops;
 	cdns_wdt_device->timeout = CDNS_WDT_DEFAULT_TIMEOUT;
@@ -340,9 +341,6 @@  static int cdns_wdt_probe(struct platform_device *pdev)
 		}
 	}
 
-	/* Initialize the members of cdns_wdt structure */
-	cdns_wdt_device->parent = &pdev->dev;
-
 	ret = watchdog_init_timeout(cdns_wdt_device, wdt_timeout, &pdev->dev);
 	if (ret) {
 		dev_err(&pdev->dev, "unable to set timeout value\n");