[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8d44aaf119c286ac18ead30a2174aecef2dbc7e2.camel@perches.com>
Date: Wed, 10 Apr 2019 09:52:09 -0700
From: Joe Perches <joe@...ches.com>
To: Guenter Roeck <linux@...ck-us.net>,
Wim Van Sebroeck <wim@...ux-watchdog.org>
Cc: linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 20/22] watchdog: jz4740_wdt: Use 'dev' instead of
dereferencing it repeatedly
On Wed, 2019-04-10 at 09:28 -0700, Guenter Roeck wrote:
> Introduce local variable 'struct device *dev' and use it instead of
> dereferencing it repeatedly. Also, there is no call to dev_get_drvdata()
> or platform_get_drvdata() in the driver, so drop the unnecessary
> call to platform_set_drvdata().
Dropping platform_set_drvdata seems to me like it should
be a separate patch.
And are you sure no other function uses a get_drvdata call?
Maybe something in watchdog_dev.c? Possibly:
#ifdef CONFIG_WATCHDOG_SYSFS
static ssize_t nowayout_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct watchdog_device *wdd = dev_get_drvdata(dev);
return sprintf(buf, "%d\n", !!test_bit(WDOG_NO_WAY_OUT, &wdd->status));
}
static DEVICE_ATTR_RO(nowayout);
> diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c
[]
> @@ -189,18 +190,16 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
[]
> - platform_set_drvdata(pdev, drvdata);
> -
> return 0;
> }
>
Powered by blists - more mailing lists