diff mbox

[2/6] i2c: tegra: Remove non device-tree support

Message ID 1470910620-9898-3-git-send-email-jonathanh@nvidia.com
State Changes Requested
Headers show

Commit Message

Jon Hunter Aug. 11, 2016, 10:16 a.m. UTC
Tegra has only supported device-tree for platform/board configuration
for quite some time now and so simplify the Tegra I2C driver by dropping
code for non device-tree platforms/boards.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/i2c/busses/i2c-tegra.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Comments

Laxman Dewangan Aug. 11, 2016, 2:59 p.m. UTC | #1
On Thursday 11 August 2016 03:46 PM, Jon Hunter wrote:
> Tegra has only supported device-tree for platform/board configuration
> for quite some time now and so simplify the Tegra I2C driver by dropping
> code for non device-tree platforms/boards.
>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
--
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 Aug. 25, 2016, 7:33 p.m. UTC | #2
On Thu, Aug 11, 2016 at 11:16:56AM +0100, Jon Hunter wrote:
> Tegra has only supported device-tree for platform/board configuration
> for quite some time now and so simplify the Tegra I2C driver by dropping
> code for non device-tree platforms/boards.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>

cppcheck rightfully says:

drivers/i2c/busses/i2c-tegra.c:854: style: Variable 'i2c_dev.hw' is reassigned a value before the old one has been used.

Dropping the patches...
Jon Hunter Aug. 25, 2016, 8:49 p.m. UTC | #3
On 25/08/16 20:33, Wolfram Sang wrote:
> * PGP Signed by an unknown key
> 
> On Thu, Aug 11, 2016 at 11:16:56AM +0100, Jon Hunter wrote:
>> Tegra has only supported device-tree for platform/board configuration
>> for quite some time now and so simplify the Tegra I2C driver by dropping
>> code for non device-tree platforms/boards.
>>
>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> 
> cppcheck rightfully says:
> 
> drivers/i2c/busses/i2c-tegra.c:854: style: Variable 'i2c_dev.hw' is reassigned a value before the old one has been used.
> 
> Dropping the patches...

Yes good catch. I will fix that.

Cheers
Jon
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 93b09396a10f..412b914fa84b 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -851,13 +851,9 @@  static int tegra_i2c_probe(struct platform_device *pdev)
 
 	i2c_dev->hw = &tegra20_i2c_hw;
 
-	if (pdev->dev.of_node) {
-		i2c_dev->hw = of_device_get_match_data(&pdev->dev);
-		i2c_dev->is_dvc = of_device_is_compatible(pdev->dev.of_node,
-						"nvidia,tegra20-i2c-dvc");
-	} else if (pdev->id == 3) {
-		i2c_dev->is_dvc = 1;
-	}
+	i2c_dev->hw = of_device_get_match_data(&pdev->dev);
+	i2c_dev->is_dvc = of_device_is_compatible(pdev->dev.of_node,
+						  "nvidia,tegra20-i2c-dvc");
 	init_completion(&i2c_dev->msg_complete);
 
 	if (!i2c_dev->hw->has_single_clk_source) {