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

  • Many drivers are defining a DRV_VERSION. This is often only used for
    MODULE_VERSION and sometimes to print an info message at probe time. This
    is kind of pointless as they are all versionned with the kernel anyway.
    Also the core will print a message when a new rtc is found.

    Signed-off-by: Alexandre Belloni

    Alexandre Belloni
     

12 Jan, 2016

1 commit


05 Sep, 2015

2 commits

  • drivers/rtc/rtc-gemini.c:151:1-3: WARNING: PTR_ERR_OR_ZERO can be used

    Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

    Generated by: scripts/coccinelle/api/ptr_ret.cocci

    Signed-off-by: Fengguang Wu
    Signed-off-by: Viresh Kumar
    Signed-off-by: Alexandre Belloni

    kbuild test robot
     
  • IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
    is no need to do that again from its callers. Drop it.

    gemini driver was using likely() for a failure case while the rtc driver
    is getting registered. That looks wrong and it should really be
    unlikely. But because we are killing all the unlikely() flags, lets kill
    that too.

    Signed-off-by: Viresh Kumar
    Acked-by: Hans Ulli Kroll
    Signed-off-by: Alexandre Belloni

    viresh kumar
     

25 Jun, 2015

2 commits

  • Use resource_size function on resource object instead of explicit
    computation.

    No need to set .owner here. The core will do it.
    Remove .owner field if calls are used which set it automatically

    Signed-off-by: Fengguang Wu
    Acked-by: Hans Ulli Kroll
    Signed-off-by: Alexandre Belloni

    kbuild test robot
     
  • Driver for the on chip RTC found on Cortina's SoC Gemini.

    Signed-off-by: Hans Ulli Kroll
    [alexandre.belloni@free-electrons.com: use devm_request_irq() and remove
    useless goto]
    Signed-off-by: Alexandre Belloni

    Hans Ulli Kroll