.. | .. |
---|
1 | | -/* |
---|
2 | | - * max14577.c - mfd core driver for the Maxim 14577/77836 |
---|
3 | | - * |
---|
4 | | - * Copyright (C) 2014 Samsung Electronics |
---|
5 | | - * Chanwoo Choi <cw00.choi@samsung.com> |
---|
6 | | - * Krzysztof Kozlowski <krzk@kernel.org> |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify |
---|
9 | | - * it under the terms of the GNU General Public License as published by |
---|
10 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
11 | | - * (at your option) any later version. |
---|
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. |
---|
17 | | - * |
---|
18 | | - * This driver is based on max8997.c |
---|
19 | | - */ |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
---|
| 2 | +// |
---|
| 3 | +// max14577.c - mfd core driver for the Maxim 14577/77836 |
---|
| 4 | +// |
---|
| 5 | +// Copyright (C) 2014 Samsung Electronics |
---|
| 6 | +// Chanwoo Choi <cw00.choi@samsung.com> |
---|
| 7 | +// Krzysztof Kozlowski <krzk@kernel.org> |
---|
| 8 | +// |
---|
| 9 | +// This driver is based on max8997.c |
---|
20 | 10 | |
---|
21 | 11 | #include <linux/err.h> |
---|
22 | 12 | #include <linux/module.h> |
---|
.. | .. |
---|
71 | 61 | int maxim_charger_calc_reg_current(const struct maxim_charger_current *limits, |
---|
72 | 62 | unsigned int min_ua, unsigned int max_ua, u8 *dst) |
---|
73 | 63 | { |
---|
74 | | - unsigned int current_bits = 0xf; |
---|
| 64 | + unsigned int current_bits; |
---|
75 | 65 | |
---|
76 | 66 | if (min_ua > max_ua) |
---|
77 | 67 | return -EINVAL; |
---|
.. | .. |
---|
307 | 297 | int ret; |
---|
308 | 298 | u8 intsrc_mask; |
---|
309 | 299 | |
---|
310 | | - max14577->i2c_pmic = i2c_new_dummy(max14577->i2c->adapter, |
---|
| 300 | + max14577->i2c_pmic = i2c_new_dummy_device(max14577->i2c->adapter, |
---|
311 | 301 | I2C_ADDR_PMIC); |
---|
312 | | - if (!max14577->i2c_pmic) { |
---|
| 302 | + if (IS_ERR(max14577->i2c_pmic)) { |
---|
313 | 303 | dev_err(max14577->dev, "Failed to register PMIC I2C device\n"); |
---|
314 | | - return -ENODEV; |
---|
| 304 | + return PTR_ERR(max14577->i2c_pmic); |
---|
315 | 305 | } |
---|
316 | 306 | i2c_set_clientdata(max14577->i2c_pmic, max14577); |
---|
317 | 307 | |
---|