hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/mfd/max77693.c
....@@ -1,27 +1,13 @@
1
-/*
2
- * max77693.c - mfd core driver for the MAX 77693
3
- *
4
- * Copyright (C) 2012 Samsung Electronics
5
- * SangYoung Son <hello.son@samsung.com>
6
- *
7
- * This program is not provided / owned by Maxim Integrated Products.
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
- *
23
- * This driver is based on max8997.c
24
- */
1
+// SPDX-License-Identifier: GPL-2.0+
2
+//
3
+// max77693.c - mfd core driver for the MAX 77693
4
+//
5
+// Copyright (C) 2012 Samsung Electronics
6
+// SangYoung Son <hello.son@samsung.com>
7
+//
8
+// This program is not provided / owned by Maxim Integrated Products.
9
+//
10
+// This driver is based on max8997.c
2511
2612 #include <linux/module.h>
2713 #include <linux/slab.h>
....@@ -197,17 +183,17 @@
197183 } else
198184 dev_info(max77693->dev, "device ID: 0x%x\n", reg_data);
199185
200
- max77693->i2c_muic = i2c_new_dummy(i2c->adapter, I2C_ADDR_MUIC);
201
- if (!max77693->i2c_muic) {
186
+ max77693->i2c_muic = i2c_new_dummy_device(i2c->adapter, I2C_ADDR_MUIC);
187
+ if (IS_ERR(max77693->i2c_muic)) {
202188 dev_err(max77693->dev, "Failed to allocate I2C device for MUIC\n");
203
- return -ENODEV;
189
+ return PTR_ERR(max77693->i2c_muic);
204190 }
205191 i2c_set_clientdata(max77693->i2c_muic, max77693);
206192
207
- max77693->i2c_haptic = i2c_new_dummy(i2c->adapter, I2C_ADDR_HAPTIC);
208
- if (!max77693->i2c_haptic) {
193
+ max77693->i2c_haptic = i2c_new_dummy_device(i2c->adapter, I2C_ADDR_HAPTIC);
194
+ if (IS_ERR(max77693->i2c_haptic)) {
209195 dev_err(max77693->dev, "Failed to allocate I2C device for Haptic\n");
210
- ret = -ENODEV;
196
+ ret = PTR_ERR(max77693->i2c_haptic);
211197 goto err_i2c_haptic;
212198 }
213199 i2c_set_clientdata(max77693->i2c_haptic, max77693);