14 Oct, 2020

1 commit

  • Common pattern of handling deferred probe can be simplified with
    dev_err_probe(). Less code and the error value gets printed.

    Signed-off-by: Krzysztof Kozlowski
    Reviewed-by: Guenter Roeck
    Link: https://lore.kernel.org/r/20200901153141.18960-2-krzk@kernel.org
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Krzysztof Kozlowski
     

09 Jul, 2019

1 commit


08 Jul, 2019

1 commit


06 May, 2019

2 commits

  • Use device managed functions to simplify error handling, reduce
    source code size, improve readability, and reduce the likelyhood of bugs.
    Other improvements as listed below.

    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

    - Drop assignments to otherwise unused variables
    - Drop unnecessary braces around conditional return statements
    - Drop empty remove function
    - Use devm_add_action_or_reset() for calls to clk_disable_unprepare
    - Use local variable 'struct device *dev' consistently
    - Use devm_watchdog_register_driver() to register watchdog device

    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     
  • Use devm_platform_ioremap_resource to reduce source code size,
    improve readability, and reduce the likelyhood of bugs.

    The conversion was done automatically with coccinelle using the
    following semantic patch.

    @r@
    identifier res, pdev;
    expression a;
    expression index;
    expression e;
    @@

    @depends on r@
    identifier r.res;
    @@
    - struct resource *res;
    ... when != res

    @@
    identifier res, pdev;
    expression index;
    expression a;
    @@
    - struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, index);
    - a = devm_ioremap_resource(&pdev->dev, res);
    + a = devm_platform_ioremap_resource(pdev, index);

    Cc: Joel Stanley
    Cc: Nicolas Ferre
    Cc: Alexandre Belloni
    Cc: Florian Fainelli
    Cc: Linus Walleij
    Cc: Baruch Siach
    Cc: Keguang Zhang
    Cc: Vladimir Zapolskiy
    Cc: Kevin Hilman
    Cc: Matthias Brugger
    Cc: Avi Fishman
    Cc: Nancy Yuen
    Cc: Brendan Higgins
    Cc: Wan ZongShun
    Cc: Michal Simek
    Cc: Sylvain Lemieux
    Cc: Kukjin Kim
    Cc: Barry Song
    Cc: Orson Zhai
    Cc: Patrice Chotard
    Cc: Maxime Coquelin
    Cc: Maxime Ripard
    Cc: Chen-Yu Tsai
    Cc: Marc Gonzalez
    Cc: Thierry Reding
    Cc: Shawn Guo
    Signed-off-by: Guenter Roeck
    Acked-by: Alexandre Belloni
    Tested-by: Alexandre Belloni
    Acked-by: Joel Stanley
    Reviewed-by: Linus Walleij
    Acked-by: Maxime Ripard
    Acked-by: Michal Simek (cadence/xilinx wdts)
    Acked-by: Thierry Reding
    Reviewed-by: Florian Fainelli
    Acked-by: Patrice Chotard
    Acked-by: Vladimir Zapolskiy
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Guenter Roeck
     

07 Jul, 2018

1 commit

  • At over 4000 #includes, is the 9th most
    #included header file in the Linux kernel. It does not need
    , so drop that header and explicitly add
    to source files that need it.

    4146 #include

    After this patch, there are 225 files that use ,
    for a reduction of around 3900 times that
    does not have to be read & parsed.

    225 #include

    This patch was build-tested on 20 different arch-es.

    It also makes these drivers SubmitChecklist#1 compliant.

    Signed-off-by: Randy Dunlap
    Reported-by: kbuild test robot # drivers/media/platform/vimc/
    Reported-by: kbuild test robot # drivers/pinctrl/pinctrl-u300.c
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     

27 Mar, 2018

1 commit


29 Dec, 2017

1 commit

  • This adds a restart function to the davinci watchdog timer driver.

    This is copied from arch/arm/mach-davinci/time.c and will allow us to
    remove the code from there.

    Signed-off-by: David Lechner
    Reviewed-by: Guenter Roeck
    Signed-off-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    David Lechner
     

03 Jul, 2017

2 commits


16 Dec, 2016

1 commit


10 Sep, 2015

