Skip to content

Commit

Permalink
i2c: imx: Use __maybe_unused instead of #if CONFIG_PM
Browse files Browse the repository at this point in the history
Use __maybe_unused for runtime PM related functions instead
of #if CONFIG_PM to simply the code.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Anson Huang authored and Wolfram Sang committed May 27, 2019
1 parent cd6c84d commit a4b5363
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions drivers/i2c/busses/i2c-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1220,8 +1220,7 @@ static int i2c_imx_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM
static int i2c_imx_runtime_suspend(struct device *dev)
static int __maybe_unused i2c_imx_runtime_suspend(struct device *dev)
{
struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);

Expand All @@ -1230,7 +1229,7 @@ static int i2c_imx_runtime_suspend(struct device *dev)
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);
int ret;
Expand All @@ -1246,17 +1245,13 @@ static const struct dev_pm_ops i2c_imx_pm_ops = {
SET_RUNTIME_PM_OPS(i2c_imx_runtime_suspend,
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 = {
.probe = i2c_imx_probe,
.remove = i2c_imx_remove,
.driver = {
.name = DRIVER_NAME,
.pm = I2C_IMX_PM_OPS,
.pm = &i2c_imx_pm_ops,
.of_match_table = i2c_imx_dt_ids,
},
.id_table = imx_i2c_devtype,
Expand Down

0 comments on commit a4b5363

Please sign in to comment.