Thread (3 messages) 3 messages, 2 authors, 2021-01-19
STALE1981d

[PATCH 2/2] i2c: imx: Remove unneeded 'match' variable

From: Fabio Estevam <festevam@gmail.com>
Date: 2021-01-19 00:35:12
Subsystem: freescale imx i2c driver, i2c subsystem, i2c subsystem host drivers, the rest · Maintainers: Oleksij Rempel, Andi Shyti, Linus Torvalds

There is no need to have the intermediate 'match' variable.

Assign the device_get_match_data() directly to simplify the code.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/i2c/busses/i2c-imx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 5d0ce70411ad..6e5d26cf3f2f 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -1309,7 +1309,6 @@ static int i2c_imx_probe(struct platform_device *pdev)
 	void __iomem *base;
 	int irq, ret;
 	dma_addr_t phy_addr;
-	const struct imx_i2c_hwdata *match;
 
 	dev_dbg(&pdev->dev, "<%s>\n", __func__);
 
@@ -1327,8 +1326,7 @@ static int i2c_imx_probe(struct platform_device *pdev)
 	if (!i2c_imx)
 		return -ENOMEM;
 
-	match = device_get_match_data(&pdev->dev);
-	i2c_imx->hwdata = match;
+	i2c_imx->hwdata = device_get_match_data(&pdev->dev);
 
 	/* Setup i2c_imx driver structure */
 	strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name));
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help