.. | .. |
---|
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 |
---|
25 | 11 | |
---|
26 | 12 | #include <linux/module.h> |
---|
27 | 13 | #include <linux/slab.h> |
---|
.. | .. |
---|
197 | 183 | } else |
---|
198 | 184 | dev_info(max77693->dev, "device ID: 0x%x\n", reg_data); |
---|
199 | 185 | |
---|
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)) { |
---|
202 | 188 | dev_err(max77693->dev, "Failed to allocate I2C device for MUIC\n"); |
---|
203 | | - return -ENODEV; |
---|
| 189 | + return PTR_ERR(max77693->i2c_muic); |
---|
204 | 190 | } |
---|
205 | 191 | i2c_set_clientdata(max77693->i2c_muic, max77693); |
---|
206 | 192 | |
---|
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)) { |
---|
209 | 195 | dev_err(max77693->dev, "Failed to allocate I2C device for Haptic\n"); |
---|
210 | | - ret = -ENODEV; |
---|
| 196 | + ret = PTR_ERR(max77693->i2c_haptic); |
---|
211 | 197 | goto err_i2c_haptic; |
---|
212 | 198 | } |
---|
213 | 199 | i2c_set_clientdata(max77693->i2c_haptic, max77693); |
---|