Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d1ac94e authored by Mark Brown's avatar Mark Brown Committed by Dmitry Torokhov
Browse files

Input: adxl34x-spi - convert to dev_pm_ops



There is a general move to convert drivers to use dev_pm_ops rather than
bus specific ones in order to facilitate core development. Do this
conversion for adxl34x-spi.

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent fbb89935
Loading
Loading
Loading
Loading
+9 −7
Original line number Original line Diff line number Diff line
@@ -10,6 +10,7 @@
#include <linux/input.h>	/* BUS_SPI */
#include <linux/input.h>	/* BUS_SPI */
#include <linux/module.h>
#include <linux/module.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi.h>
#include <linux/pm.h>
#include <linux/types.h>
#include <linux/types.h>
#include "adxl34x.h"
#include "adxl34x.h"


@@ -94,8 +95,9 @@ static int __devexit adxl34x_spi_remove(struct spi_device *spi)
}
}


#ifdef CONFIG_PM
#ifdef CONFIG_PM
static int adxl34x_spi_suspend(struct spi_device *spi, pm_message_t message)
static int adxl34x_spi_suspend(struct device *dev)
{
{
	struct spi_device *spi = to_spi_device(dev);
	struct adxl34x *ac = dev_get_drvdata(&spi->dev);
	struct adxl34x *ac = dev_get_drvdata(&spi->dev);


	adxl34x_suspend(ac);
	adxl34x_suspend(ac);
@@ -103,29 +105,29 @@ static int adxl34x_spi_suspend(struct spi_device *spi, pm_message_t message)
	return 0;
	return 0;
}
}


static int adxl34x_spi_resume(struct spi_device *spi)
static int adxl34x_spi_resume(struct device *dev)
{
{
	struct spi_device *spi = to_spi_device(dev);
	struct adxl34x *ac = dev_get_drvdata(&spi->dev);
	struct adxl34x *ac = dev_get_drvdata(&spi->dev);


	adxl34x_resume(ac);
	adxl34x_resume(ac);


	return 0;
	return 0;
}
}
#else
# define adxl34x_spi_suspend NULL
# define adxl34x_spi_resume  NULL
#endif
#endif


static SIMPLE_DEV_PM_OPS(adxl34x_spi_pm, adxl34x_spi_suspend,
			 adxl34x_spi_resume);

static struct spi_driver adxl34x_driver = {
static struct spi_driver adxl34x_driver = {
	.driver = {
	.driver = {
		.name = "adxl34x",
		.name = "adxl34x",
		.bus = &spi_bus_type,
		.bus = &spi_bus_type,
		.owner = THIS_MODULE,
		.owner = THIS_MODULE,
		.pm = &adxl34x_spi_pm,
	},
	},
	.probe   = adxl34x_spi_probe,
	.probe   = adxl34x_spi_probe,
	.remove  = __devexit_p(adxl34x_spi_remove),
	.remove  = __devexit_p(adxl34x_spi_remove),
	.suspend = adxl34x_spi_suspend,
	.resume  = adxl34x_spi_resume,
};
};


static int __init adxl34x_spi_init(void)
static int __init adxl34x_spi_init(void)