Skip to content

Commit df92d5f

Browse files
Jingoo Hancooloney
authored andcommitted
leds: leds-asic3: switch to using SIMPLE_DEV_PM_OPS
Switch to using SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. It reduces code size. Also, CONFIG_PM_SLEEP is added to suspend/ resume functions to prevent build warnings when CONFIG_PM_SLEEP is not selected. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
1 parent cceba0e commit df92d5f

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎drivers/leds/leds-asic3.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ static int asic3_led_remove(struct platform_device *pdev)
134134
return mfd_cell_disable(pdev);
135135
}
136136

137+
#ifdef CONFIG_PM_SLEEP
137138
static int asic3_led_suspend(struct device *dev)
138139
{
139140
struct platform_device *pdev = to_platform_device(dev);
@@ -159,11 +160,9 @@ static int asic3_led_resume(struct device *dev)
159160

160161
return ret;
161162
}
163+
#endif
162164

163-
static const struct dev_pm_ops asic3_led_pm_ops = {
164-
.suspend = asic3_led_suspend,
165-
.resume = asic3_led_resume,
166-
};
165+
static SIMPLE_DEV_PM_OPS(asic3_led_pm_ops, asic3_led_suspend, asic3_led_resume);
167166

168167
static struct platform_driver asic3_led_driver = {
169168
.probe = asic3_led_probe,

0 commit comments

Comments
 (0)