.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Maxim MAX14656 / AL32 USB Charger Detector driver |
---|
3 | 4 | * |
---|
.. | .. |
---|
7 | 8 | * Components from Maxim AL32 Charger detection Driver for MX50 Yoshi Board |
---|
8 | 9 | * Copyright (C) Amazon Technologies Inc. All rights reserved. |
---|
9 | 10 | * Manish Lachwani (lachwani@lab126.com) |
---|
10 | | - * |
---|
11 | | - * This package is free software; you can redistribute it and/or modify |
---|
12 | | - * it under the terms of the GNU General Public License version 2 and |
---|
13 | | - * only version 2 as published by the Free Software Foundation. |
---|
14 | | - * |
---|
15 | 11 | */ |
---|
16 | 12 | #include <linux/module.h> |
---|
17 | 13 | #include <linux/init.h> |
---|
.. | .. |
---|
143 | 139 | |
---|
144 | 140 | u8 buf[REG_TOTAL_NUM]; |
---|
145 | 141 | u8 chg_type; |
---|
146 | | - int ret = 0; |
---|
147 | 142 | |
---|
148 | | - ret = max14656_read_block_reg(chip->client, MAX14656_DEVICE_ID, |
---|
149 | | - REG_TOTAL_NUM, buf); |
---|
| 143 | + max14656_read_block_reg(chip->client, MAX14656_DEVICE_ID, |
---|
| 144 | + REG_TOTAL_NUM, buf); |
---|
150 | 145 | |
---|
151 | 146 | if ((buf[MAX14656_STATUS_1] & STATUS1_VB_VALID_MASK) && |
---|
152 | 147 | (buf[MAX14656_STATUS_1] & STATUS1_CHG_TYPE_MASK)) { |
---|
.. | .. |
---|
251 | 246 | static int max14656_probe(struct i2c_client *client, |
---|
252 | 247 | const struct i2c_device_id *id) |
---|
253 | 248 | { |
---|
254 | | - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); |
---|
| 249 | + struct i2c_adapter *adapter = client->adapter; |
---|
255 | 250 | struct device *dev = &client->dev; |
---|
256 | 251 | struct power_supply_config psy_cfg = {}; |
---|
257 | 252 | struct max14656_chip *chip; |
---|