summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/cy8ctma140.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/cy8ctma140.c')
-rw-r--r--drivers/input/touchscreen/cy8ctma140.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/input/touchscreen/cy8ctma140.c b/drivers/input/touchscreen/cy8ctma140.c
index a9be29139cbf..2d4b6e343203 100644
--- a/drivers/input/touchscreen/cy8ctma140.c
+++ b/drivers/input/touchscreen/cy8ctma140.c
@@ -16,7 +16,7 @@
* same.
*/
-#include <asm/unaligned.h>
+#include <linux/unaligned.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/input.h>
@@ -198,8 +198,7 @@ static void cy8ctma140_power_off_action(void *d)
cy8ctma140_power_down(ts);
}
-static int cy8ctma140_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+static int cy8ctma140_probe(struct i2c_client *client)
{
struct cy8ctma140 *ts;
struct input_dev *input;
@@ -259,12 +258,8 @@ static int cy8ctma140_probe(struct i2c_client *client,
ts->regulators[1].supply = "vdd";
error = devm_regulator_bulk_get(dev, ARRAY_SIZE(ts->regulators),
ts->regulators);
- if (error) {
- if (error != -EPROBE_DEFER)
- dev_err(dev, "Failed to get regulators %d\n",
- error);
- return error;
- }
+ if (error)
+ return dev_err_probe(dev, error, "Failed to get regulators\n");
error = cy8ctma140_power_up(ts);
if (error)
@@ -297,7 +292,7 @@ static int cy8ctma140_probe(struct i2c_client *client,
return 0;
}
-static int __maybe_unused cy8ctma140_suspend(struct device *dev)
+static int cy8ctma140_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct cy8ctma140 *ts = i2c_get_clientdata(client);
@@ -308,7 +303,7 @@ static int __maybe_unused cy8ctma140_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused cy8ctma140_resume(struct device *dev)
+static int cy8ctma140_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct cy8ctma140 *ts = i2c_get_clientdata(client);
@@ -323,10 +318,11 @@ static int __maybe_unused cy8ctma140_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(cy8ctma140_pm, cy8ctma140_suspend, cy8ctma140_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(cy8ctma140_pm,
+ cy8ctma140_suspend, cy8ctma140_resume);
static const struct i2c_device_id cy8ctma140_idtable[] = {
- { CY8CTMA140_NAME, 0 },
+ { CY8CTMA140_NAME },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(i2c, cy8ctma140_idtable);
@@ -340,7 +336,7 @@ MODULE_DEVICE_TABLE(of, cy8ctma140_of_match);
static struct i2c_driver cy8ctma140_driver = {
.driver = {
.name = CY8CTMA140_NAME,
- .pm = &cy8ctma140_pm,
+ .pm = pm_sleep_ptr(&cy8ctma140_pm),
.of_match_table = cy8ctma140_of_match,
},
.id_table = cy8ctma140_idtable,