02 Sep, 2016

1 commit

  • Check for rtc_class_ops structures that are only passed to
    devm_rtc_device_register, rtc_device_register,
    platform_device_register_data, all of which declare the corresponding
    parameter as const. Declare rtc_class_ops structures that have these
    properties as const.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct rtc_class_ops i@p = { ... };

    @ok@
    identifier r.i;
    expression e1,e2,e3,e4;
    position p;
    @@
    (
    devm_rtc_device_register(e1,e2,&i@p,e3)
    |
    rtc_device_register(e1,e2,&i@p,e3)
    |
    platform_device_register_data(e1,e2,e3,&i@p,e4)
    )

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

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
    struct rtc_class_ops i = { ... };
    //

    Signed-off-by: Julia Lawall
    Acked-by: Baruch Siach
    Acked-by: Hans Ulli Kroll
    Acked-by: Linus Walleij
    Acked-by: Thierry Reding
    Signed-off-by: Alexandre Belloni

    Julia Lawall
     

20 May, 2016

1 commit

  • stmp3xxx_wdt_register() can fail as platform_device_alloc() or
    platform_device_add() can fail. But when it fails it failed silently.
    Lets print out an error message on failure so that user will atlest
    know that there was some error.

    Signed-off-by: Sudip Mukherjee
    Signed-off-by: Alexandre Belloni

    Sudip Mukherjee
     

08 Nov, 2015

1 commit


17 Apr, 2015

1 commit

  • The rtc's status register allows to determine if a 32k crystal is
    connected to keep the rtc running in low power states provided the
    corresponding fuse bits were blown correctly during production. (In case
    they were not, the right frequency can be stated in the device tree.) If
    there is no such crystal available force the 24 MHz XTAL clock to keep
    running to retain the right date and time. Otherwise use the crystal to
    save some power.

    It would be nice to only switch to the crystal when the XTAL clock is
    about to be disabled and keep the crystal off when unneeded because XTAL
    is always on while the chip is powered on. But as sudden power loss isn't
    detectable this is not save.

    Signed-off-by: Uwe Kleine-König
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uwe Kleine-König
     

20 Oct, 2014

1 commit


13 Nov, 2013

1 commit


14 Aug, 2013

1 commit


10 Jul, 2013

1 commit


04 Jul, 2013

