hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/mfd/max8907.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * max8907.c - mfd driver for MAX8907
34 *
45 * Copyright (C) 2010 Gyungoh Yoo <jack.yoo@maxim-ic.com>
56 * Copyright (C) 2010-2012, NVIDIA CORPORATION. All rights reserved.
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 */
118
129 #include <linux/err.h>
....@@ -217,9 +214,9 @@
217214 goto err_regmap_gen;
218215 }
219216
220
- max8907->i2c_rtc = i2c_new_dummy(i2c->adapter, MAX8907_RTC_I2C_ADDR);
221
- if (!max8907->i2c_rtc) {
222
- ret = -ENOMEM;
217
+ max8907->i2c_rtc = i2c_new_dummy_device(i2c->adapter, MAX8907_RTC_I2C_ADDR);
218
+ if (IS_ERR(max8907->i2c_rtc)) {
219
+ ret = PTR_ERR(max8907->i2c_rtc);
223220 goto err_dummy_rtc;
224221 }
225222 i2c_set_clientdata(max8907->i2c_rtc, max8907);