hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/mfd/ssbi.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
23 * Copyright (c) 2010, Google Inc.
34 *
....@@ -5,15 +6,6 @@
56 *
67 * Author: Dima Zavin <dima@android.com>
78 * - Largely rewritten from original to not be an i2c driver.
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 version 2 and
11
- * only version 2 as published by the Free Software Foundation.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
179 */
1810
1911 #define pr_fmt(fmt) "%s: " fmt, __func__
....@@ -79,8 +71,6 @@
7971 int (*read)(struct ssbi *, u16 addr, u8 *buf, int len);
8072 int (*write)(struct ssbi *, u16 addr, const u8 *buf, int len);
8173 };
82
-
83
-#define to_ssbi(dev) platform_get_drvdata(to_platform_device(dev))
8474
8575 static inline u32 ssbi_readl(struct ssbi *ssbi, u32 reg)
8676 {
....@@ -243,7 +233,7 @@
243233
244234 int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len)
245235 {
246
- struct ssbi *ssbi = to_ssbi(dev);
236
+ struct ssbi *ssbi = dev_get_drvdata(dev);
247237 unsigned long flags;
248238 int ret;
249239
....@@ -257,7 +247,7 @@
257247
258248 int ssbi_write(struct device *dev, u16 addr, const u8 *buf, int len)
259249 {
260
- struct ssbi *ssbi = to_ssbi(dev);
250
+ struct ssbi *ssbi = dev_get_drvdata(dev);
261251 unsigned long flags;
262252 int ret;
263253