1 commit

  • The driver core clears the driver data to NULL after device_release or
    on probe failure, since commit 0998d063100 ("device-core: Ensure drvdata
    = NULL when no driver is bound"). Thus, it is not needed to manually
    clear the device driver data to NULL.

    Signed-off-by: Jingoo Han
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jingoo Han
     

03 May, 2013

1 commit

  • Pull ARM SoC cleanup from Olof Johansson:
    "Here is a collection of cleanup patches. Among the pieces that stand
    out are:

    - The deletion of h720x platforms
    - Split of at91 non-dt platforms to their own Kconfig file to keep
    them separate
    - General cleanups and refactoring of i.MX and MXS platforms
    - Some restructuring of clock tables for OMAP
    - Convertion of PMC driver for Tegra to dt-only
    - Some renames of sunxi -> sun4i (Allwinner A10)
    - ... plus a bunch of other stuff that I haven't mentioned"

    * tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (119 commits)
    ARM: i.MX: remove unused ARCH_* configs
    ARM i.MX53: remove platform ahci support
    ARM: sunxi: Rework the restart code
    irqchip: sunxi: Rename sunxi to sun4i
    irqchip: sunxi: Make use of the IRQCHIP_DECLARE macro
    clocksource: sunxi: Rename sunxi to sun4i
    clocksource: sunxi: make use of CLKSRC_OF
    clocksource: sunxi: Cleanup the timer code
    ARM: at91: remove trailing semicolon from macros
    ARM: at91/setup: fix trivial typos
    ARM: EXYNOS: remove "config EXYNOS_DEV_DRM"
    ARM: EXYNOS: change the name of USB ohci header
    ARM: SAMSUNG: Remove unnecessary code for dma
    ARM: S3C24XX: Remove unused GPIO drive strength register definitions
    ARM: OMAP4+: PM: Restore CPU power state to ON with clockdomain force wakeup method
    ARM: S3C24XX: Removed unneeded dependency on CPU_S3C2412
    ARM: S3C24XX: Removed unneeded dependency on CPU_S3C2410
    ARM: S3C24XX: Removed unneeded dependency on ARCH_S3C24XX for boards
    ARM: SAMSUNG: Fix typo "CONFIG_SAMSUNG_DEV_RTC"
    ARM: S5P64X0: Fix typo "CONFIG_S5P64X0_SETUP_SDHCI"
    ...

    Linus Torvalds
     

30 Apr, 2013

2 commits


01 Apr, 2013

1 commit


01 Mar, 2013

1 commit

  • This RTC also includes a watchdog timer. Provide an accessor function
    for setting the watchdog timeout value which will be picked up by a
    watchdog driver. Also register the platform_device for the watchdog here
    to get the boot-time dependencies right.

    Signed-off-by: Wolfram Sang
    Acked-by: Andrew Morton
    Signed-off-by: Wim Van Sebroeck

    Wolfram Sang
     

22 Feb, 2013

1 commit

  • This eliminates having an #ifdef returning NULL for the case when OF is
    disabled. Maintains consistency in cases where OF is always selected.

    Signed-off-by: Sachin Kamat
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sachin Kamat
     

03 Jul, 2012

1 commit


11 Jan, 2012

1 commit

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

    Signed-off-by: Axel Lin
    Acked-by: Mark Brown
    Acked-by: Mike Frysinger
    Acked-by: Guan Xuetao
    Acked-by: Linus Walleij
    Acked-by: Haojian Zhuang
    Cc: Alessandro Zummo
    Cc: Srinidhi Kasagar
    Cc: Lars-Peter Clausen
    Cc: Ben Dooks
    Cc: John Stultz
    Acked-by: Jean-Christophe PLAGNIOL-VILLARD
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Axel Lin
     

02 Jul, 2011

5 commits

  • The RTC core handles UIE since 6610e08 (RTC: Rework RTC code to use
    timerqueue for events), so remove the specific interrupt in this driver.
    To make it work at all, enable interrupts in set_alarm() if needed. Drop
    IRQF_DISABLED which is deprecated, while we are here. Finally, add my
    copyright after all these changes.

    Signed-off-by: Wolfram Sang
    Tested-by: Shawn Guo
    Signed-off-by: John Stultz

    Wolfram Sang
     
  • Replace the accessors with standard readl/writel to remove their
    platform-dependency. Also, drop __raw_(read|write)l-accessors while we
    are here.

    Signed-off-by: Wolfram Sang
    Tested-by: Shawn Guo
    Signed-off-by: John Stultz

    Wolfram Sang
     
  • Commit f44f7f96a20 ("RTC: Initialize kernel state from RTC") uncovered
    an issue in a number of RTC drivers, where the drivers call
    rtc_device_register before initializing the device or platform drvdata.

    This frequently results in null pointer dereferences when the
    rtc_device_register immediately makes use of the rtc device, calling
    rtc_read_alarm.

    The solution is to ensure the drvdata is initialized prior to registering
    the rtc device.

    Signed-off-by: Wolfram Sang
    Tested-by: Shawn Guo
    Signed-off-by: John Stultz

    Wolfram Sang
     
  • The stmp3xxx driver used to include functions from a stmp-specific
    include. Because of consolidation, plat-stmp has now been removed and
    merged with the compatible mach-mxs.

    Use the apropriate mxs-functions for transition. The accessors will be
    converted to readl/writel in a later patch.

    Signed-off-by: Wolfram Sang
    Tested-by: Shawn Guo
    Signed-off-by: John Stultz

    Wolfram Sang
     
  • The stmp3xxx driver used to include register names from a stmp-specific
    include. Because of consolidation, plat-stmp has now been removed and
    merged with the compatible mach-mxs. Restore the register names directly
    in the driver and rename them to be specific to this driver.

    Signed-off-by: Wolfram Sang
    Tested-by: Shawn Guo
    Signed-off-by: John Stultz

    Wolfram Sang
     

10 Mar, 2011

1 commit

  • Now that the generic code handles UIE mode irqs via periodic
    alarm interrupts, no one calls the
    rtc_class_ops->update_irq_enable() method anymore.

    This patch removes the driver hooks and implementations of
    update_irq_enable if no one else is calling it.

    CC: Thomas Gleixner
    CC: Alessandro Zummo
    CC: Marcelo Roberto Jimenez
    CC: rtc-linux@googlegroups.com
    Signed-off-by: John Stultz

    John Stultz
     

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
     

23 Sep, 2009

1 commit