diff mbox

i2c: tegra: drop duplicated code for assigning algo

Message ID 1441595335-31672-1-git-send-email-21cnbao@gmail.com
State Accepted
Headers show

Commit Message

Barry Song Sept. 7, 2015, 3:08 a.m. UTC
This code is repeated in probe:
i2c_dev->adapter.algo = &tegra_i2c_algo;

Cc: Donglin Peng <pengdonglin137@163.com>
Signed-off-by: Barry Song <21cnbao@gmail.com>
---
 drivers/i2c/busses/i2c-tegra.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Barry Song Sept. 21, 2015, 3:20 a.m. UTC | #1
ping...

2015-09-07 11:08 GMT+08:00 Barry Song <21cnbao@gmail.com>:
> This code is repeated in probe:
> i2c_dev->adapter.algo = &tegra_i2c_algo;
>
> Cc: Donglin Peng <pengdonglin137@163.com>
> Signed-off-by: Barry Song <21cnbao@gmail.com>
> ---
>  drivers/i2c/busses/i2c-tegra.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
> index 78a3668..9ab720b 100644
> --- a/drivers/i2c/busses/i2c-tegra.c
> +++ b/drivers/i2c/busses/i2c-tegra.c
> @@ -825,7 +825,6 @@ static int tegra_i2c_probe(struct platform_device *pdev)
>         i2c_dev->adapter.class = I2C_CLASS_DEPRECATED;
>         strlcpy(i2c_dev->adapter.name, "Tegra I2C adapter",
>                 sizeof(i2c_dev->adapter.name));
> -       i2c_dev->adapter.algo = &tegra_i2c_algo;
>         i2c_dev->adapter.dev.parent = &pdev->dev;
>         i2c_dev->adapter.nr = pdev->id;
>         i2c_dev->adapter.dev.of_node = pdev->dev.of_node;
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wolfram Sang Oct. 20, 2015, 3:40 p.m. UTC | #2
> @@ -825,7 +825,6 @@ static int tegra_i2c_probe(struct platform_device *pdev)
>  	i2c_dev->adapter.class = I2C_CLASS_DEPRECATED;
>  	strlcpy(i2c_dev->adapter.name, "Tegra I2C adapter",
>  		sizeof(i2c_dev->adapter.name));
> -	i2c_dev->adapter.algo = &tegra_i2c_algo;
>  	i2c_dev->adapter.dev.parent = &pdev->dev;
>  	i2c_dev->adapter.nr = pdev->id;
>  	i2c_dev->adapter.dev.of_node = pdev->dev.of_node;

I think it would be more consistent to keep this one and move the quirk
assignment also down here; then all adapter assignments are in one
place.
Wolfram Sang Oct. 23, 2015, 8:51 p.m. UTC | #3
On Tue, Oct 20, 2015 at 05:40:46PM +0200, Wolfram Sang wrote:
> > @@ -825,7 +825,6 @@ static int tegra_i2c_probe(struct platform_device *pdev)
> >  	i2c_dev->adapter.class = I2C_CLASS_DEPRECATED;
> >  	strlcpy(i2c_dev->adapter.name, "Tegra I2C adapter",
> >  		sizeof(i2c_dev->adapter.name));
> > -	i2c_dev->adapter.algo = &tegra_i2c_algo;
> >  	i2c_dev->adapter.dev.parent = &pdev->dev;
> >  	i2c_dev->adapter.nr = pdev->id;
> >  	i2c_dev->adapter.dev.of_node = pdev->dev.of_node;
> 
> I think it would be more consistent to keep this one and move the quirk
> assignment also down here; then all adapter assignments are in one
> place.

Lucky you, I accidently pushed this out in my for-next ;)
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 78a3668..9ab720b 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -825,7 +825,6 @@  static int tegra_i2c_probe(struct platform_device *pdev)
 	i2c_dev->adapter.class = I2C_CLASS_DEPRECATED;
 	strlcpy(i2c_dev->adapter.name, "Tegra I2C adapter",
 		sizeof(i2c_dev->adapter.name));
-	i2c_dev->adapter.algo = &tegra_i2c_algo;
 	i2c_dev->adapter.dev.parent = &pdev->dev;
 	i2c_dev->adapter.nr = pdev->id;
 	i2c_dev->adapter.dev.of_node = pdev->dev.of_node;