| .. | .. |
|---|
| 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> |
|---|
| 22 | 8 | |
|---|
| 23 | 9 | #include <linux/err.h> |
|---|
| 24 | 10 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 209 | 195 | } |
|---|
| 210 | 196 | mutex_init(&max8998->iolock); |
|---|
| 211 | 197 | |
|---|
| 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)) { |
|---|
| 214 | 200 | dev_err(&i2c->dev, "Failed to allocate I2C device for RTC\n"); |
|---|
| 215 | | - return -ENODEV; |
|---|
| 201 | + return PTR_ERR(max8998->rtc); |
|---|
| 216 | 202 | } |
|---|
| 217 | 203 | i2c_set_clientdata(max8998->rtc, max8998); |
|---|
| 218 | 204 | |
|---|