forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/iio/dac/max517.c
....@@ -1,21 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * max517.c - Support for Maxim MAX517, MAX518 and MAX519
34 *
45 * Copyright (C) 2010, 2011 Roland Stigge <stigge@antcom.de>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
196 */
207
218 #include <linux/module.h>
....@@ -113,15 +100,14 @@
113100 return ret;
114101 }
115102
116
-#ifdef CONFIG_PM_SLEEP
117
-static int max517_suspend(struct device *dev)
103
+static int __maybe_unused max517_suspend(struct device *dev)
118104 {
119105 u8 outbuf = COMMAND_PD;
120106
121107 return i2c_master_send(to_i2c_client(dev), &outbuf, 1);
122108 }
123109
124
-static int max517_resume(struct device *dev)
110
+static int __maybe_unused max517_resume(struct device *dev)
125111 {
126112 u8 outbuf = 0;
127113
....@@ -129,10 +115,6 @@
129115 }
130116
131117 static SIMPLE_DEV_PM_OPS(max517_pm_ops, max517_suspend, max517_resume);
132
-#define MAX517_PM_OPS (&max517_pm_ops)
133
-#else
134
-#define MAX517_PM_OPS NULL
135
-#endif
136118
137119 static const struct iio_info max517_info = {
138120 .read_raw = max517_read_raw,
....@@ -173,9 +155,6 @@
173155 data = iio_priv(indio_dev);
174156 i2c_set_clientdata(client, indio_dev);
175157 data->client = client;
176
-
177
- /* establish that the iio_dev is a child of the i2c device */
178
- indio_dev->dev.parent = &client->dev;
179158
180159 switch (id->driver_data) {
181160 case ID_MAX521:
....@@ -229,7 +208,7 @@
229208 static struct i2c_driver max517_driver = {
230209 .driver = {
231210 .name = MAX517_DRV_NAME,
232
- .pm = MAX517_PM_OPS,
211
+ .pm = &max517_pm_ops,
233212 },
234213 .probe = max517_probe,
235214 .remove = max517_remove,