diff mbox series

[2/2] i2c: i2c-rcar: fix -Wvoid-pointer-to-enum-cast warning

Message ID 20230809-cbl-1903-v1-2-df9d66a3ba3e@google.com (mailing list archive)
State New, archived
Headers show
Series i2c: fix -Wvoid-pointer-to-enum-cast warnings | expand

Commit Message

Justin Stitt Aug. 9, 2023, 9:25 p.m. UTC
Fix the following warning:

|  drivers/i2c/busses/i2c-rcar.c:1066:18: error: cast to smaller integer type \
|       'enum rcar_i2c_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
|   1066 |         priv->devtype = (enum rcar_i2c_type)of_device_get_match_data(dev);
|        |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Link: https://github.com/ClangBuiltLinux/linux/issues/1904
Signed-off-by: Justin Stitt <justinstitt@google.com>
---
 drivers/i2c/busses/i2c-rcar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 2d9c37410ebd..ae4072bc96dc 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -1063,7 +1063,7 @@  static int rcar_i2c_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->io))
 		return PTR_ERR(priv->io);
 
-	priv->devtype = (enum rcar_i2c_type)of_device_get_match_data(dev);
+	priv->devtype = (unsigned long) of_device_get_match_data(dev);
 	init_waitqueue_head(&priv->wait);
 
 	adap = &priv->adap;