Message ID | 1441595335-31672-1-git-send-email-21cnbao@gmail.com |
---|---|
State | Accepted |
Headers | show |
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
> @@ -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.
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 --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;
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(-)