public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Nikita Travkin <nikita@trvn.ru>
To: Sebastian Reichel <sre@kernel.org>, Andrew Davis <afd@ti.com>
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>,
	 linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Raymond Hackley <raymondhackley@protonmail.com>,
	 Nikita Travkin <nikita@trvn.ru>
Subject: [PATCH] power: supply: rt5033: Bring back i2c_set_clientdata
Date: Wed, 05 Jun 2024 18:53:27 +0500	[thread overview]
Message-ID: <20240605-rt5033-null-clientdata-v1-1-558d710eeb4d@trvn.ru> (raw)

Commit 3a93da231c12 ("power: supply: rt5033: Use devm_power_supply_register() helper")
reworked the driver to use devm. While at it, the i2c_set_clientdata
was dropped along with the remove callback. Unfortunately other parts
of the driver also rely on i2c clientdata so this causes kernel oops.

Bring the call back to fix the driver.

Fixes: 3a93da231c12 ("power: supply: rt5033: Use devm_power_supply_register() helper")
Tested-by: Raymond Hackley <raymondhackley@protonmail.com>
Signed-off-by: Nikita Travkin <nikita@trvn.ru>
---
 drivers/power/supply/rt5033_battery.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/supply/rt5033_battery.c b/drivers/power/supply/rt5033_battery.c
index 32eafe2c00af..7a27b262fb84 100644
--- a/drivers/power/supply/rt5033_battery.c
+++ b/drivers/power/supply/rt5033_battery.c
@@ -159,6 +159,7 @@ static int rt5033_battery_probe(struct i2c_client *client)
 		return -EINVAL;
 	}
 
+	i2c_set_clientdata(client, battery);
 	psy_cfg.of_node = client->dev.of_node;
 	psy_cfg.drv_data = battery;
 

---
base-commit: 234cb065ad82915ff8d06ce01e01c3e640b674d2
change-id: 20240605-rt5033-null-clientdata-3743d68d504a

Best regards,
-- 
Nikita Travkin <nikita@trvn.ru>


             reply	other threads:[~2024-06-05 14:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-05 13:53 Nikita Travkin [this message]
2024-06-05 22:17 ` [PATCH] power: supply: rt5033: Bring back i2c_set_clientdata Sebastian Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240605-rt5033-null-clientdata-v1-1-558d710eeb4d@trvn.ru \
    --to=nikita@trvn.ru \
    --cc=afd@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=raymondhackley@protonmail.com \
    --cc=sebastian.reichel@collabora.com \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox