i2c: imx-lpi2c: Use __maybe_unused instead of #if CONFIG_PM_SLEEP
Use __maybe_unused for power management related functions instead of #if CONFIG_PM_SLEEP to simply the code. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Acked-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:

committed by
Wolfram Sang

parent
24beb83ad2
commit
c395f8dc1a
@@ -639,8 +639,7 @@ static int lpi2c_imx_remove(struct platform_device *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
static int __maybe_unused lpi2c_runtime_suspend(struct device *dev)
|
||||||
static int lpi2c_runtime_suspend(struct device *dev)
|
|
||||||
{
|
{
|
||||||
struct lpi2c_imx_struct *lpi2c_imx = dev_get_drvdata(dev);
|
struct lpi2c_imx_struct *lpi2c_imx = dev_get_drvdata(dev);
|
||||||
|
|
||||||
@@ -650,7 +649,7 @@ static int lpi2c_runtime_suspend(struct device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lpi2c_runtime_resume(struct device *dev)
|
static int __maybe_unused lpi2c_runtime_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct lpi2c_imx_struct *lpi2c_imx = dev_get_drvdata(dev);
|
struct lpi2c_imx_struct *lpi2c_imx = dev_get_drvdata(dev);
|
||||||
int ret;
|
int ret;
|
||||||
@@ -671,10 +670,6 @@ static const struct dev_pm_ops lpi2c_pm_ops = {
|
|||||||
SET_RUNTIME_PM_OPS(lpi2c_runtime_suspend,
|
SET_RUNTIME_PM_OPS(lpi2c_runtime_suspend,
|
||||||
lpi2c_runtime_resume, NULL)
|
lpi2c_runtime_resume, NULL)
|
||||||
};
|
};
|
||||||
#define IMX_LPI2C_PM (&lpi2c_pm_ops)
|
|
||||||
#else
|
|
||||||
#define IMX_LPI2C_PM NULL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static struct platform_driver lpi2c_imx_driver = {
|
static struct platform_driver lpi2c_imx_driver = {
|
||||||
.probe = lpi2c_imx_probe,
|
.probe = lpi2c_imx_probe,
|
||||||
@@ -682,7 +677,7 @@ static struct platform_driver lpi2c_imx_driver = {
|
|||||||
.driver = {
|
.driver = {
|
||||||
.name = DRIVER_NAME,
|
.name = DRIVER_NAME,
|
||||||
.of_match_table = lpi2c_imx_of_match,
|
.of_match_table = lpi2c_imx_of_match,
|
||||||
.pm = IMX_LPI2C_PM,
|
.pm = &lpi2c_pm_ops,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user