14 Oct, 2014

40 commits

  • In file included from scripts/sortextable.c:194:0:
    scripts/sortextable.c: In function `main':
    scripts/sortextable.h:176:3: warning: `relocs_size' may be used uninitialized in this function [-Wmaybe-uninitialized]
    memset(relocs, 0, relocs_size);
    ^
    scripts/sortextable.h:106:6: note: `relocs_size' was declared here
    int relocs_size;
    ^
    In file included from scripts/sortextable.c:192:0:
    scripts/sortextable.h:176:3: warning: `relocs_size' may be used uninitialized in this function [-Wmaybe-uninitialized]
    memset(relocs, 0, relocs_size);
    ^
    scripts/sortextable.h:106:6: note: `relocs_size' was declared here
    int relocs_size;
    ^

    gcc 4.9.1

    Signed-off-by: Tim Gardner
    Reviewed-by: Jamie Iles

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

    Tim Gardner
     
  • - headers_install requires at least two arguments

    - missed closing quote

    Signed-off-by: Javier Barrio
    Cc: Michal Marek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Javier Barrio
     
  • Resolve some shadow warnings produced in W=2 builds by changing the name
    of some parameters and local variables. Change instances of "s64"
    because that clashes with the well-known typedef. Also change a local
    variable with the name "up" because that clashes with the name of of the
    "up" function for semaphores. These are hazards so eliminate the
    hazards by renaming them.

    Signed-off-by: Mark Rustad
    Signed-off-by: Jeff Kirsher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Rustad
     
  • Using __seq_open_private() removes boilerplate code from
    sysvipc_proc_open().

    The resultant code is shorter and easier to follow.

    However, please note that __seq_open_private() call kzalloc() rather than
    kmalloc() which may affect timing due to the memory initialisation
    overhead.

    Signed-off-by: Rob Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rob Jones
     
  • do_shmat() is the only user of ->start_stack (proc just reports its
    value), and this check looks ugly and wrong.

    The reason for this check is not clear at all, and it wrongly assumes that
    the stack can only grow down.

    But the main problem is that in general mm->start_stack has nothing to do
    with stack_vma->vm_start. Not only the application can switch to another
    stack and even unmap this area, setup_arg_pages() expands the stack
    without updating mm->start_stack during exec(). This means that in the
    likely case "addr > start_stack - size - PAGE_SIZE * 5" is simply
    impossible after find_vma_intersection() == F, or the stack can't grow
    anyway because of RLIMIT_STACK.

    Many thanks to Hugh for his explanations.

    Signed-off-by: Oleg Nesterov
    Acked-by: Hugh Dickins
    Cc: Cyrill Gorcunov
    Cc: Davidlohr Bueso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • proc_dointvec_minmax() returns zero if a new value has been set. So we
    don't need to check all charecters have been handled.

    Below you can find two examples. In the new value has not been handled
    properly.

    $ strace ./a.out
    open("/proc/sys/kernel/auto_msgmni", O_WRONLY) = 3
    write(3, "0\n\0", 3) = 2
    close(3) = 0
    exit_group(0)
    $ cat /sys/kernel/debug/tracing/trace

    $strace ./a.out
    open("/proc/sys/kernel/auto_msgmni", O_WRONLY) = 3
    write(3, "0\n", 2) = 2
    close(3) = 0

    $ cat /sys/kernel/debug/tracing/trace
    a.out-697 [000] .... 3280.998235: unregister_ipcns_notifier
    Cc: Mathias Krause
    Cc: Manfred Spraul
    Cc: Joe Perches
    Cc: Davidlohr Bueso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Vagin
     
  • Resolve shadow warnings that are produced in W=2 builds by renaming a
    global with a too-generic name and renaming a formal parameter.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Mark Rustad
    Signed-off-by: Jeff Kirsher
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Rustad
     
  • Use the optimized ioresource lookup, "region_is_ram", for the ioremap
    function. If the region is not found, it falls back to the
    "page_is_ram" function. If it is found and it is RAM, then the usual
    warning message is issued, and the ioremap operation is aborted.
    Otherwise, the ioremap operation continues.

    Signed-off-by: Mike Travis
    Acked-by: Alex Thorlton
    Reviewed-by: Cliff Wickman
    Cc: Thomas Gleixner
    Cc: H. Peter Anvin
    Cc: Mark Salter
    Cc: Dave Young
    Cc: Rik van Riel
    Cc: Peter Zijlstra
    Cc: Mel Gorman
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Travis
     
  • We have a large university system in the UK that is experiencing very long
    delays modprobing the driver for a specific I/O device. The delay is from
    8-10 minutes per device and there are 31 devices in the system. This 4 to
    5 hour delay in starting up those I/O devices is very much a burden on the
    customer.

    There are two causes for requiring a restart/reload of the drivers. First
    is periodic preventive maintenance (PM) and the second is if any of the
    devices experience a fatal error. Both of these trigger this excessively
    long delay in bringing the system back up to full capability.

    The problem was tracked down to a very slow IOREMAP operation and the
    excessively long ioresource lookup to insure that the user is not
    attempting to ioremap RAM. These patches provide a speed up to that
    function.

    The modprobe time appears to be affected quite a bit by previous activity
    on the ioresource list, which I suspect is due to cache preloading. While
    the overall improvement is impacted by other overhead of starting the
    devices, this drastically improves the modprobe time.

    Also our system is considerably smaller so the percentages gained will not
    be the same. Best case improvement with the modprobe on our 20 device
    smallish system was from 'real 5m51.913s' to 'real 0m18.275s'.

    This patch (of 2):

    Since the ioremap operation is verifying that the specified address range
    is NOT RAM, it will search the entire ioresource list if the condition is
    true. To make matters worse, it does this one 4k page at a time. For a
    128M BAR region this is 32 passes to determine the entire region does not
    contain any RAM addresses.

    This patch provides another resource lookup function, region_is_ram, that
    searches for the entire region specified, verifying that it is completely
    contained within the resource region. If it is found, then it is checked
    to be RAM or not, within a single pass.

    The return result reflects if it was found or not (-1), and whether it is
    RAM (1) or not (0). This allows the caller to fallback to the previous
    page by page search if it was not found.

    [akpm@linux-foundation.org: fix spellos and typos in comment]
    Signed-off-by: Mike Travis
    Acked-by: Alex Thorlton
    Reviewed-by: Cliff Wickman
    Cc: Thomas Gleixner
    Cc: H. Peter Anvin
    Cc: Mark Salter
    Cc: Dave Young
    Cc: Rik van Riel
    Cc: Peter Zijlstra
    Cc: Mel Gorman
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Travis
     
  • This patch defines maximum block number to 2^31. It also converts
    bitmap_size and array_size to unsigned int in omfs_get_imap

    Signed-off-by: Fabian Frederick
    Suggested-by: Linus Torvalds
    Suggested-by: Bob Copeland
    Acked-by: Bob Copeland
    Tested-by: Bob Copeland
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • When PM_SLEEP is not enabled, the r592_clear_interrupts() function is
    never used. If so, don't build it to prevent a compiler warning.

    Signed-off-by: Thierry Reding
    Cc: Maxim Levitsky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thierry Reding
     
  • sys_tz is already declared in include/linux/time.h

    Signed-off-by: Fabian Frederick
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • Four functions declared variables twice resulting in shadow warnings.

    This patch renames internal variables and adds blank line after
    declarations.

    Signed-off-by: Fabian Frederick
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • head is set to AFFS_HEAD(bh) but never used.

    Signed-off-by: Fabian Frederick
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • key is set in affs_fill_super but never used.

    Signed-off-by: Fabian Frederick
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • The comment is copied from Documentation/rbtree.txt, but this comment is
    so important that it should also be in the code.

    Signed-off-by: Lai Jiangshan
    Acked-by: Michel Lespinasse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lai Jiangshan
     
  • David Howells brought to my attention the mails generated by kbuild test
    bot and following sparse warnings were present. This patch fixes these
    warnings.

    arch/x86/kernel/kexec-bzimage64.c:270:5: warning: symbol 'bzImage64_probe' was not declared. Should it be static?
    arch/x86/kernel/kexec-bzimage64.c:328:6: warning: symbol 'bzImage64_load' was not declared. Should it be static?
    arch/x86/kernel/kexec-bzimage64.c:517:5: warning: symbol 'bzImage64_cleanup' was not declared. Should it be static?
    arch/x86/kernel/kexec-bzimage64.c:531:5: warning: symbol 'bzImage64_verify_sig' was not declared. Should it be static?
    arch/x86/kernel/kexec-bzimage64.c:546:23: warning: symbol 'kexec_bzImage64_ops' was not declared. Should it be static?

    Signed-off-by: Vivek Goyal
    Reported-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vivek Goyal
     
  • This is a cleanup. In function parse_crashkernel_suffix, the parameter
    crash_base is not used. So here remove it.

    Signed-off-by: Baoquan He
    Acked-by: Vivek Goyal
    Cc: Eric W. Biederman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Baoquan He
     
  • Add a check if crashk_res_low exists just like GART region does. If
    crashk_res_low doesn't exist, calling exclude_mem_range is unnecessary.

    Meanwhile, since crashk_res_low has been initialized at definition, it's
    safe just use "if (crashk_low_res.end)" to check if it's exist. And this
    can make it consistent with other places of check.

    Signed-off-by: Baoquan He
    Acked-by: Vivek Goyal
    Cc: Eric W. Biederman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Baoquan He
     
  • In locate_mem_hole functions, a memory hole is located and added as
    kexec_segment. But from the name of locate_mem_hole, it should only take
    responsibility of searching a available memory hole to contain data of a
    specified size.

    So in this patch add a new field 'mem' into kexec_buf, then take that
    kexec segment adding code out of locate_mem_hole_top_down and
    locate_mem_hole_bottom_up. This make clear of the functionality of
    locate_mem_hole just like it declars to do. And by this
    locate_mem_hole_callback chould be used later if anyone want to locate a
    memory hole for other use.

    Meanwhile Vivek suggested opening code function __kexec_add_segment(),
    that way we have to retreive ksegment pointer once and it is easy to read.
    So just do it in this patch and remove __kexec_add_segment() since no one
    use it anymore.

    Signed-off-by: Baoquan He
    Acked-by: Vivek Goyal
    Cc: Eric W. Biederman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Baoquan He
     
  • Make the Makefile of kexec purgatory be consistent with others in linux
    src tree, and make it look generic and simple.

    Signed-off-by: Baoquan He
    Cc: Vivek Goyal
    Cc: H. Peter Anvin
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Baoquan He
     
  • format_corename() can only pass the leader's pid to the core handler,
    but there is no simple way to figure out which thread originated the
    coredump.

    As Jan explains, this also means that there is no simple way to create
    the backtrace of the crashed process:

    As programs are mostly compiled with implicit gcc -fomit-frame-pointer
    one needs program's .eh_frame section (equivalently PT_GNU_EH_FRAME
    segment) or .debug_frame section. .debug_frame usually is present only
    in separate debug info files usually not even installed on the system.
    While .eh_frame is a part of the executable/library (and it is even
    always mapped for C++ exceptions unwinding) it no longer has to be
    present anywhere on the disk as the program could be upgraded in the
    meantime and the running instance has its executable file already
    unlinked from disk.

    One possibility is to echo 0x3f >/proc/*/coredump_filter and dump all
    the file-backed memory including the executable's .eh_frame section.
    But that can create huge core files, for example even due to mmapped
    data files.

    Other possibility would be to read .eh_frame from /proc/PID/mem at the
    core_pattern handler time of the core dump. For the backtrace one needs
    to read the register state first which can be done from core_pattern
    handler:

    ptrace(PTRACE_SEIZE, tid, 0, PTRACE_O_TRACEEXIT)
    close(0); // close pipe fd to resume the sleeping dumper
    waitpid(); // should report EXIT
    PTRACE_GETREGS or other requests

    The remaining problem is how to get the 'tid' value of the crashed
    thread. It could be read from the first NT_PRSTATUS note of the core
    file but that makes the core_pattern handler complicated.

    Unfortunately %t is already used so this patch uses %i/%I.

    Automatic Bug Reporting Tool (https://github.com/abrt/abrt/wiki/overview)
    is experimenting with this. It is using the elfutils
    (https://fedorahosted.org/elfutils/) unwinder for generating the
    backtraces. Apart from not needing matching executables as mentioned
    above, another advantage is that we can get the backtrace without saving
    the core (which might be quite large) to disk.

    [mmilata@redhat.com: final paragraph of changelog]
    Signed-off-by: Jan Kratochvil
    Signed-off-by: Oleg Nesterov
    Cc: Alexander Viro
    Cc: Denys Vlasenko
    Cc: Jan Kratochvil
    Cc: Mark Wielaard
    Cc: Martin Milata
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Kill _NSIG_WORDS_is_unsupported_size(), use BUILD_BUG() instead. This
    simplifies the code, avoids the nested-externs warnings, and this way we
    do not defer the problem to linker.

    Also, fix the indentation in _SIG_SET_BINOP() and _SIG_SET_OP().

    Note: this patch assumes that the code like "if (0) BUILD_BUG();" is
    valid. If not (say __compiletime_error() is not defined and thus
    __compiletime_error_fallback() uses a negative array) we should fix
    BUILD_BUG() and/or BUILD_BUG_ON_MSG(). This code should be fine by
    definition, this is the documented purpose of BUILD_BUG().

    [sfr@canb.auug.org.au: fix powerpc build failures]
    Signed-off-by: Oleg Nesterov
    Reported-by: Jeff Kirsher
    Reviewed-by: Josh Triplett
    Signed-off-by: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • sys_tz is already declared extern struct in include/linux/time.h

    Signed-off-by: Fabian Frederick
    Cc: OGAWA Hirofumi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • Merge conditional unlock/lock in the same condition to avoid sparse
    warning:

    fs/reiserfs/journal.c:703:36: warning: context imbalance in 'add_to_chunk' - unexpected unlock

    Signed-off-by: Fabian Frederick
    Cc: Jeff Mahoney
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • ucg is defined and set in ufs_bitmap_search but never used.

    Signed-off-by: Fabian Frederick
    Cc: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • sys_tz is already declared in include/linux/time.h

    Signed-off-by: Fabian Frederick
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     
  • Support for fdatasync() has been implemented in NILFS2 for a long time,
    but whenever the corresponding inode is dirty the implementation falls
    back to a full-flegded sync(). Since every write operation has to
    update the modification time of the file, the inode will almost always
    be dirty and fdatasync() will fall back to sync() most of the time. But
    this fallback is only necessary for a change of the file size and not
    for a change of the various timestamps.

    This patch adds a new flag NILFS_I_INODE_SYNC to differentiate between
    those two situations.

    * If it is set the file size was changed and a full sync is necessary.
    * If it is not set then only the timestamps were updated and
    fdatasync() can go ahead.

    There is already a similar flag I_DIRTY_DATASYNC on the VFS layer with
    the exact same semantics. Unfortunately it cannot be used directly,
    because NILFS2 doesn't implement write_inode() and doesn't clear the VFS
    flags when inodes are written out. So the VFS writeback thread can
    clear I_DIRTY_DATASYNC at any time without notifying NILFS2. So
    I_DIRTY_DATASYNC has to be mapped onto NILFS_I_INODE_SYNC in
    nilfs_update_inode().

    Signed-off-by: Andreas Rohner
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andreas Rohner
     
  • Under normal circumstances nilfs_sync_fs() writes out the super block,
    which causes a flush of the underlying block device. But this depends
    on the THE_NILFS_SB_DIRTY flag, which is only set if the pointer to the
    last segment crosses a segment boundary. So if only a small amount of
    data is written before the call to nilfs_sync_fs(), no flush of the
    block device occurs.

    In the above case an additional call to blkdev_issue_flush() is needed.
    To prevent unnecessary overhead, the new flag nilfs->ns_flushed_device
    is introduced, which is cleared whenever new logs are written and set
    whenever the block device is flushed. For convenience the function
    nilfs_flush_device() is added, which contains the above logic.

    Signed-off-by: Andreas Rohner
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andreas Rohner
     
  • The Linux kernel coding style guidelines suggest not using typedefs for
    structure types. This patch gets rid of the typedef for befs_btree_node.

    The following Coccinelle semantic patch detects the case.

    @tn1@
    type td;
    @@

    typedef struct { ... } td;

    @script:python tf@
    td << tn1.td;
    tdres;
    @@

    coccinelle.tdres = td;

    @@
    type tn1.td;
    identifier tf.tdres;
    @@

    -typedef
    struct
    + tdres
    { ... }
    -td
    ;

    @@
    type tn1.td;
    identifier tf.tdres;
    @@

    -td
    + struct tdres

    Signed-off-by: Himangi Saraogi
    Acked-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Himangi Saraogi
     
  • Commit b5ada4600dfd ("drivers/rtc/rtc-cmos.c: fix compilation warning
    when !CONFIG_PM_SLEEP") broke wakeup from S5 by making cmos_poweroff a
    nop unless CONFIG_PM_SLEEP was defined.

    Fix this by restricting the #ifdef to cmos_resume and restoring the old
    dependency on CONFIG_PM for cmos_suspend and cmos_poweroff.

    Signed-off-by: Daniel Glöckner
    Cc: Mika Westerberg
    Cc: Alessandro Zummo
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Glöckner
     
  • Some drivers need 'devm_ioremap_resource' or 'devm_ioremap' which need
    HAS_IOMEM, so let them depend on it.

    The related error (with allmodconfig under score):

    MODPOST 1365 modules
    ERROR: "devm_ioremap_resource" [drivers/rtc/rtc-xgene.ko] undefined!
    ERROR: "devm_ioremap_resource" [drivers/rtc/rtc-stk17ta8.ko] undefined!
    ERROR: "devm_ioremap_resource" [drivers/rtc/rtc-ds1742.ko] undefined!
    ERROR: "devm_ioremap_resource" [drivers/rtc/rtc-ds1553.ko] undefined!
    ERROR: "devm_ioremap_resource" [drivers/rtc/rtc-ds1511.ko] undefined!
    ERROR: "devm_ioremap_resource" [drivers/rtc/rtc-ds1286.ko] undefined!
    ERROR: "devm_ioremap" [drivers/rtc/rtc-rp5c01.ko] undefined!
    ERROR: "devm_ioremap" [drivers/rtc/rtc-msm6242.ko] undefined!
    ERROR: "devm_ioremap" [drivers/rtc/rtc-m48t59.ko] undefined!
    ERROR: "devm_ioremap" [drivers/rtc/rtc-m48t35.ko] undefined!
    ERROR: "devm_ioremap" [drivers/rtc/rtc-bq4802.ko] undefined!

    Signed-off-by: Chen Gang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chen Gang
     
  • Instead of pushing each byte let's reduce stack usage by using %*ph specifier.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • As pointed out by Sergei Shtylyov, the pcf8563_irq function contains a
    bug in the error handling: an interrupt handler is not supposed to
    return an errno value but an 'enum irqreturn'.

    Let's fix this by returning IRQ_NONE in case of a communication error.

    Signed-off-by: Arnd Bergmann
    Cc: Sergei Shtylyov
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     
  • gcc-4.9 found a potential condition under which the 'pending' variable
    may be used uninitialized:

    drivers/rtc/rtc-pcf8563.c: In function 'pcf8563_irq':
    drivers/rtc/rtc-pcf8563.c:173:5: warning: 'pending' may be used uninitialized in this function [-Wmaybe-uninitialized]

    This is because in the pcf8563_get_alarm_mode() function, we check any
    nonzero return of pcf8563_read_block_data, but in the irq function we
    only check for negative values, so a possible positive value does not
    get detected if the compiler chooses not to inline the entire call
    chain.

    Checking for any non-zero value in the interrupt handler as well is just
    as correct and lets the compiler know what we are doing, without needing
    a bogus initialization.

    Signed-off-by: Arnd Bergmann
    Cc: Sergei Shtylyov
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     
  • The MAX7802 PMIC has a Real-Time-Clock (RTC) with two alarms. This
    patch adds support for the RTC and is based on a driver added by Simon
    Glass to the Chrome OS kernel 3.8 tree.

    [akpm@linux-foundation.org: add comment clarifying ffs() use]
    Signed-off-by: Javier Martinez Canillas
    Reviewed-by: Krzysztof Kozlowski
    Cc: Doug Anderson
    Cc: Alessandro Zummo
    Cc: Olof Johansson
    Cc: Simon Glass
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Javier Martinez Canillas
     
  • max77686_rtc_calculate_wday() is used to calculate the day of the week
    to be filled in struct rtc_time but that function only calculates the
    number of bits shifted. So the ffs() function can be used to find the
    first bit set instead of a special function.

    [akpm@linux-foundation.org: add comment clarifying ffs() use]
    Signed-off-by: Javier Martinez Canillas
    Cc: Joe Perches
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Javier Martinez Canillas
     
  • If devm_rtc_device_register() fails a dev_err() is already reported so
    there is no need to do an additional dev_info().

    Signed-off-by: Javier Martinez Canillas
    Cc: Doug Anderson
    Cc: Krzysztof Kozlowski
    Cc: Alessandro Zummo
    Cc: Olof Johansson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Javier Martinez Canillas
     
  • The max77686 mfd driver adds a regmap IRQ chip which creates an IRQ
    domain that is used to map the virtual RTC alarm1 interrupt.

    The RTC driver assumes that this will always be true since the PMIC IRQ
    is a required property according to the max77686 DT binding doc. If an
    "interrupts" property is not defined for a max77686 PMIC, then the mfd
    probe function will fail and the RTC platform driver will never be
    probed.

    But even when it is not possible to probe the rtc-max77686 driver
    without a regmap IRQ chip, it's better to explicitly check if the IRQ
    chip data is not NULL and gracefully fail instead of getting an OOPS.

    Signed-off-by: Javier Martinez Canillas
    Reported-by: Krzysztof Kozlowski
    Cc: Doug Anderson
    Cc: Alessandro Zummo
    Cc: Olof Johansson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Javier Martinez Canillas
     
  • The MAX77686 RTC chip has two features called SMPL (Sudden Momentary
    Power Loss) and WTSR (Watchdog Timeout and Software Resets). Support
    for these features seems to be implemented in the driver but compilation
    is disabled using a C pre-processor conditional.

    This code has been disabled since the driver was original merged in
    commit fca1dd031a28 ("rtc: max77686: add Maxim 77686 driver").

    So, since this code has never been built, let's just remove it.

    Signed-off-by: Javier Martinez Canillas
    Reviewed-by: Krzysztof Kozlowski
    Cc: Doug Anderson
    Cc: Alessandro Zummo
    Cc: Olof Johansson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Javier Martinez Canillas