hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/include/linux/mfd/twl.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * twl4030.h - header for TWL4030 PM and audio CODEC device
34 *
....@@ -5,21 +6,6 @@
56 *
67 * Based on tlv320aic23.c:
78 * Copyright (c) by Kai Svahn <kai.svahn@nokia.com>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with this program; if not, write to the Free Software
21
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
- *
239 */
2410
2511 #ifndef __TWL_H_
....@@ -195,14 +181,18 @@
195181 }
196182
197183 static inline int twl_i2c_write_u16(u8 mod_no, u16 val, u8 reg) {
198
- val = cpu_to_le16(val);
199
- return twl_i2c_write(mod_no, (u8*) &val, reg, 2);
184
+ __le16 value;
185
+
186
+ value = cpu_to_le16(val);
187
+ return twl_i2c_write(mod_no, (u8 *) &value, reg, 2);
200188 }
201189
202190 static inline int twl_i2c_read_u16(u8 mod_no, u16 *val, u8 reg) {
203191 int ret;
204
- ret = twl_i2c_read(mod_no, (u8*) val, reg, 2);
205
- *val = le16_to_cpu(*val);
192
+ __le16 value;
193
+
194
+ ret = twl_i2c_read(mod_no, (u8 *) &value, reg, 2);
195
+ *val = le16_to_cpu(value);
206196 return ret;
207197 }
208198