Skip to contentSkip to conversation

i2c: tegra: drop duplicated code for assigning algo

PATCH In review Barry Song 3 participants 4 messages Sep 7, 2015 – Oct 23, 2015

Subsystems (3)
lore
Share & tools
lore

Barry Song

author
#0 lore raw

PATCH 1/1 i2c: tegra: drop duplicated code for assigning algo

This code is repeated in probe:
i2c_dev->adapter.algo = &tegra_i2c_algo;

Cc Donglin Peng <pengdonglin137-9Onoh4P/[email protected]>
---
 drivers/i2c/busses/i2c-tegra.c | 1 -
 1 file changed, 1 deletion(-)
drivers/i2c/busses/i2c-tegra.c +0 -1
index 78a3668..9ab720b 100644
@@ -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;
Signature · 1 line
1.9.1
#1 lore raw

ping...

2015-09-07 11:08 GMT+08:00 Barry Song <[email protected]>:

Quoted 24 lines

This code is repeated in probe:
i2c_dev->adapter.algo = &tegra_i2c_algo;

---
 drivers/i2c/busses/i2c-tegra.c | 1 -
 1 file changed, 1 deletion(-)
drivers/i2c/busses/i2c-tegra.c +0 -2
index 78a3668..9ab720b 100644
@@ -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

#2 lore raw
In reply to Barry Song

drivers/i2c/busses/i2c-tegra.c static int tegra_i2c_probe(struct platform_device *pdev) · line 830

Quoted 8 lines
drivers/i2c/busses/i2c-tegra.c +0 -1
@@ -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.

#3 lore raw
Quoted 4 lines · Wolfram Sang
Quoted 4 lines
drivers/i2c/busses/i2c-tegra.c +0 -0
@@ -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));
Quoted 8 lines

drivers/i2c/busses/i2c-tegra.c static int tegra_i2c_probe(struct platform_device *pdev) · line 830

Quoted 4 lines
drivers/i2c/busses/i2c-tegra.c +0 -1
-	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 ;)