platform/chrome: lightbar: Get drvdata from parent in suspend/resume
Subsystems (2)
PATCH 1/1 platform/chrome: lightbar: Get drvdata from parent in suspend/resume
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 <[email protected]>
--- drivers/platform/chrome/cros_ec_lightbar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/chrome/cros_ec_lightbar.c +2 -2
@@ -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 ;
Signature · 1 line
2.22.0.410.gd8fdbe21b5-goog
Reviewed-by Gwendal Grignou <[email protected]>
Quoted 35 lines · Rajat Jain
The lightbar driver never assigned the drvdata in probe method, and thus there is nothing there. Need to get the
ec_devfrom the parent's drvdata.Signed-off-by Rajat Jain <[email protected]>--- drivers/platform/chrome/cros_ec_lightbar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/platform/chrome/cros_ec_lightbar.c +2
-3@@ -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
Quoted 5 lines · Rajat Jain
The lightbar driver never assigned the drvdata in probe method, and thus there is nothing there. Need to get the
ec_devfrom the parent's drvdata.Signed-off-by Rajat Jain <[email protected]>
Queued for 5.3
Thanks,
~ Enric
Quoted 27 lines
--- drivers/platform/chrome/cros_ec_lightbar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/platform/chrome/cros_ec_lightbar.c +2
-2@@ -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 ;