| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Driver for the TAOS evaluation modules |
|---|
| 3 | 4 | * These devices include an I2C master which can be controlled over the |
|---|
| 4 | 5 | * serial port. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Copyright (C) 2007 Jean Delvare <jdelvare@suse.de> |
|---|
| 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; version 2 of the License. |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 13 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | | - * GNU General Public License for more details. |
|---|
| 16 | 8 | */ |
|---|
| 17 | 9 | |
|---|
| 18 | 10 | #include <linux/delay.h> |
|---|
| .. | .. |
|---|
| 47 | 39 | }; |
|---|
| 48 | 40 | |
|---|
| 49 | 41 | /* TAOS TSL2550 EVM */ |
|---|
| 50 | | -static struct i2c_board_info tsl2550_info = { |
|---|
| 42 | +static const struct i2c_board_info tsl2550_info = { |
|---|
| 51 | 43 | I2C_BOARD_INFO("tsl2550", 0x39), |
|---|
| 52 | 44 | }; |
|---|
| 53 | 45 | |
|---|
| .. | .. |
|---|
| 57 | 49 | if (!strncmp(adapter->name, "TAOS TSL2550 EVM", 16)) { |
|---|
| 58 | 50 | dev_info(&adapter->dev, "Instantiating device %s at 0x%02x\n", |
|---|
| 59 | 51 | tsl2550_info.type, tsl2550_info.addr); |
|---|
| 60 | | - return i2c_new_device(adapter, &tsl2550_info); |
|---|
| 52 | + return i2c_new_client_device(adapter, &tsl2550_info); |
|---|
| 61 | 53 | } |
|---|
| 62 | 54 | |
|---|
| 63 | | - return NULL; |
|---|
| 55 | + return ERR_PTR(-ENODEV); |
|---|
| 64 | 56 | } |
|---|
| 65 | 57 | |
|---|
| 66 | 58 | static int taos_smbus_xfer(struct i2c_adapter *adapter, u16 addr, |
|---|
| .. | .. |
|---|
| 133 | 125 | /* |
|---|
| 134 | 126 | * Voluntarily dropping error code of kstrtou8 since all |
|---|
| 135 | 127 | * error code that it could return are invalid according |
|---|
| 136 | | - * to Documentation/i2c/fault-codes. |
|---|
| 128 | + * to Documentation/i2c/fault-codes.rst. |
|---|
| 137 | 129 | */ |
|---|
| 138 | 130 | if (kstrtou8(p + 1, 16, &data->byte)) |
|---|
| 139 | 131 | return -EPROTO; |
|---|