27 Nov, 2019

1 commit

  • Fix the following warning:
    drivers/rtc/rtc-tegra.c: In function ‘tegra_rtc_read_time’:
    drivers/rtc/rtc-tegra.c:106:11: warning: variable ‘msec’ set but not used [-Wunused-but-set-variable]

    Cc: Thierry Reding
    Cc: Jonathan Hunter
    Acked-by: Thierry Reding
    Link: https://lore.kernel.org/r/20191122102212.400158-8-alexandre.belloni@bootlin.com
    Signed-off-by: Alexandre Belloni

    Alexandre Belloni
     

07 Oct, 2019

1 commit

  • Use devm_platform_ioremap_resource() to simplify the code a bit.
    This is detected by coccinelle.

    Signed-off-by: YueHaibing
    Link: https://lore.kernel.org/r/20191006102953.57536-2-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-3-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-4-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-5-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-6-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-7-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-8-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-9-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-10-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-11-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-12-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-13-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-14-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-15-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-16-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-17-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-18-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-19-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-20-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-21-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-22-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-23-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-24-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-25-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-26-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-27-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-28-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-29-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-30-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-31-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-32-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-33-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-34-yuehaibing@huawei.com
    Link: https://lore.kernel.org/r/20191006102953.57536-35-yuehaibing@huawei.com
    Signed-off-by: Alexandre Belloni

    YueHaibing
     

21 Aug, 2019

1 commit

  • The RTC core now has error messages in case of registration failure, there
    is no need to have other messages in the drivers.

    Signed-off-by: Alexandre Belloni
    Link: https://lore.kernel.org/r/20190818220041.17833-2-alexandre.belloni@bootlin.com
    Signed-off-by: Alexandre Belloni

    Alexandre Belloni
     

13 Aug, 2019

