06 Aug, 2010

1 commit

  • of_device is just an alias for platform_device, so remove it entirely. Also
    replace to_of_device() with to_platform_device() and update comment blocks.

    This patch was initially generated from the following semantic patch, and then
    edited by hand to pick up the bits that coccinelle didn't catch.

    @@
    @@
    -struct of_device
    +struct platform_device

    Signed-off-by: Grant Likely
    Reviewed-by: David S. Miller

    Grant Likely
     

22 May, 2010

2 commits

  • Merging in current state of Linus' tree to deal with merge conflicts and
    build failures in vio.c after merge.

    Conflicts:
    drivers/i2c/busses/i2c-cpm.c
    drivers/i2c/busses/i2c-mpc.c
    drivers/net/gianfar.c

    Also fixed up one line in arch/powerpc/kernel/vio.c to use the
    correct node pointer.

    Signed-off-by: Grant Likely

    Grant Likely
     
  • .name, .match_table and .owner are duplicated in both of_platform_driver
    and device_driver. This patch is a removes the extra copies from struct
    of_platform_driver and converts all users to the device_driver members.

    This patch is a pretty mechanical change. The usage model doesn't change
    and if any drivers have been missed, or if anything has been fixed up
    incorrectly, then it will fail with a compile time error, and the fixup
    will be trivial. This patch looks big and scary because it touches so
    many files, but it should be pretty safe.

    Signed-off-by: Grant Likely
    Acked-by: Sean MacLennan

    Grant Likely
     

19 May, 2010

1 commit


25 Feb, 2010

1 commit

  • The match_table field of the struct of_device_id is constant in
    so it is worth to make xps2_of_match also constant.

    The semantic match that finds this kind of pattern is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r@
    disable decl_init,const_decl_init;
    identifier I1, I2, x;
    @@
    struct I1 {
    ...
    const struct I2 *x;
    ...
    };
    @s@
    identifier r.I1, y;
    identifier r.x, E;
    @@
    struct I1 y = {
    .x = E,
    };
    @c@
    identifier r.I2;
    identifier s.E;
    @@
    const struct I2 E[] = ... ;
    @depends on !c@
    identifier r.I2;
    identifier s.E;
    @@
    + const
    struct I2 E[] = ...;
    //

    Signed-off-by: Márton Németh
    Cc: Julia Lawall
    Cc: cocci@diku.dk
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Márton Németh
     

28 Jan, 2009

1 commit


02 Dec, 2008

1 commit

  • pci_get_device increments a reference count that should be decremented
    using pci_dev_put.

    The semantic patch that finds the problem is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @r exists@
    local idexpression x;
    statement S,S1;
    position p1,p2,p3;
    expression E,E1;
    type T,T1;
    expression *ptr != NULL;
    @@

    (
    if ((x@p1 = pci_get_device(...)) == NULL) S
    |
    x@p1 = pci_get_device(...);
    )
    ... when != pci_dev_put(...,(T)x,...)
    when != if (...) { }
    when != true x == NULL || ...
    when != x = E
    when != E = (T)x
    when any
    (
    if (x == NULL || ...) S1
    |
    if@p2 (...) {
    ... when != pci_dev_put(...,(T1)x,...)
    when != if (...) { }
    when != x = E1
    when != E1 = (T1)x
    (
    return \(0\|\|ptr\);
    |
    return@p3 ...;
    )
    }
    )

    @ script:python @
    p1 << r.p1;
    p3 << r.p3;
    @@

    print "* file: %s pci_get_device: %s return: %s" % (p1[0].file,p1[0].line,p3[0].line)
    //

    Signed-off-by: Julia Lawall
    Acked-by: Olof Johansson
    Signed-off-by: David Woodhouse

    Julia Lawall
     

29 Nov, 2007

1 commit