1 commit

  • /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
    Reviewed-by: Johannes Thumshirn
    Acked-by: Guenter Roeck
    Acked-by: H Hartley Sweeten
    Acked-by: Lee Jones
    Acked-by: Lubomir Rintel
    Acked-by: Maxime Coquelin
    Acked-by: Thierry Reding
    Acked-by: Viresh Kumar
    Acked-by: Linus Walleij
    Signed-off-by: Wim Van Sebroeck

    Pratyush Anand
     

20 Oct, 2014

1 commit


31 Mar, 2014

1 commit

  • None of these files are actually using any __init type directives
    and hence don't need to include . Most are just a
    left over from __devinit and __cpuinit removal, or simply due to
    code getting copied from one driver to the next.

    Signed-off-by: Paul Gortmaker
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck
    Cc: linux-watchdog@vger.kernel.org

    Paul Gortmaker
     

29 Jan, 2014

4 commits

  • The keystone arch uses the same IP watchdog, so add "ti,keystone-wdt"
    compatible and correct identity.

    The Keystone arch is using clocks in DT and source clock for watchdog
    has to be specified, so add this to binding.

    Signed-off-by: Ivan Khoronzhuk
    Acked-by: Santosh Shilimkar
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Ivan Khoronzhuk
     
  • Currently, the davinci watchdog can be read while counting,
    so we can add ability to report the remaining time before
    the system will reboot.

    Signed-off-by: Ivan Khoronzhuk
    Acked-by: Santosh Shilimkar
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Ivan Khoronzhuk
     
  • Some SoCs, like Keystone 2, can support more than one WDT and each
    watchdog device has to use it's own base address, clock source,
    watchdog device, so add new davinci_wdt_device structure to hold
    device data.

    Signed-off-by: Ivan Khoronzhuk
    Acked-by: Santosh Shilimkar
    Reviewed-by: Guenter roeck
    Signed-off-by: Wim Van Sebroeck

    Ivan Khoronzhuk
     
  • To reduce code duplicate and increase code readability use WDT core
    code to handle WDT interface.

    Remove io_lock as the WDT core uses mutex to lock each wdt device.
    Remove wdt_state as the WDT core tracks state with its own variable.

    The watchdog_init_timeout() can read timeout value from timeout-sec
    property if the passed value is out of bounds. The heartbeat is
    initialized in next way. If heartbeat is not set thought module
    parameter, try to read it's value from WDT node timeout-sec property.
    If node has no one, use default value.

    The heartbeat is hold in wdd->timeout by WDT core, so use it in
    order to set timeout period.

    Davinci WDT can't be stopped and once it's expired - it can be
    rearmed only after hardware reset, that's why nowayout feature
    is enforced.

    Signed-off-by: Ivan Khoronzhuk
    Acked-by: Santosh Shilimkar
    Reviewed-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck

    Ivan Khoronzhuk
     

09 Jan, 2014

1 commit


18 Nov, 2013

1 commit

  • I just can't find any value in MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR)
    and MODULE_ALIAS_MISCDEV(TEMP_MINOR) statements.

    Either the device is enumerated and the driver already has a module
    alias (e.g. PCI, USB etc.) that will get the right driver loaded
    automatically.

    Or the device is not enumerated and loading its driver will lead to
    more or less intrusive hardware poking. Such hardware poking should be
    limited to a bare minimum, so the user should really decide which
    drivers should be tried and in what order. Trying them all in
    arbitrary order can't do any good.

    On top of that, loading that many drivers at once bloats the kernel
    log. Also many drivers will stay loaded afterward, bloating the output
    of "lsmod" and wasting memory. Some modules (cs5535_mfgpt which gets
    loaded as a dependency) can't even be unloaded!

    If defining char-major-10-130 is needed then it should happen in
    user-space.

    Signed-off-by: Jean Delvare
    Acked-by: Guenter Roeck
    Signed-off-by: Wim Van Sebroeck
    Cc: Stephen Warren
    Cc: Mike Frysinger
    Cc: Wan ZongShun
    Cc: Ben Dooks
    Cc: Kukjin Kim
    Cc: Zwane Mwaikambo
    Cc: Jim Cromie

    Jean Delvare
     

18 May, 2013

1 commit


09 May, 2013

