| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * max8907.c - mfd driver for MAX8907 |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2010 Gyungoh Yoo <jack.yoo@maxim-ic.com> |
|---|
| 5 | 6 | * 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. |
|---|
| 10 | 7 | */ |
|---|
| 11 | 8 | |
|---|
| 12 | 9 | #include <linux/err.h> |
|---|
| .. | .. |
|---|
| 217 | 214 | goto err_regmap_gen; |
|---|
| 218 | 215 | } |
|---|
| 219 | 216 | |
|---|
| 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); |
|---|
| 223 | 220 | goto err_dummy_rtc; |
|---|
| 224 | 221 | } |
|---|
| 225 | 222 | i2c_set_clientdata(max8907->i2c_rtc, max8907); |
|---|