mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: lightbar: Get drvdata from parent in suspend/resume
@ 2019-06-27 21:47 Rajat Jain
  2019-06-27 22:15 ` Gwendal Grignou
  2019-06-28 10:50 ` Enric Balletbo i Serra
  0 siblings, 2 replies; 3+ messages in thread
From: Rajat Jain @ 2019-06-27 21:47 UTC (permalink / raw)
  To: Benson Leung, Enric Balletbo i Serra, Guenter Roeck,
	linux-kernel, rajatxjain, evgreen, gwendal
  Cc: Rajat Jain

The lightbar driver never assigned the drvdata in probe method, and
thus there is nothing there. Need to get the ec_dev from the parent's
drvdata.

Signed-off-by: Rajat Jain <rajatja@google.com>
---
 drivers/platform/chrome/cros_ec_lightbar.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec_lightbar.c b/drivers/platform/chrome/cros_ec_lightbar.c
index d30a6650b0b5..26117a8991b3 100644
--- a/drivers/platform/chrome/cros_ec_lightbar.c
+++ b/drivers/platform/chrome/cros_ec_lightbar.c
@@ -600,7 +600,7 @@ static int cros_ec_lightbar_remove(struct platform_device *pd)
 
 static int __maybe_unused cros_ec_lightbar_resume(struct device *dev)
 {
-	struct cros_ec_dev *ec_dev = dev_get_drvdata(dev);
+	struct cros_ec_dev *ec_dev = dev_get_drvdata(dev->parent);
 
 	if (userspace_control)
 		return 0;
@@ -610,7 +610,7 @@ static int __maybe_unused cros_ec_lightbar_resume(struct device *dev)
 
 static int __maybe_unused cros_ec_lightbar_suspend(struct device *dev)
 {
-	struct cros_ec_dev *ec_dev = dev_get_drvdata(dev);
+	struct cros_ec_dev *ec_dev = dev_get_drvdata(dev->parent);
 
 	if (userspace_control)
 		return 0;
-- 
2.22.0.410.gd8fdbe21b5-goog


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-28 10:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-27 21:47 [PATCH] platform/chrome: lightbar: Get drvdata from parent in suspend/resume Rajat Jain
2019-06-27 22:15 ` Gwendal Grignou
2019-06-28 10:50 ` Enric Balletbo i Serra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®