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
     

01 Nov, 2011

1 commit


10 Jun, 2011

1 commit


22 May, 2010

1 commit


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
     

15 Mar, 2010

1 commit

  • Commit 6992f5334995af474c2b58d010d08bc597f0f2fe ("sysfs: Use one lockdep
    class per sysfs attribute.") introduced this requirement. First, at25
    was fixed manually. Then, other occurences were found with coccinelle
    and the following semantic patch. Results were reviewed and fixed up:

    @ init @
    identifier struct_name, bin;
    @@

    struct struct_name {
    ...
    struct bin_attribute bin;
    ...
    };

    @ main extends init @
    expression E;
    statement S;
    identifier name, err;
    @@

    (
    struct struct_name *name;
    |
    - struct struct_name *name = NULL;
    + struct struct_name *name;
    )
    ...
    (
    sysfs_bin_attr_init(&name->bin);
    |
    + sysfs_bin_attr_init(&name->bin);
    if (sysfs_create_bin_file(E, &name->bin))
    S
    |
    + sysfs_bin_attr_init(&name->bin);
    err = sysfs_create_bin_file(E, &name->bin);
    )

    Signed-off-by: Wolfram Sang
    Cc: Eric W. Biederman
    Signed-off-by: Linus Torvalds

    Wolfram Sang
     

16 Dec, 2009

2 commits


19 Jun, 2009

1 commit

  • The RTC driver for ds1742 / ds1743 uses a static nvram attribute. This
    patch replaces this static attribute with one nvram attribute for each
    ds174x registered.

    The nvram size is not the same for all types of ds174x. The nvram size is
    accessible as the file size of the nvram attribute in sysfs. With only a
    single nvram attribute, this file size will be incorrect if more than one
    type of ds174x is present on a system. See the comment in the removed
    code below.

    This patch have been tested with linux-2.6.28 and linux-2.6.29-rc5/6 on a
    custom board with one ds1743.

    Signed-off-by: Torsten Ertbjerg Rasmussen
    Signed-off-by: Alessandro Zummo
    Cc: Atsushi Nemoto
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Torsten Ertbjerg Rasmussen
     

20 Oct, 2008

1 commit

  • Change drivers/rtc/ to use the new bcd2bin/bin2bcd functions instead of
    the obsolete BCD_TO_BIN/BIN_TO_BCD/BCD2BIN/BIN2BCD macros.

    Signed-off-by: Adrian Bunk
    Acked-by: Alessandro Zummo
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

11 Apr, 2008

1 commit

  • Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias is
    prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable RTC
    platform drivers, to re-enable module auto loading.

    [dbrownell@users.sourceforge.net: more drivers, minor fix]
    Signed-off-by: Kay Sievers
    Signed-off-by: David Brownell
    Cc: Greg KH
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kay Sievers
     

15 Nov, 2007

1 commit

  • Several of the RTC drivers are exporting binary "nvram" files in sysfs. Such
    NVRAM (or on many systems, EEPROM) data is often initialized during system
    manufacture to hold data about identity (serial numbers, Ethernet addresses,
    etc), configuration, calibration, and so forth.

    This patch improves integrity and security of those files:

    - Correctly initializes the size in one of the two cases where
    that was not yet being done.

    - Improves system security/integrity by making this state not
    be world-writable by default.

    Letting arbitrary userspace code mangle such state by default is at least Not
    A Good Thing; and it could sometimes be worse, depending on the particular
    data that might be corrupted. (I disregard the paranoiac "don't let anyone
    read it either" approach. Anyone storing passwords in such memory doesn't
    really care about security.)

    Signed-off-by: David Brownell
    Acked-by: Atsushi Nemoto
    Cc: Torsten Ertbjerg Rasmussen
    Cc: Mark Zhan
    Cc: Thomas Hommel
    Acked-by: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

17 Oct, 2007

1 commit

  • The rtc-ds1742 platform driver name doesn't match its module name,
    which might prevents it from properly hotplugging. There is only two
    in-tree user of its driver, which are fixed by this patch too.

    Signed-off-by: Atsushi Nemoto
    Cc: Alessandro Zummo
    Cc: David Brownell
    Cc: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Atsushi Nemoto
     

20 Sep, 2007

1 commit

  • Currently the rtc driver, rtc-ds1742.c uses an unsigned long to store the
    base mmio address of the NVRAM/RTC. This breaks on systems like PowerPC
    440, which is a 32-bit core with 36-bit physical addresses: IO on the
    system, including the RTC, is typically above the 4GB point, and cannot fit
    into an unsigned long.

    This patch fixes the problem by replacing the unsigned long with a
    resource_size_t. Tested on Ebony (PPC440) (with additional patches to
    instantiate the ds1742 platform device appropriately).

    Signed-off-by: David Gibson
    Acked-by: Atsushi Nemoto
    Cc: Alessandro Zummo
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Gibson
     

22 Jul, 2007

1 commit

  • This patch fixes these sparse warnings:

    drivers/rtc/rtc-ds1742.c:265:2: warning: returning void-valued expression
    drivers/rtc/rtc-ds1553.c:409:2: warning: returning void-valued expression

    Signed-off-by: Atsushi Nemoto
    Cc: David Brownell
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Atsushi Nemoto
     

12 Jul, 2007

2 commits

  • Well, first of all, I don't want to change so many files either.

    What I do:
    Adding a new parameter "struct bin_attribute *" in the
    .read/.write methods for the sysfs binary attributes.

    In fact, only the four lines change in fs/sysfs/bin.c and
    include/linux/sysfs.h do the real work.
    But I have to update all the files that use binary attributes
    to make them compatible with the new .read and .write methods.
    I'm not sure if I missed any. :(

    Why I do this:
    For a sysfs attribute, we can get a pointer pointing to the
    struct attribute in the .show/.store method,
    while we can't do this for the binary attributes.
    I don't know why this is different, but this does make it not
    so handy to use the binary attributes as the regular ones.
    So I think this patch is reasonable. :)

    Who benefits from it:
    The patch that exposes ACPI tables in sysfs
    requires such an improvement.
    All the table binary attributes share the same .read method.
    Parameter "struct bin_attribute *" is used to get
    the table signature and instance number which are used to
    distinguish different ACPI table binary attributes.

    Without this parameter, we need to offer different .read methods
    for different ACPI table binary attributes.
    This is impossible as there are various ACPI tables on different
    platforms, and we don't know what they are until they are loaded.

    Signed-off-by: Zhang Rui
    Signed-off-by: Greg Kroah-Hartman

    Zhang Rui
     
  • sysfs is now completely out of driver/module lifetime game. After
    deletion, a sysfs node doesn't access anything outside sysfs proper,
    so there's no reason to hold onto the attribute owners. Note that
    often the wrong modules were accounted for as owners leading to
    accessing removed modules.

    This patch kills now unnecessary attribute->owner. Note that with
    this change, userland holding a sysfs node does not prevent the
    backing module from being unloaded.

    For more info regarding lifetime rule cleanup, please read the
    following message.

    http://article.gmane.org/gmane.linux.kernel/510293

    (tweaked by Greg to not delete the field just yet, to make it easier to
    merge things properly.)

    Signed-off-by: Tejun Heo
    Cc: Cornelia Huck
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

