hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/mfd/max14577.c
....@@ -1,22 +1,12 @@
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
2010
2111 #include <linux/err.h>
2212 #include <linux/module.h>
....@@ -71,7 +61,7 @@
7161 int maxim_charger_calc_reg_current(const struct maxim_charger_current *limits,
7262 unsigned int min_ua, unsigned int max_ua, u8 *dst)
7363 {
74
- unsigned int current_bits = 0xf;
64
+ unsigned int current_bits;
7565
7666 if (min_ua > max_ua)
7767 return -EINVAL;
....@@ -307,11 +297,11 @@
307297 int ret;
308298 u8 intsrc_mask;
309299
310
- max14577->i2c_pmic = i2c_new_dummy(max14577->i2c->adapter,
300
+ max14577->i2c_pmic = i2c_new_dummy_device(max14577->i2c->adapter,
311301 I2C_ADDR_PMIC);
312
- if (!max14577->i2c_pmic) {
302
+ if (IS_ERR(max14577->i2c_pmic)) {
313303 dev_err(max14577->dev, "Failed to register PMIC I2C device\n");
314
- return -ENODEV;
304
+ return PTR_ERR(max14577->i2c_pmic);
315305 }
316306 i2c_set_clientdata(max14577->i2c_pmic, max14577);
317307