From: Gwendal Grignou <gwendal@google.com>
To: Rajat Jain <rajatja@google.com>
Cc: Benson Leung <bleung@chromium.org>,
Enric Balletbo i Serra <enric.balletbo@collabora.com>,
Guenter Roeck <groeck@chromium.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
rajatxjain@gmail.com, Evan Green <evgreen@google.com>
Subject: Re: [PATCH] platform/chrome: lightbar: Get drvdata from parent in suspend/resume
Date: Thu, 27 Jun 2019 15:15:08 -0700 [thread overview]
Message-ID: <CAMHSBOWrzQ6NEDEML-Jk8Y+M5iE6yHXn8FWpUP77VZAV7HGzhQ@mail.gmail.com> (raw)
In-Reply-To: <20190627214738.112614-1-rajatja@google.com>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
On Thu, Jun 27, 2019 at 2:47 PM Rajat Jain <rajatja@google.com> wrote:
>
> 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
>
next prev parent reply other threads:[~2019-06-27 22:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2019-06-28 10:50 ` Enric Balletbo i Serra
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=CAMHSBOWrzQ6NEDEML-Jk8Y+M5iE6yHXn8FWpUP77VZAV7HGzhQ@mail.gmail.com \
--to=gwendal@google.com \
--cc=bleung@chromium.org \
--cc=enric.balletbo@collabora.com \
--cc=evgreen@google.com \
--cc=groeck@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rajatja@google.com \
--cc=rajatxjain@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).