Use the standard _PM_OPS() export macro in Intel Tangier GPIO driver
cover Use the standard _PM_OPS() export macro in Intel Tangier GPIO driver
This series exports pm_ops structure from Intel Tangier GPIO driver using EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS() helper and reuses it into its users.
Raag Jadav (3):
gpio: tangier: use EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS() helper
gpio: elkhartlake: reuse pm_ops from Intel Tangier driver
gpio: tangier: unexport suspend/resume handles
drivers/gpio/gpio-elkhartlake.c | 14 +------------- drivers/gpio/gpio-tangier.c | 9 +++++---- drivers/gpio/gpio-tangier.h | 4 ++-- 3 files changed, 8 insertions(+), 19 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/3 gpio: tangier: use EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS() helper
Use EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS() helper to export pm_ops to GPIO_TANGIER namespace, so that they can be reused.
--- drivers/gpio/gpio-tangier.c | 3 +++ drivers/gpio/gpio-tangier.h | 3 +++ 2 files changed, 6 insertions(+)
drivers/gpio/gpio-tangier.c +3 -0
@@ -19,6 +19,7 @@#include <linux/math.h> #include <linux/module.h> #include <linux/pinctrl/pinconf-generic.h> +#include <linux/pm.h> #include <linux/spinlock.h> #include <linux/string_helpers.h> #include <linux/types.h>
@@ -531,6 +532,8 @@ int tng_gpio_resume(struct device *dev) }EXPORT_SYMBOL_NS_GPL (tng_gpio_resume,GPIO_TANGIER ); +EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS (tng_gpio_pm_ops, tng_gpio_suspend, tng_gpio_resume,GPIO_TANGIER ); +MODULE_AUTHOR ("Andy Shevchenko <[email protected]>" );MODULE_AUTHOR ("Pandith N <[email protected]>" );MODULE_AUTHOR ("Raag Jadav <[email protected]>" );
drivers/gpio/gpio-tangier.h +3 -0
@@ -13,6 +13,7 @@#define _GPIO_TANGIER_H_#include <linux/gpio/driver.h> +#include <linux/pm.h> #include <linux/spinlock_types.h> #include <linux/types.h>
@@ -114,4 +115,6 @@ int devm_tng_gpio_probe(struct device *dev, struct tng_gpio *gpio);int tng_gpio_suspend (struct device *dev);int tng_gpio_resume (struct device *dev); +extern const struct dev_pm_ops tng_gpio_pm_ops; +#endif /* _GPIO_TANGIER_H_ */
Signature · 1 line
2.17.1
PATCH 2/3 gpio: elkhartlake: reuse pm_ops from Intel Tangier driver
In reply to Raag JadavReuse tng_gpio_pm_ops from Intel Tangier driver instead of calling them through a local copy.
--- drivers/gpio/gpio-elkhartlake.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/gpio/gpio-elkhartlake.c +1 -13
@@ -55,18 +55,6 @@ static int ehl_gpio_probe(struct platform_device *pdev)return 0 ; } -static int ehl_gpio_suspend (struct device *dev) -{ -return tng_gpio_suspend (dev); -} - -static int ehl_gpio_resume (struct device *dev) -{ -return tng_gpio_resume (dev); -} - -static DEFINE_SIMPLE_DEV_PM_OPS(ehl_gpio_pm_ops, ehl_gpio_suspend, ehl_gpio_resume); -static const struct platform_device_id ehl_gpio_ids[] = { {"gpio-elkhartlake" }, { }
@@ -76,7 +64,7 @@ MODULE_DEVICE_TABLE(platform, ehl_gpio_ids);static struct platform_driver ehl_gpio_driver = { .driver = { .name ="gpio-elkhartlake" , - .pm =pm_sleep_ptr (&ehl_gpio_pm_ops), + .pm =pm_sleep_ptr (&tng_gpio_pm_ops), }, .probe = ehl_gpio_probe, .id_table = ehl_gpio_ids,
Signature · 1 line
2.17.1
PATCH 3/3 gpio: tangier: unexport suspend/resume handles
In reply to Raag JadavUnexport suspend/resume handles for the lack of external users and while at it, make them static, so that they can be discarded by the compiler if not used (CONFIG_PM_SLEEP=n).
--- drivers/gpio/gpio-tangier.c | 6 ++---- drivers/gpio/gpio-tangier.h | 3 --- 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/gpio/gpio-tangier.c +2 -4
@@ -478,7 +478,7 @@ int devm_tng_gpio_probe(struct device *dev, struct tng_gpio *gpio) }EXPORT_SYMBOL_NS_GPL (devm_tng_gpio_probe,GPIO_TANGIER ); -int tng_gpio_suspend (struct device *dev) +static int tng_gpio_suspend (struct device *dev) {struct tng_gpio *priv =dev_get_drvdata (dev);struct tng_gpio_context *ctx = priv->ctx;
@@ -503,9 +503,8 @@ int tng_gpio_suspend(struct device *dev)return 0 ; } -EXPORT_SYMBOL_NS_GPL (tng_gpio_suspend,GPIO_TANGIER ); -int tng_gpio_resume (struct device *dev) +static int tng_gpio_resume (struct device *dev) {struct tng_gpio *priv =dev_get_drvdata (dev);struct tng_gpio_context *ctx = priv->ctx;
@@ -530,7 +529,6 @@ int tng_gpio_resume(struct device *dev)return 0 ; } -EXPORT_SYMBOL_NS_GPL (tng_gpio_resume,GPIO_TANGIER );EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS (tng_gpio_pm_ops, tng_gpio_suspend, tng_gpio_resume,GPIO_TANGIER );
drivers/gpio/gpio-tangier.h +0 -3
@@ -112,9 +112,6 @@ struct tng_gpio {int devm_tng_gpio_probe (struct device *dev,struct tng_gpio *gpio); -int tng_gpio_suspend (struct device *dev); -int tng_gpio_resume (struct device *dev); -extern const struct dev_pm_ops tng_gpio_pm_ops;#endif /* _GPIO_TANGIER_H_ */
Signature · 1 line
2.17.1
Quoted 2 lines · Raag Jadav
This series exports
pm_opsstructure from Intel Tangier GPIO driver usingEXPORT_NS_GPL_SIMPLE_DEV_PM_OPS()helper and reuses it into its users.
Yet you missed --base...
Pushed to my review and testing queue, thanks!
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 5 lines · Andy Shevchenko
Quoted 2 lines · Raag Jadav
This series exports
pm_opsstructure from Intel Tangier GPIO driver usingEXPORT_NS_GPL_SIMPLE_DEV_PM_OPS()helper and reuses it into its users.Yet you missed --base...
My understanding is that we use --base only for the patches with explicit in-tree dependency, which this series doesn't have any AFAIK.
Will start using it for every patch if it makes everyone happy :)
Raag
Quoted 11 lines · Raag Jadav
Quoted 5 lines · Andy Shevchenko
Quoted 2 lines · Raag Jadav
This series exports
pm_opsstructure from Intel Tangier GPIO driver usingEXPORT_NS_GPL_SIMPLE_DEV_PM_OPS()helper and reuses it into its users.Yet you missed --base...
My understanding is that we use --base only for the patches with explicit in-tree dependency, which this series doesn't have any AFAIK.
Will start using it for every patch if it makes everyone happy :)
For single patches it's not so critical, only for the series as I'm using b4 to treat them as PRs, so cover letter goes to the merge commit and b4 tries to guess the base (often wrongly).
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 8 lines · Andy Shevchenko
Quoted 7 lines · Raag Jadav
Quoted 5 lines · Andy Shevchenko
Quoted 2 lines · Raag Jadav
This series exports
pm_opsstructure from Intel Tangier GPIO driver usingEXPORT_NS_GPL_SIMPLE_DEV_PM_OPS()helper and reuses it into its users.Yet you missed --base...
Quoted 8 lines
Quoted 4 lines
My understanding is that we use --base only for the patches with explicit in-tree dependency, which this series doesn't have any AFAIK.
Will start using it for every patch if it makes everyone happy :)
For single patches it's not so critical, only for the series as I'm using b4 to treat them as PRs, so cover letter goes to the merge commit and b4 tries to guess the base (often wrongly).
Understood, will take care from now on.
Raag
Quoted 8 lines · Raag Jadav
This series exports
pm_opsstructure from Intel Tangier GPIO driver usingEXPORT_NS_GPL_SIMPLE_DEV_PM_OPS()helper and reuses it into its users.Raag Jadav (3):
gpio: tangier: useEXPORT_NS_GPL_SIMPLE_DEV_PM_OPS()helper
gpio: elkhartlake: reusepm_opsfrom Intel Tangier driver
gpio: tangier: unexport suspend/resume handles
Quoted 4 lines
drivers/gpio/gpio-elkhartlake.c | 14 +------------- drivers/gpio/gpio-tangier.c | 9 +++++---- drivers/gpio/gpio-tangier.h | 4 ++-- 3 files changed, 8 insertions(+), 19 deletions(-)