Commit a4b5363a authored by Anson Huang's avatar Anson Huang Committed by Wolfram Sang

i2c: imx: Use __maybe_unused instead of #if CONFIG_PM

Use __maybe_unused for runtime PM related functions instead
of #if CONFIG_PM to simply the code.
Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
Reviewed-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent cd6c84d8
...@@ -1220,8 +1220,7 @@ static int i2c_imx_remove(struct platform_device *pdev) ...@@ -1220,8 +1220,7 @@ static int i2c_imx_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM static int __maybe_unused i2c_imx_runtime_suspend(struct device *dev)
static int i2c_imx_runtime_suspend(struct device *dev)
{ {
struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev); struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
...@@ -1230,7 +1229,7 @@ static int i2c_imx_runtime_suspend(struct device *dev) ...@@ -1230,7 +1229,7 @@ static int i2c_imx_runtime_suspend(struct device *dev)
return 0; return 0;
} }
static int i2c_imx_runtime_resume(struct device *dev) static int __maybe_unused i2c_imx_runtime_resume(struct device *dev)
{ {
struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev); struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
int ret; int ret;
...@@ -1246,17 +1245,13 @@ static const struct dev_pm_ops i2c_imx_pm_ops = { ...@@ -1246,17 +1245,13 @@ static const struct dev_pm_ops i2c_imx_pm_ops = {
SET_RUNTIME_PM_OPS(i2c_imx_runtime_suspend, SET_RUNTIME_PM_OPS(i2c_imx_runtime_suspend,
i2c_imx_runtime_resume, NULL) i2c_imx_runtime_resume, NULL)
}; };
#define I2C_IMX_PM_OPS (&i2c_imx_pm_ops)
#else
#define I2C_IMX_PM_OPS NULL
#endif /* CONFIG_PM */
static struct platform_driver i2c_imx_driver = { static struct platform_driver i2c_imx_driver = {
.probe = i2c_imx_probe, .probe = i2c_imx_probe,
.remove = i2c_imx_remove, .remove = i2c_imx_remove,
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.pm = I2C_IMX_PM_OPS, .pm = &i2c_imx_pm_ops,
.of_match_table = i2c_imx_dt_ids, .of_match_table = i2c_imx_dt_ids,
}, },
.id_table = imx_i2c_devtype, .id_table = imx_i2c_devtype,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment