Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1397699

Re: [PATCHv5 8/8] mfd: as3722: Rid driver of superfluous I2C device ID structure

From Javier Martinez Canillas <javier@osg.samsung.com>
Newsgroups linux.kernel
Subject Re: [PATCHv5 8/8] mfd: as3722: Rid driver of superfluous I2C device ID structure
Date 2016-05-10 07:30 +0200
Message-ID <rx8p3-46L-1@gated-at.bofh.it> (permalink)
References <rv6KJ-6s5-7@gated-at.bofh.it> <rv6KL-6s5-51@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 05/04/2016 11:14 AM, Kieran Bingham wrote:
> From: Lee Jones <lee.jones@linaro.org>
> 
> Also remove unused second probe() parameter 'i2c_device_id'.
>
> Acked-by: Grant Likely <grant.likely@linaro.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Kieran Bingham <kieran@bingham.xyz>
> 
> ---
> Changes since v4
>  - Rename .probe2 to probe_new
> ---
>  drivers/mfd/as3722.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mfd/as3722.c b/drivers/mfd/as3722.c
> index e1f597f97f86..28fc62af6861 100644
> --- a/drivers/mfd/as3722.c
> +++ b/drivers/mfd/as3722.c
> @@ -354,8 +354,7 @@ static int as3722_i2c_of_probe(struct i2c_client *i2c,
>  	return 0;
>  }
>  
> -static int as3722_i2c_probe(struct i2c_client *i2c,
> -			const struct i2c_device_id *id)
> +static int as3722_i2c_probe(struct i2c_client *i2c)
>  {
>  	struct as3722 *as3722;
>  	unsigned long irq_flags;
> @@ -453,12 +452,6 @@ static const struct of_device_id as3722_of_match[] = {
>  };
>  MODULE_DEVICE_TABLE(of, as3722_of_match);
>  
> -static const struct i2c_device_id as3722_i2c_id[] = {
> -	{ "as3722", 0 },
> -	{},
> -};
> -MODULE_DEVICE_TABLE(i2c, as3722_i2c_id);
> -

Just a note that this can only be made because the driver's Kconfig symbol
is bool and not tristate. Since for drivers that can be built as a module,
the I2C core always reports a MODALIAS of the form "i2c:as3722" and so the
i2c_device_id array and the MODULE_DEVICE_TABLE() are needed even when not
used by the driver.

As mentioned the change is correct for this driver but I just wanted to
point out in case other authors try to do the same change for drivers that
can be built as a module and so breaking module auto-loading.

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv5 0/8] 2c: Relax mandatory I2C ID table passing Kieran Bingham <kieran@ksquared.org.uk> - 2016-05-04 17:20 +0200
  [PATCHv5 6/8] i2c: Provide a temporary .probe_new() call-back type Kieran Bingham <kieran@ksquared.org.uk> - 2016-05-04 17:20 +0200
  [PATCHv5 1/8] i2c: Add pointer dereference protection to i2c_match_id() Kieran Bingham <kieran@ksquared.org.uk> - 2016-05-04 17:20 +0200
    Re: [PATCHv5 1/8] i2c: Add pointer dereference protection to  i2c_match_id() Javier Martinez Canillas <javier@osg.samsung.com> - 2016-05-10 07:00 +0200
  [PATCHv5 3/8] i2c: Match using traditional OF methods, then by vendor-less compatible strings Kieran Bingham <kieran@ksquared.org.uk> - 2016-05-04 17:20 +0200
  [PATCHv5 7/8] mfd: 88pm860x: Move over to new I2C device .probe() call Kieran Bingham <kieran@ksquared.org.uk> - 2016-05-04 17:20 +0200
    Re: [PATCHv5 7/8] mfd: 88pm860x: Move over to new I2C device .probe()  call Javier Martinez Canillas <javier@osg.samsung.com> - 2016-05-10 07:10 +0200
  [PATCHv5 8/8] mfd: as3722: Rid driver of superfluous I2C device ID structure Kieran Bingham <kieran@ksquared.org.uk> - 2016-05-04 17:20 +0200
    Re: [PATCHv5 8/8] mfd: as3722: Rid driver of superfluous I2C device  ID structure Javier Martinez Canillas <javier@osg.samsung.com> - 2016-05-10 07:30 +0200
      Re: [PATCHv5 8/8] mfd: as3722: Rid driver of superfluous I2C device  ID structure Lee Jones <lee.jones@linaro.org> - 2016-05-10 09:40 +0200
        Re: [PATCHv5 8/8] mfd: as3722: Rid driver of superfluous I2C device  ID structure Javier Martinez Canillas <javier@osg.samsung.com> - 2016-05-10 15:30 +0200
          Re: [PATCHv5 8/8] mfd: as3722: Rid driver of superfluous I2C device  ID structure Lee Jones <lee.jones@linaro.org> - 2016-05-10 16:10 +0200
          [PATCH] cocci: Find i2c drivers with an of_device table that isn't exported Kieran Bingham <kieran@ksquared.org.uk> - 2016-05-10 16:40 +0200
          [PATCH] cocci: Provide script to find i2c_tables missing exports Kieran Bingham <kieran@ksquared.org.uk> - 2016-05-10 17:10 +0200
            Re: [PATCH] cocci: Provide script to find i2c_tables missing exports Javier Martinez Canillas <javier@osg.samsung.com> - 2016-05-11 22:10 +0200
  Re: [PATCHv5 0/8] 2c: Relax mandatory I2C ID table passing Lee Jones <lee.jones@linaro.org> - 2016-05-09 11:20 +0200
    Re: [PATCHv5 0/8] 2c: Relax mandatory I2C ID table passing Javier Martinez Canillas <javier@osg.samsung.com> - 2016-05-09 15:30 +0200
  Re: [PATCHv5 0/8] 2c: Relax mandatory I2C ID table passing Javier Martinez Canillas <javier@osg.samsung.com> - 2016-05-10 07:40 +0200
    Re: [PATCHv5 0/8] 2c: Relax mandatory I2C ID table passing Kieran Bingham <kieran@ksquared.org.uk> - 2016-05-10 09:50 +0200

csiph-web