.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Fuel gauge driver for Richtek RT5033 |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2014 Samsung Electronics, Co., Ltd. |
---|
5 | 6 | * Author: Beomho Seo <beomho.seo@samsung.com> |
---|
6 | | - * |
---|
7 | | - * This program is free software; you can redistribute it and/or modify |
---|
8 | | - * it under the terms of the GNU General Public License version 2 as |
---|
9 | | - * published bythe Free Software Foundation. |
---|
10 | 7 | */ |
---|
11 | 8 | |
---|
12 | 9 | #include <linux/module.h> |
---|
.. | .. |
---|
118 | 115 | static int rt5033_battery_probe(struct i2c_client *client, |
---|
119 | 116 | const struct i2c_device_id *id) |
---|
120 | 117 | { |
---|
121 | | - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); |
---|
| 118 | + struct i2c_adapter *adapter = client->adapter; |
---|
122 | 119 | struct power_supply_config psy_cfg = {}; |
---|
123 | 120 | struct rt5033_battery *battery; |
---|
124 | 121 | u32 ret; |
---|
.. | .. |
---|
128 | 125 | |
---|
129 | 126 | battery = devm_kzalloc(&client->dev, sizeof(*battery), GFP_KERNEL); |
---|
130 | 127 | if (!battery) |
---|
131 | | - return -EINVAL; |
---|
| 128 | + return -ENOMEM; |
---|
132 | 129 | |
---|
133 | 130 | battery->client = client; |
---|
134 | 131 | battery->regmap = devm_regmap_init_i2c(client, |
---|