| .. | .. |
|---|
| 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> |
|---|
| 13 | 8 | |
|---|
| 14 | 9 | #include <linux/err.h> |
|---|
| 15 | 10 | #include <linux/i2c.h> |
|---|
| .. | .. |
|---|
| 75 | 70 | { |
|---|
| 76 | 71 | int ret; |
|---|
| 77 | 72 | |
|---|
| 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)) { |
|---|
| 80 | 75 | dev_err(&max77843->i2c->dev, |
|---|
| 81 | 76 | "Cannot allocate I2C device for Charger\n"); |
|---|
| 82 | | - return -ENODEV; |
|---|
| 77 | + return PTR_ERR(max77843->i2c_chg); |
|---|
| 83 | 78 | } |
|---|
| 84 | 79 | i2c_set_clientdata(max77843->i2c_chg, max77843); |
|---|
| 85 | 80 | |
|---|