hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/mfd/max8998.c
....@@ -1,24 +1,10 @@
1
-/*
2
- * max8998.c - mfd core driver for the Maxim 8998
3
- *
4
- * Copyright (C) 2009-2010 Samsung Electronics
5
- * Kyungmin Park <kyungmin.park@samsung.com>
6
- * Marek Szyprowski <m.szyprowski@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
- *
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
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, write to the Free Software
20
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
- */
1
+// SPDX-License-Identifier: GPL-2.0+
2
+//
3
+// max8998.c - mfd core driver for the Maxim 8998
4
+//
5
+// Copyright (C) 2009-2010 Samsung Electronics
6
+// Kyungmin Park <kyungmin.park@samsung.com>
7
+// Marek Szyprowski <m.szyprowski@samsung.com>
228
239 #include <linux/err.h>
2410 #include <linux/init.h>
....@@ -209,10 +195,10 @@
209195 }
210196 mutex_init(&max8998->iolock);
211197
212
- max8998->rtc = i2c_new_dummy(i2c->adapter, RTC_I2C_ADDR);
213
- if (!max8998->rtc) {
198
+ max8998->rtc = i2c_new_dummy_device(i2c->adapter, RTC_I2C_ADDR);
199
+ if (IS_ERR(max8998->rtc)) {
214200 dev_err(&i2c->dev, "Failed to allocate I2C device for RTC\n");
215
- return -ENODEV;
201
+ return PTR_ERR(max8998->rtc);
216202 }
217203 i2c_set_clientdata(max8998->rtc, max8998);
218204