hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/mfd/max77843.c
....@@ -1,15 +1,10 @@
1
-/*
2
- * MFD core driver for the Maxim MAX77843
3
- *
4
- * Copyright (C) 2015 Samsung Electronics
5
- * Author: Jaewon Kim <jaewon02.kim@samsung.com>
6
- * Author: Beomho Seo <beomho.seo@samsung.com>
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
- */
1
+// SPDX-License-Identifier: GPL-2.0+
2
+//
3
+// MFD core driver for the Maxim MAX77843
4
+//
5
+// Copyright (C) 2015 Samsung Electronics
6
+// Author: Jaewon Kim <jaewon02.kim@samsung.com>
7
+// Author: Beomho Seo <beomho.seo@samsung.com>
138
149 #include <linux/err.h>
1510 #include <linux/i2c.h>
....@@ -75,11 +70,11 @@
7570 {
7671 int ret;
7772
78
- max77843->i2c_chg = i2c_new_dummy(max77843->i2c->adapter, I2C_ADDR_CHG);
79
- if (!max77843->i2c_chg) {
73
+ max77843->i2c_chg = i2c_new_dummy_device(max77843->i2c->adapter, I2C_ADDR_CHG);
74
+ if (IS_ERR(max77843->i2c_chg)) {
8075 dev_err(&max77843->i2c->dev,
8176 "Cannot allocate I2C device for Charger\n");
82
- return -ENODEV;
77
+ return PTR_ERR(max77843->i2c_chg);
8378 }
8479 i2c_set_clientdata(max77843->i2c_chg, max77843);
8580