summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJianing Li <m13940358460@163.com>2026-07-31 16:42:59 +0800
committerSebastian Reichel <sebastian.reichel@collabora.com>2026-07-31 23:35:34 +0200
commit4e4b9f5ce9dfb8ed4b8d1262a504b8043ac09d87 (patch)
tree1512ed31db1d25b510ddabd8993842bde7327b53
parentc57cb36f76eb7ced45f57af1a890d8f3a6d76342 (diff)
downloadlinux-next-4e4b9f5ce9dfb8ed4b8d1262a504b8043ac09d87.tar.gz
linux-next-4e4b9f5ce9dfb8ed4b8d1262a504b8043ac09d87.zip
power: supply: max17040: drop incorrect I2C functionality check
max17040_probe() rejects adapters that do not advertise I2C_FUNC_SMBUS_BYTE. The driver does not issue SMBus byte transactions, however. Its regmap has 8-bit registers and 16-bit big-endian values, for which regmap-i2c supports either raw I2C transfers or SMBus word-data transactions. Consequently, an adapter providing raw I2C transfers or SMBus word data but not SMBus byte transactions is rejected even though regmap can access the device. Conversely, the current check can pass an adapter that regmap cannot use. Drop the stale check and let devm_regmap_init_i2c() validate and select the supported transfer method. Fixes: 6455a8a84bdfd ("power: supply: max17040: Use regmap i2c") Cc: stable@vger.kernel.org Signed-off-by: Jianing Li <m13940358460@163.com> Link: https://patch.msgid.link/20260731084259.916-1-m13940358460@163.com [Fixed Fixes tag, so that it points to the regmap introduction instead of the initial driver addition] Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-rw-r--r--drivers/power/supply/max17040_battery.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/power/supply/max17040_battery.c b/drivers/power/supply/max17040_battery.c
index 98d34d5f3c80..b641d7387311 100644
--- a/drivers/power/supply/max17040_battery.c
+++ b/drivers/power/supply/max17040_battery.c
@@ -470,16 +470,12 @@ static const struct power_supply_desc max17040_battery_desc = {
static int max17040_probe(struct i2c_client *client)
{
const struct i2c_device_id *id = i2c_client_get_device_id(client);
- struct i2c_adapter *adapter = client->adapter;
struct power_supply_config psy_cfg = {};
struct max17040_chip *chip;
enum chip_id chip_id;
bool enable_irq = false;
int ret;
- if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE))
- return -EIO;
-
chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;