hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/power/supply/rt5033_battery.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Fuel gauge driver for Richtek RT5033
34 *
45 * Copyright (C) 2014 Samsung Electronics, Co., Ltd.
56 * 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.
107 */
118
129 #include <linux/module.h>
....@@ -118,7 +115,7 @@
118115 static int rt5033_battery_probe(struct i2c_client *client,
119116 const struct i2c_device_id *id)
120117 {
121
- struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
118
+ struct i2c_adapter *adapter = client->adapter;
122119 struct power_supply_config psy_cfg = {};
123120 struct rt5033_battery *battery;
124121 u32 ret;
....@@ -128,7 +125,7 @@
128125
129126 battery = devm_kzalloc(&client->dev, sizeof(*battery), GFP_KERNEL);
130127 if (!battery)
131
- return -EINVAL;
128
+ return -ENOMEM;
132129
133130 battery->client = client;
134131 battery->regmap = devm_regmap_init_i2c(client,