forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/iio/dac/max5821.c
....@@ -1,10 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * iio/dac/max5821.c
34 * Copyright (C) 2014 Philippe Reynes
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License version 2 as
7
- * published by the Free Software Foundation.
85 */
96
107 #include <linux/kernel.h>
....@@ -270,8 +267,7 @@
270267 }
271268 }
272269
273
-#ifdef CONFIG_PM_SLEEP
274
-static int max5821_suspend(struct device *dev)
270
+static int __maybe_unused max5821_suspend(struct device *dev)
275271 {
276272 u8 outbuf[2] = { MAX5821_EXTENDED_COMMAND_MODE,
277273 MAX5821_EXTENDED_DAC_A |
....@@ -281,7 +277,7 @@
281277 return i2c_master_send(to_i2c_client(dev), outbuf, 2);
282278 }
283279
284
-static int max5821_resume(struct device *dev)
280
+static int __maybe_unused max5821_resume(struct device *dev)
285281 {
286282 u8 outbuf[2] = { MAX5821_EXTENDED_COMMAND_MODE,
287283 MAX5821_EXTENDED_DAC_A |
....@@ -292,10 +288,6 @@
292288 }
293289
294290 static SIMPLE_DEV_PM_OPS(max5821_pm_ops, max5821_suspend, max5821_resume);
295
-#define MAX5821_PM_OPS (&max5821_pm_ops)
296
-#else
297
-#define MAX5821_PM_OPS NULL
298
-#endif /* CONFIG_PM_SLEEP */
299291
300292 static const struct iio_info max5821_info = {
301293 .read_raw = max5821_read_raw,
....@@ -349,7 +341,6 @@
349341 data->vref_mv = ret / 1000;
350342
351343 indio_dev->name = id->name;
352
- indio_dev->dev.parent = &client->dev;
353344 indio_dev->num_channels = ARRAY_SIZE(max5821_channels);
354345 indio_dev->channels = max5821_channels;
355346 indio_dev->modes = INDIO_DIRECT_MODE;
....@@ -392,7 +383,7 @@
392383 .driver = {
393384 .name = "max5821",
394385 .of_match_table = max5821_of_match,
395
- .pm = MAX5821_PM_OPS,
386
+ .pm = &max5821_pm_ops,
396387 },
397388 .probe = max5821_probe,
398389 .remove = max5821_remove,