Skip to content

Commit

Permalink
Merge patch series "Use the standard _PM_OPS() export macro in Intel …
Browse files Browse the repository at this point in the history
…Tangier GPIO driver"

Raag Jadav <raag.jadav@intel.com> says:

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.

Link: https://lore.kernel.org/r/20231113131600.10828-1-raag.jadav@intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  • Loading branch information
Andy Shevchenko committed Nov 13, 2023
2 parents b85ea95 + c4a79ae commit fb77e8a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
14 changes: 1 addition & 13 deletions drivers/gpio/gpio-elkhartlake.c
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
{ }
Expand All @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions drivers/gpio/gpio-tangier.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -477,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;
Expand All @@ -502,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;
Expand All @@ -529,7 +529,8 @@ 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);

MODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>");
MODULE_AUTHOR("Pandith N <pandith.n@intel.com>");
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpio/gpio-tangier.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -111,7 +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_ */

0 comments on commit fb77e8a

Please sign in to comment.