Hi Guenter,

On 08 April 2019 20:39, Guenter Roeck:

> Subject: [PATCH 12/22] watchdog: da9063_wdt: Use 'dev' instead of
> dereferencing it repeatedly
> 
> Introduce local variable 'struct device *dev' and use it instead of
> dereferencing it repeatedly.
> 
> The conversion was done automatically with coccinelle using the
> following semantic patches. The semantic patches and the scripts
> used to generate this commit log are available at
> https://github.com/groeck/coccinelle-patches
> 
> Cc: Support Opensource <support.opensou...@diasemi.com>
> Signed-off-by: Guenter Roeck <li...@roeck-us.net>
> ---
>  drivers/watchdog/da9063_wdt.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/watchdog/da9063_wdt.c b/drivers/watchdog/da9063_wdt.c
> index 384dca16af8b..06eb9070203c 100644
> --- a/drivers/watchdog/da9063_wdt.c
> +++ b/drivers/watchdog/da9063_wdt.c
> @@ -188,17 +188,18 @@ static const struct watchdog_ops
> da9063_watchdog_ops = {
> 
>  static int da9063_wdt_probe(struct platform_device *pdev)
>  {
> +     struct device *dev = &pdev->dev;
>       struct da9063 *da9063;
>       struct watchdog_device *wdd;
> 
> -     if (!pdev->dev.parent)
> +     if (!dev->parent)
>               return -EINVAL;

None of my previous Acked e-mails in this patch set considered whether the
dev->parent was NULL. But this DA9063 driver does.

Logically, this is correct to check, but ... any thoughts?
Otherwise,

Acked-by: Steve Twiss <stwiss.opensou...@diasemi.com>

Regards,
Steve

Reply via email to