.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2013 Samsung Electronics Co., Ltd. |
---|
3 | 4 | * Author: Beomho Seo <beomho.seo@samsung.com> |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify it |
---|
6 | | - * under the terms of the GNU General Public License version 2, as published |
---|
7 | | - * by the Free Software Foundation. |
---|
8 | 5 | */ |
---|
9 | 6 | |
---|
10 | 7 | #include <linux/delay.h> |
---|
.. | .. |
---|
535 | 532 | int state) |
---|
536 | 533 | { |
---|
537 | 534 | struct cm36651_data *cm36651 = iio_priv(indio_dev); |
---|
538 | | - int cmd, ret = -EINVAL; |
---|
| 535 | + int cmd, ret; |
---|
539 | 536 | |
---|
540 | 537 | mutex_lock(&cm36651->lock); |
---|
541 | 538 | |
---|
.. | .. |
---|
649 | 646 | i2c_set_clientdata(client, indio_dev); |
---|
650 | 647 | |
---|
651 | 648 | cm36651->client = client; |
---|
652 | | - cm36651->ps_client = i2c_new_dummy(client->adapter, |
---|
| 649 | + cm36651->ps_client = i2c_new_dummy_device(client->adapter, |
---|
653 | 650 | CM36651_I2C_ADDR_PS); |
---|
654 | | - if (!cm36651->ps_client) { |
---|
| 651 | + if (IS_ERR(cm36651->ps_client)) { |
---|
655 | 652 | dev_err(&client->dev, "%s: new i2c device failed\n", __func__); |
---|
656 | | - ret = -ENODEV; |
---|
| 653 | + ret = PTR_ERR(cm36651->ps_client); |
---|
657 | 654 | goto error_disable_reg; |
---|
658 | 655 | } |
---|
659 | 656 | |
---|
660 | | - cm36651->ara_client = i2c_new_dummy(client->adapter, CM36651_ARA); |
---|
661 | | - if (!cm36651->ara_client) { |
---|
| 657 | + cm36651->ara_client = i2c_new_dummy_device(client->adapter, CM36651_ARA); |
---|
| 658 | + if (IS_ERR(cm36651->ara_client)) { |
---|
662 | 659 | dev_err(&client->dev, "%s: new i2c device failed\n", __func__); |
---|
663 | | - ret = -ENODEV; |
---|
| 660 | + ret = PTR_ERR(cm36651->ara_client); |
---|
664 | 661 | goto error_i2c_unregister_ps; |
---|
665 | 662 | } |
---|
666 | 663 | |
---|
667 | 664 | mutex_init(&cm36651->lock); |
---|
668 | | - indio_dev->dev.parent = &client->dev; |
---|
669 | 665 | indio_dev->channels = cm36651_channels; |
---|
670 | 666 | indio_dev->num_channels = ARRAY_SIZE(cm36651_channels); |
---|
671 | 667 | indio_dev->info = &cm36651_info; |
---|