1 commit

  • Use the newly introduced devm_ioremap_resource() instead of
    devm_request_and_ioremap() which provides more consistent error handling.

    devm_ioremap_resource() provides its own error messages; so all explicit
    error messages can be removed from the failure code paths.

    Signed-off-by: Sachin Kamat
    Reviewed-by: Thierry Reding
    Cc: Gabor Juhos
    Cc: Paul Mundt
    Signed-off-by: Wim Van Sebroeck

    Sachin Kamat
     

01 Mar, 2013

2 commits


20 Dec, 2012

2 commits

  • This adds OF support for davinci_wdt driver.

    Signed-off-by: Murali Karicheri
    Acked-by: Grant Likely
    Signed-off-by: Wim Van Sebroeck

    Murali Karicheri
     
  • As a first step towards migrating davinci platforms to use common clock
    framework, replace all instances of clk_enable() with clk_prepare_enable()
    and clk_disable() with clk_disable_unprepare(). Until the platform is
    switched to use the CONFIG_HAVE_CLK_PREPARE Kconfig variable, this just
    adds a might_sleep() call and would work without any issues.

    This will make it easy later to switch to common clk based implementation
    of clk driver from DaVinci specific driver.

    Signed-off-by: Murali Karicheri
    Signed-off-by: Wim Van Sebroeck

    Karicheri, Muralidharan
     

29 Nov, 2012

3 commits

  • CONFIG_HOTPLUG is going away as an option so __devexit is no
    longer needed.

    Signed-off-by: Bill Pemberton
    Cc: Wim Van Sebroeck
    Cc: Wan ZongShun
    Cc: Ben Dooks
    Cc: Kukjin Kim
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devinit is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Wim Van Sebroeck
    Cc: Wan ZongShun
    Cc: Ben Dooks
    Cc: Kukjin Kim
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Wim Van Sebroeck
    Cc: Wan ZongShun
    Cc: Ben Dooks
    Cc: Kukjin Kim
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     

06 Jan, 2012

1 commit

  • This patch converts the drivers in drivers/watchdog/* to use the
    module_platform_driver() macro which makes the code smaller and a bit
    simpler.

    Signed-off-by: Axel Lin
    Cc: Nicolas Thill
    Cc: Florian Fainelli
    Cc: "David S. Miller"
    Cc: Paul Cercueil
    Cc: Marc Zyngier
    Cc: Wan ZongShun
    Cc: Alejandro Cabrera
    Cc: "George G. Davis"
    Cc: Sylver Bruneau
    Cc: Vitaly Wool
    Cc: Mika Westerberg
    Cc: Timo Kokkonen
    Signed-off-by: Wim Van Sebroeck

    Axel Lin
     

29 Mar, 2011

1 commit

  • Request_mem_region should be used with release_mem_region, not
    release_resource.

    In pnx4008_wdt.c, a missing clk_put is added as well.

    The semantic match that finds the first problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression x,E;
    @@
    *x = request_mem_region(...)
    ... when != release_mem_region(x)
    when != x = E
    * release_resource(x);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Wim Van Sebroeck
    Cc: stable

    Julia Lawall
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

07 Mar, 2010

1 commit


24 Dec, 2009

1 commit

  • Use resource_size().

    Signed-off-by: H Hartley Sweeten
    Cc: Kevin Hilman
    Cc: Kevin Hilman
    Cc: Ulrik Bech Hald
    Cc: Henrique de Moraes Holschuh
    Cc: Ming Lei
    Cc: Vincent Sanders
    Acked-by: Thierry Reding
    Signed-off-by: Wim Van Sebroeck
    Signed-off-by: Andrew Morton

    H Hartley Sweeten
     

18 Sep, 2009

1 commit


18 Jun, 2009

1 commit


25 Mar, 2009

1 commit


09 Aug, 2008

1 commit

  • Conflicts:

    drivers/watchdog/at91rm9200_wdt.c
    drivers/watchdog/davinci_wdt.c
    drivers/watchdog/ep93xx_wdt.c
    drivers/watchdog/ixp2000_wdt.c
    drivers/watchdog/ixp4xx_wdt.c
    drivers/watchdog/ks8695_wdt.c
    drivers/watchdog/omap_wdt.c
    drivers/watchdog/pnx4008_wdt.c
    drivers/watchdog/sa1100_wdt.c
    drivers/watchdog/wdt285.c

    Russell King
     

07 Aug, 2008

2 commits