.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * TI Palmas MFD Driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright 2011-2012 Texas Instruments Inc. |
---|
5 | 6 | * |
---|
6 | 7 | * Author: Graeme Gregory <gg@slimlogic.co.uk> |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify it |
---|
9 | | - * under the terms of the GNU General Public License as published by the |
---|
10 | | - * Free Software Foundation; either version 2 of the License, or (at your |
---|
11 | | - * option) any later version. |
---|
12 | | - * |
---|
13 | 8 | */ |
---|
14 | 9 | |
---|
15 | 10 | #include <linux/module.h> |
---|
.. | .. |
---|
554 | 549 | palmas->i2c_clients[i] = i2c; |
---|
555 | 550 | else { |
---|
556 | 551 | palmas->i2c_clients[i] = |
---|
557 | | - i2c_new_dummy(i2c->adapter, |
---|
| 552 | + i2c_new_dummy_device(i2c->adapter, |
---|
558 | 553 | i2c->addr + i); |
---|
559 | | - if (!palmas->i2c_clients[i]) { |
---|
| 554 | + if (IS_ERR(palmas->i2c_clients[i])) { |
---|
560 | 555 | dev_err(palmas->dev, |
---|
561 | 556 | "can't attach client %d\n", i); |
---|
562 | | - ret = -ENOMEM; |
---|
| 557 | + ret = PTR_ERR(palmas->i2c_clients[i]); |
---|
563 | 558 | goto err_i2c; |
---|
564 | 559 | } |
---|
565 | 560 | palmas->i2c_clients[i]->dev.of_node = of_node_get(node); |
---|