Commit bb48aa5f authored by Paul Cercueil's avatar Paul Cercueil Committed by Andi Shyti
Browse files

i2c: brcmstb: Remove #ifdef guards for PM related functions



Use the new PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.

Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/20230722115046.27323-4-paul@crapouillou.net


Signed-off-by: default avatarAndi Shyti <andi.shyti@kernel.org>
parent 9dc96b75
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -697,7 +697,6 @@ static void brcmstb_i2c_remove(struct platform_device *pdev)
	i2c_del_adapter(&dev->adapter);
}

#ifdef CONFIG_PM_SLEEP
static int brcmstb_i2c_suspend(struct device *dev)
{
	struct brcmstb_i2c_dev *i2c_dev = dev_get_drvdata(dev);
@@ -715,9 +714,8 @@ static int brcmstb_i2c_resume(struct device *dev)

	return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(brcmstb_i2c_pm, brcmstb_i2c_suspend,
static DEFINE_SIMPLE_DEV_PM_OPS(brcmstb_i2c_pm, brcmstb_i2c_suspend,
				brcmstb_i2c_resume);

static const struct of_device_id brcmstb_i2c_of_match[] = {
@@ -732,7 +730,7 @@ static struct platform_driver brcmstb_i2c_driver = {
	.driver = {
		   .name = "brcmstb-i2c",
		   .of_match_table = brcmstb_i2c_of_match,
		   .pm = &brcmstb_i2c_pm,
		   .pm = pm_sleep_ptr(&brcmstb_i2c_pm),
		   },
	.probe = brcmstb_i2c_probe,
	.remove_new = brcmstb_i2c_remove,