History log of /linux-master/drivers/watchdog/da9055_wdt.c
Revision Date Author Comments
# 862c13b5 08-Apr-2019 Guenter Roeck <linux@roeck-us.net>

watchdog: da9055_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.opensource@diasemi.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Steve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>


# 2e62c498 16-Mar-2018 Marcus Folkesson <marcus.folkesson@gmail.com>

watchdog: add SPDX identifiers for watchdog subsystem

- Add SPDX identifier
- Remove boiler plate license text
- If MODULE_LICENSE and boiler plate does not match, go for boiler plate
license

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Keiji Hayashibara <hayashibara.keiji@socionext.com>
Acked-by: Johannes Thumshirn <jth@kernel.org>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Mans Rullgard <mans@mansr.com>
Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>


# 89f944c0 10-Jan-2017 Guenter Roeck <linux@roeck-us.net>

watchdog: da9055_wdt: Convert to use device managed functions

Use device managed functions to simplify error handling, reduce
source code size, improve readability, and reduce the likelyhood of bugs.

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

- Replace 'goto l; ... l: return e;' with 'return e;'
- Drop assignments to otherwise unused variables
- Drop remove function
- Drop platform_set_drvdata()
- Use devm_watchdog_register_driver() to register watchdog device

Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 6c368932 26-Dec-2016 Bhumika Goyal <bhumirks@gmail.com>

watchdog: constify watchdog_info structures

Declare watchdog_info structures as const as they are only stored in the
info field of watchdog_device structures. This field is of type const
struct watchdog_info *, so watchdog_info structures having this property
can be declared const too.
Done using Coccinelle:

@r1 disable optional_qualifier@
identifier i;
position p;
@@
static struct watchdog_info i@p={...};

@ok@
identifier r1.i;
position p;
struct watchdog_device obj;
@@
obj.info=&i@p;

@bad@
position p!={r1.p,ok.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct watchdog_info i;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 43f676ac 25-Dec-2015 Guenter Roeck <linux@roeck-us.net>

watchdog: da9055_wdt: Drop reference counting

Reference counting is now implemented in the watchdog core and no longer
required in watchdog drivers.

Since it was implememented a no-op, and since the local memory is allocated
with devm_kzalloc(), the reference counting code in the driver really did
not really work anyway, and this patch effectively fixes a bug which could
cause a crash on unloading if the watchdog device was still open.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>


# 6551881c 20-Aug-2015 Pratyush Anand <panand@redhat.com>

Watchdog: Fix parent of watchdog_devices

/sys/class/watchdog/watchdogn/device/modalias can help to identify the
driver/module for a given watchdog node. However, many wdt devices do not
set their parent and so, we do not see an entry for device in sysfs for
such devices.

This patch fixes parent of watchdog_device so that
/sys/class/watchdog/watchdogn/device is populated.

Exceptions: booke, diag288, octeon, softdog and w83627hf -- They do not
have any parent. Not sure, how we can identify driver for these devices.

Signed-off-by: Pratyush Anand <panand@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Lubomir Rintel <lkundrak@v3.sk>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>


# 8deea830 10-Feb-2014 Jingoo Han <jg1.han@samsung.com>

watchdog: Remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message. For example,
k.alloc and v.alloc failures use dump_stack().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de> [for at32ap700x]
Acked-by: Lubomir Rintel <lkundrak@v3.sk> [for bcm2835]
Acked-by: Viresh Kumar <viresh.kumar@linaro.org> [for sp805_wdt]
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> [for ts72xx_wdt]
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>


# 76692c94 23-May-2013 Jingoo Han <jg1.han@samsung.com>

watchdog: da9055: use platform_{get,set}_drvdata()

Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>


# 98e4a293 21-Dec-2012 Axel Lin <axel.lin@ingics.com>

watchdog: da9055: Don't update wdt_dev->timeout in da9055_wdt_set_timeout error path

Otherwise, WDIOC_GETTIMEOUT returns wrong value if set_timeout fails.
This patch also removes unnecessary ret variable in da9055_wdt_ping function.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>


# ee8c94ad 21-Dec-2012 Axel Lin <axel.lin@ingics.com>

watchdog: da9055: Fix invalid free of devm_ allocated data

It is not required to free devm_ allocated data. Since kref_put
needs a valid release function, da9055_wdt_release_resources()
is not deleted.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>


# 312b00e1 12-Oct-2012 Ashish Jangam <ashish.jangam@kpitcummins.com>

watchdog: DA9055 Watchdog driver

This is the Watchdog patch for the DA9055 PMIC. This patch has got dependency on
the DA9055 MFD core.

This patch is functionally tested on SMDK6410

Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Ashish Jangam <ashish.jangam@kpitcummins.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>