hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/power/supply/max14656_charger_detector.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Maxim MAX14656 / AL32 USB Charger Detector driver
34 *
....@@ -7,11 +8,6 @@
78 * Components from Maxim AL32 Charger detection Driver for MX50 Yoshi Board
89 * Copyright (C) Amazon Technologies Inc. All rights reserved.
910 * 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
- *
1511 */
1612 #include <linux/module.h>
1713 #include <linux/init.h>
....@@ -143,10 +139,9 @@
143139
144140 u8 buf[REG_TOTAL_NUM];
145141 u8 chg_type;
146
- int ret = 0;
147142
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);
150145
151146 if ((buf[MAX14656_STATUS_1] & STATUS1_VB_VALID_MASK) &&
152147 (buf[MAX14656_STATUS_1] & STATUS1_CHG_TYPE_MASK)) {
....@@ -251,7 +246,7 @@
251246 static int max14656_probe(struct i2c_client *client,
252247 const struct i2c_device_id *id)
253248 {
254
- struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
249
+ struct i2c_adapter *adapter = client->adapter;
255250 struct device *dev = &client->dev;
256251 struct power_supply_config psy_cfg = {};
257252 struct max14656_chip *chip;