13 Feb, 2007

1 commit

  • Change __init to __devinit in rtc drivers' probe functions.

    Resolves MODPOST warnings:

    WARNING: drivers/rtc/rtc-ds1553.o - Section mismatch: reference to
    .init.text:ds1553_rtc_probe from .data.rel between 'ds1553_rtc_driver' (at
    offset 0x0) and 'ds1553_nvram_attr'
    WARNING: drivers/rtc/rtc-ds1742.o - Section mismatch: reference to
    .init.text:ds1742_rtc_probe from .data.rel between 'ds1742_rtc_driver' (at
    offset 0x0) and 'ds1742_nvram_attr'

    Signed-off-by: Prarit Bhargava
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Prarit Bhargava
     

08 Dec, 2006

1 commit

  • The real time clocks ds1742 and ds1743 differs only in the size of the
    nvram. This patch changes the existing ds1742 driver to support also
    ds1743. The main change is that the nvram size is determined from the
    resource attached to the device.

    The patch have benefitted from suggestions from Atsushi Nemeto, who is the
    author of the ds1742 driver.

    Signed-off-by: Torsten Rasmussen Rasmussen
    Acked-by: Alessandro Zummo
    Acked-by: Atsushi Nemoto
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Torsten Ertbjerg Rasmussen
     

01 Oct, 2006

2 commits


26 Jun, 2006

1 commit