Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: nomadik: Convert to modern pm_ops

Use the SIMPLE_DEV_PM_OPS macro and convert to the modern pm ops.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Ulf Hansson and committed by
Linus Walleij
c003eed7 131d85bc

+9 -8
+9 -8
drivers/pinctrl/pinctrl-nomadik.c
··· 2036 2036 }; 2037 2037 2038 2038 #ifdef CONFIG_PM_SLEEP 2039 - static int nmk_pinctrl_suspend(struct platform_device *pdev, pm_message_t state) 2039 + static int nmk_pinctrl_suspend(struct device *dev) 2040 2040 { 2041 2041 struct nmk_pinctrl *npct; 2042 2042 2043 - npct = platform_get_drvdata(pdev); 2043 + npct = dev_get_drvdata(dev); 2044 2044 if (!npct) 2045 2045 return -EINVAL; 2046 2046 2047 2047 return pinctrl_force_sleep(npct->pctl); 2048 2048 } 2049 2049 2050 - static int nmk_pinctrl_resume(struct platform_device *pdev) 2050 + static int nmk_pinctrl_resume(struct device *dev) 2051 2051 { 2052 2052 struct nmk_pinctrl *npct; 2053 2053 2054 - npct = platform_get_drvdata(pdev); 2054 + npct = dev_get_drvdata(dev); 2055 2055 if (!npct) 2056 2056 return -EINVAL; 2057 2057 ··· 2146 2146 .probe = nmk_gpio_probe, 2147 2147 }; 2148 2148 2149 + static SIMPLE_DEV_PM_OPS(nmk_pinctrl_pm_ops, 2150 + nmk_pinctrl_suspend, 2151 + nmk_pinctrl_resume); 2152 + 2149 2153 static struct platform_driver nmk_pinctrl_driver = { 2150 2154 .driver = { 2151 2155 .owner = THIS_MODULE, 2152 2156 .name = "pinctrl-nomadik", 2153 2157 .of_match_table = nmk_pinctrl_match, 2158 + .pm = &nmk_pinctrl_pm_ops, 2154 2159 }, 2155 2160 .probe = nmk_pinctrl_probe, 2156 - #ifdef CONFIG_PM_SLEEP 2157 - .suspend = nmk_pinctrl_suspend, 2158 - .resume = nmk_pinctrl_resume, 2159 - #endif 2160 2161 }; 2161 2162 2162 2163 static int __init nmk_gpio_init(void)