Skip to content

Commit a4b5363

Browse files
Anson-HuangWolfram Sang
authored andcommitted
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: Anson Huang <[email protected]> Reviewed-by: Dong Aisheng <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent cd6c84d commit a4b5363

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/i2c/busses/i2c-imx.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,8 +1220,7 @@ static int i2c_imx_remove(struct platform_device *pdev)
12201220
return 0;
12211221
}
12221222

1223-
#ifdef CONFIG_PM
1224-
static int i2c_imx_runtime_suspend(struct device *dev)
1223+
static int __maybe_unused i2c_imx_runtime_suspend(struct device *dev)
12251224
{
12261225
struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
12271226

@@ -1230,7 +1229,7 @@ static int i2c_imx_runtime_suspend(struct device *dev)
12301229
return 0;
12311230
}
12321231

1233-
static int i2c_imx_runtime_resume(struct device *dev)
1232+
static int __maybe_unused i2c_imx_runtime_resume(struct device *dev)
12341233
{
12351234
struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
12361235
int ret;
@@ -1246,17 +1245,13 @@ static const struct dev_pm_ops i2c_imx_pm_ops = {
12461245
SET_RUNTIME_PM_OPS(i2c_imx_runtime_suspend,
12471246
i2c_imx_runtime_resume, NULL)
12481247
};
1249-
#define I2C_IMX_PM_OPS (&i2c_imx_pm_ops)
1250-
#else
1251-
#define I2C_IMX_PM_OPS NULL
1252-
#endif /* CONFIG_PM */
12531248

12541249
static struct platform_driver i2c_imx_driver = {
12551250
.probe = i2c_imx_probe,
12561251
.remove = i2c_imx_remove,
12571252
.driver = {
12581253
.name = DRIVER_NAME,
1259-
.pm = I2C_IMX_PM_OPS,
1254+
.pm = &i2c_imx_pm_ops,
12601255
.of_match_table = i2c_imx_dt_ids,
12611256
},
12621257
.id_table = imx_i2c_devtype,

0 commit comments

Comments
 (0)