• Stephen Kitt's avatar
    rtc: use simple i2c probe · 3f4a3322
    Stephen Kitt authored
    All these drivers have an i2c probe function which doesn't use the
    "struct i2c_device_id *id" parameter, so they can trivially be
    converted to the "probe_new" style of probe with a single argument.
    
    This change was done using the following Coccinelle script, and fixed
    up for whitespace changes:
    
    @ rule1 @
    identifier fn;
    identifier client, id;
    @@
    
    - static int fn(struct i2c_client *client, const struct i2c_device_id *id)
    + static int fn(struct i2c_client *client)
    {
    ...when != id
    }
    
    @ rule2 depends on rule1 @
    identifier rule1.fn;
    identifier driver;
    @@
    
    struct i2c_driver driver = {
    -	.probe
    +	.probe_new
    		=
    (
    		   fn
    |
    -		   &fn
    +		   fn
    )
    		,
    };
    Signed-off-by: default avatarStephen Kitt <steve@sk2.org>
    Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
    Link: https://lore.kernel.org/r/20220610162346.4134094-1-steve@sk2.org
    3f4a3322
rtc-pcf8583.c 6.42 KB