Skip to contentSkip to conversation

i2c: exynos5: add CONFIG_PM_SLEEP to suspend/resume functions

PATCH Applied Jingoo Han 3 participants 5 messages Mar 11, 2014 – Mar 13, 2014 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/2 i2c: exynos5: add CONFIG_PM_SLEEP to suspend/resume functions

Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled.

warning: 'exynos5_i2c_suspend_noirq' defined but not used [-Wunused-function]
warning: 'exynos5_i2c_resume_noirq' defined but not used [-Wunused-function]

---
 drivers/i2c/busses/i2c-exynos5.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/i2c/busses/i2c-exynos5.c +2 -0
index 9fd711c..60601ef 100644
@@ -715,6 +715,7 @@ static int exynos5_i2c_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
 static int exynos5_i2c_suspend_noirq(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -745,6 +746,7 @@ static int exynos5_i2c_resume_noirq(struct device *dev)
 
 	return 0;
 }
+#endif
 
 static SIMPLE_DEV_PM_OPS(exynos5_i2c_dev_pm_ops, exynos5_i2c_suspend_noirq,
 			 exynos5_i2c_resume_noirq);
Signature · 1 line
1.7.10.4
author
#2 lore raw

PATCH 2/2 i2c: exynos5: remove unnecessary cast of void pointer

In reply to a message not in the archive

Remove unnecessary cast of void pointer, because 'algo_data' of 'struct i2c_adapter' is a void pointer. Casting the void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language.

---
 drivers/i2c/busses/i2c-exynos5.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-exynos5.c +1 -1
index 60601ef..00af0a0 100644
@@ -566,7 +566,7 @@ static int exynos5_i2c_xfer_msg(struct exynos5_i2c *i2c,
 static int exynos5_i2c_xfer(struct i2c_adapter *adap,
 			struct i2c_msg *msgs, int num)
 {
-	struct exynos5_i2c *i2c = (struct exynos5_i2c *)adap->algo_data;
+	struct exynos5_i2c *i2c = adap->algo_data;
 	int i = 0, ret = 0, stop = 0;
 
 	if (i2c->suspended) {
Signature · 1 line
1.7.10.4
Reviewed-by Naveen Krishna Chatradhi
#4 lore raw

Re: [PATCH 2/2] i2c: exynos5: remove unnecessary cast of void pointer

In reply to a message not in the archive

Hello Mr. Han,

Quoted 6 lines · Jingoo Han

Remove unnecessary cast of void pointer, because 'algo_data' of 'struct i2c_adapter' is a void pointer. Casting the void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language.

Quoted 18 lines
---
 drivers/i2c/busses/i2c-exynos5.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-exynos5.c +1 -2
index 60601ef..00af0a0 100644
@@ -566,7 +566,7 @@ static int exynos5_i2c_xfer_msg(struct exynos5_i2c *i2c,
 static int exynos5_i2c_xfer(struct i2c_adapter *adap,
                        struct i2c_msg *msgs, int num)
 {
-       struct exynos5_i2c *i2c = (struct exynos5_i2c *)adap->algo_data;
+       struct exynos5_i2c *i2c = adap->algo_data;
        int i = 0, ret = 0, stop = 0;
 
        if (i2c->suspended) {
--
Quoted 1 line

1.7.10.4

Thanks for the patch.

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Shine bright,
(: Nav :)
Applied
#6 lore raw
In reply to a message not in the archive
Quoted 9 lines · Jingoo Han

Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled.

warning: 'exynos5_i2c_suspend_noirq' defined but not used [-Wunused-function]
warning: 'exynos5_i2c_resume_noirq' defined but not used [-Wunused-function]

Applied to for-next, thanks!

Applied
#5 lore raw

Re: [PATCH 2/2] i2c: exynos5: remove unnecessary cast of void pointer

In reply to a message not in the archive
Quoted 6 lines · Jingoo Han

Remove unnecessary cast of void pointer, because 'algo_data' of 'struct i2c_adapter' is a void pointer. Casting the void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language.

Applied to for-next, thanks!