extcon: Use to_i2c_client for both rt8973a and sm5502
authorGeliang Tang <geliangtang@163.com>
Mon, 28 Dec 2015 15:00:15 +0000 (23:00 +0800)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 25 Jan 2016 04:16:53 +0000 (13:16 +0900)
Use to_i2c_client() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon-rt8973a.c
drivers/extcon/extcon-sm5502.c

index e1bb82809bef53ad2a853de2442a7ecc2e4a7597..7635a8eaf4c61b276749963b8e974d5afd2a5646 100644 (file)
@@ -663,7 +663,7 @@ MODULE_DEVICE_TABLE(of, rt8973a_dt_match);
 #ifdef CONFIG_PM_SLEEP
 static int rt8973a_muic_suspend(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct rt8973a_muic_info *info = i2c_get_clientdata(i2c);
 
        enable_irq_wake(info->irq);
@@ -673,7 +673,7 @@ static int rt8973a_muic_suspend(struct device *dev)
 
 static int rt8973a_muic_resume(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct rt8973a_muic_info *info = i2c_get_clientdata(i2c);
 
        disable_irq_wake(info->irq);
index 7aac3cc7efd79ff121850252c9f24ec434ee37d3..571de2e6e7c4a3c9ee632ffaf8700f66d9223736 100644 (file)
@@ -655,7 +655,7 @@ MODULE_DEVICE_TABLE(of, sm5502_dt_match);
 #ifdef CONFIG_PM_SLEEP
 static int sm5502_muic_suspend(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct sm5502_muic_info *info = i2c_get_clientdata(i2c);
 
        enable_irq_wake(info->irq);
@@ -665,7 +665,7 @@ static int sm5502_muic_suspend(struct device *dev)
 
 static int sm5502_muic_resume(struct device *dev)
 {
-       struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+       struct i2c_client *i2c = to_i2c_client(dev);
        struct sm5502_muic_info *info = i2c_get_clientdata(i2c);
 
        disable_irq_wake(info->irq);