1 commit

  • We don't need dev_err() messages when platform_get_irq() fails now that
    platform_get_irq() prints an error message itself when something goes
    wrong. Let's remove these prints with a simple semantic patch.

    //
    @@
    expression ret;
    struct platform_device *E;
    @@

    ret =
    (
    platform_get_irq(E, ...)
    |
    platform_get_irq_byname(E, ...)
    );

    if ( \( ret < 0 \| ret

    While we're here, remove braces on if statements that only have one
    statement (manually).

    Cc: Alessandro Zummo
    Cc: Alexandre Belloni
    Cc: linux-rtc@vger.kernel.org
    Cc: Greg Kroah-Hartman
    Signed-off-by: Stephen Boyd
    Link: https://lore.kernel.org/r/20190730181557.90391-40-swboyd@chromium.org
    Signed-off-by: Alexandre Belloni

    Stephen Boyd
     

07 Jun, 2019

1 commit

  • RTC driver was converted to OF driver long time ago. The MODULE_ALIAS
    macro has no effect for the OF drivers since the alias is overridden by
    the drivers core to follow the OF naming convention of the driver's alias,
    which is based on the device-tree matching name.

    $ cat /sys/devices/soc0/7000e000.rtc/modalias
    of:NrtcT(null)Cnvidia,tegra20-rtc

    Signed-off-by: Dmitry Osipenko
    Acked-by: Thierry Reding
    Signed-off-by: Alexandre Belloni

    Dmitry Osipenko
     

02 Jun, 2019

3 commits

  • Drivers registered with module_platform_driver_probe() are considered
    non-hotpluggable, which among other things means that they don't support
    deferred probe. However, recent changes in how the ARM SMMU works have
    required the BPMP (which is the clock provider on Tegra186 and later) be
    bound to the SMMU, which in turn means that the BPMP driver can defer
    probe and hence clocks become available much later than they used to.
    For most other drivers this is not a problem because they already
    properly support deferred probe, but rtc-tegra is the odd one out that
    now fails to probe and will therefore never be registered.

    Fix this by making the driver a regular driver that supports unloading
    and deferred probe.

    Signed-off-by: Thierry Reding
    Signed-off-by: Alexandre Belloni

    Thierry Reding
     
  • Many of the variables have redundant prefixes or suffixes. Drop all of
    them where not necessary for context. Also make sure to use data types
    consistently. For instance, values read from 32-bit register accessors
    should be stored in u32.

    Signed-off-by: Thierry Reding
    Signed-off-by: Alexandre Belloni

    Thierry Reding
     
  • This set of changes fixes some checkpatch warnings as well as a number
    of punctuation and padding inconsistencies.

    Signed-off-by: Thierry Reding
    Signed-off-by: Alexandre Belloni

    Thierry Reding
     

08 Apr, 2019

3 commits


11 Dec, 2018

1 commit

  • Use %ptR instead of open coded variant to print content of
    struct rtc_time in human readable format.

    Cc: Thierry Reding
    Cc: Jonathan Hunter
    Signed-off-by: Andy Shevchenko
    Acked-by: Thierry Reding
    Signed-off-by: Alexandre Belloni

    Andy Shevchenko
     

16 Oct, 2018

1 commit


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
     

02 Mar, 2018

1 commit


23 Jan, 2017

1 commit

  • Accessing the registers of the RTC block on Tegra requires the module
    clock to be enabled. This only works because the RTC module clock will
    be enabled by default during early boot. However, because the clock is
    unused, the CCF will disable it at late_init time. This causes the RTC
    to become unusable afterwards. This can easily be reproduced by trying
    to use the RTC:

    $ hwclock --rtc /dev/rtc1

    This will hang the system. I ran into this by following up on a report
    by Martin Michlmayr that reboot wasn't working on Tegra210 systems. It
    turns out that the rtc-tegra driver's ->shutdown() implementation will
    hang the CPU, because of the disabled clock, before the system can be
    rebooted.

    What confused me for a while is that the same driver is used on prior
    Tegra generations where the hang can not be observed. However, as Peter
    De Schrijver pointed out, this is because on 32-bit Tegra chips the RTC
    clock is enabled by the tegra20_timer.c clocksource driver, which uses
    the RTC to provide a persistent clock. This code is never enabled on
    64-bit Tegra because the persistent clock infrastructure does not exist
    on 64-bit ARM.

    The proper fix for this is to add proper clock handling to the RTC
    driver in order to ensure that the clock is enabled when the driver
    requires it. All device trees contain the clock already, therefore
    no additional changes are required.

    Reported-by: Martin Michlmayr
    Acked-By Peter De Schrijver
    Signed-off-by: Thierry Reding
    Signed-off-by: Alexandre Belloni

    Thierry Reding
     

14 Jan, 2017

1 commit


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
     

09 Jul, 2016

1 commit


16 Apr, 2015

1 commit

  • The seq_printf return value, because it's frequently misused,
    will eventually be converted to void.

    See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
    seq_has_overflowed() and make public")

    Signed-off-by: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     

20 Oct, 2014

1 commit


18 May, 2013

1 commit


30 Apr, 2013

6 commits


23 Jan, 2013

1 commit

  • Convert all uses of devm_request_and_ioremap() to the newly introduced
    devm_ioremap_resource() 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: Thierry Reding
    Acked-by: Viresh Kumar
    Cc: Alessandro Zummo
    Signed-off-by: Greg Kroah-Hartman

    Thierry Reding
     

05 Jan, 2013

1 commit

  • After Kernel 3.7, the Tegra device will only support booting with DT.
    The legacy Tegra RTC platform driver will not work anymore. This patch
    converts the driver to support DT.

    Signed-off-by: Joseph Lo
    Cc: Stephen Warren
    Cc: Joseph Lo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joseph Lo
     

04 Jan, 2013

1 commit

  • CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
    markings need to be removed.

    This change removes the use of __devinit, __devexit_p, __devinitdata,
    __devinitconst, and __devexit from these drivers.

    Based on patches originally written by Bill Pemberton, but redone by me
    in order to handle some of the coding style issues better, by hand.

    Cc: Bill Pemberton
    Cc: Alessandro Zummo
    Cc: Srinidhi Kasagar
    Cc: Linus Walleij
    Cc: Mike Frysinger
    Cc: Wan ZongShun
    Cc: Guan Xuetao
    Cc: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

30 May, 2012

1 commit

  • Use the devres managed resource functions in the probe routine. Also
    affects the remove routine where the previously used free and release
    functions are not needed.

    The devm_* functions eliminate the need for manual resource releasing and
    simplify error handling. Resources allocated by devm_* are freed
    automatically on driver detach.

    Signed-off-by: Hannu Heikkinen
    Acked-by: Stephen Warren
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hannu Heikkinen
     

26 Jul, 2011

1 commit


23 Mar, 2011

1 commit