Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2585096ybd; Thu, 27 Jun 2019 15:16:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1Df9r8hQtZcakxYfg0bddjTlXP+ObZSYdo1VNsbrcg20lXlj6kfZ3bJ13O0jenyvkb56m X-Received: by 2002:a17:902:f087:: with SMTP id go7mr7379941plb.330.1561673770535; Thu, 27 Jun 2019 15:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561673770; cv=none; d=google.com; s=arc-20160816; b=wMIrIEIEx5vVN20/BGWVeRhBTTCs1LtH75rHEDsiFTvrclVJzk2c4hAnGBSzQL4ArH gZOWP/Ju3nK2Gdo4R4LGAXqCW3DAwZoEj2HTWXqEDekITx4zRpkxUM3MFgXv6r4t/jND Y6AKwQA/YE2BsXTWvpimHbSGzT4ulWIY0WiiSrmzWxqfZeyPBEMtF0GiTxfJStYnU0zd w/bgqU8YHXgSkFB2E60jZLP3w93ihP3VXRWZWrSf02B8H9YNiyZ3dbQMd/B5sB8pcALI PtJtm70sF8GpSnq9DHLPKRDbBNPTzUB8NMCWvCJrI8SUHsxNhluJHb9jKyBp215+OM8C XDXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=854kgvZIGVmpx/zJerLitPu72zAj/sPCDRSpo5mcVm8=; b=lyGB+7kvrK4TjtPrxVl566Y4mVsMK/86/K/jwdET7xO8MwYbDOdUaZK2uCiquJsj0k HIRmDQJsXhpyHDxuKqdVBrZ5JTvKQGn5hEjVSGpIteUZmlC3aYdteOms3pewhBLqb1+W wWFm+hJqpQ9QTAh6cX/LKwKt++j79vvzsQPBfcfR566yNNR6riJaPRaafMtRvBXuukyF 6Cbf5tzgCzSROKnxVtWOy3Me3IJYXH60x/EmT7jz62n0zO/enPcM9f/dZDNd/pXSGRNu 0VNX9kwNUqD9XduLTCJ7tio2+15fk66SnrRtp86srYJ+6o6vLcS9in1H0JALzeGxYRYA nhGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=UVBQ6nLg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a7si281705pfc.54.2019.06.27.15.15.54; Thu, 27 Jun 2019 15:16:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=UVBQ6nLg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726865AbfF0WPW (ORCPT + 99 others); Thu, 27 Jun 2019 18:15:22 -0400 Received: from mail-yb1-f193.google.com ([209.85.219.193]:42668 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726445AbfF0WPW (ORCPT ); Thu, 27 Jun 2019 18:15:22 -0400 Received: by mail-yb1-f193.google.com with SMTP id w9so2402866ybe.9 for ; Thu, 27 Jun 2019 15:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=854kgvZIGVmpx/zJerLitPu72zAj/sPCDRSpo5mcVm8=; b=UVBQ6nLgJ7hyBK0VTX31wB+Js1VvwXnP/nwFcgPtwaFJewTCuj1osJwrFqHfTvwRhj oIEIEkV6bUU7HdJznqd+1RtNHgQN60jvIObmjdR9ZV6sXOox4bxgplduaGihqvQpxbvl /CXqzEI/lNWPklsLCFGyCyO1foahYXwHMW0q74DVX3P0B/psWgckT6IoYyN0X7S0cTQC 9Iymb0dP/l61XFeczgOkCa0eM7NbRnqpXJTxNSm5iVfCS2ry7VGHBJveWCE/2qDtz0bf HRZalvnhhWyQm037wDc+4cY+nzn9yf2PfyzaG8fcy2SYeTDplVyStgoCZDdma/1jWHz7 5xtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=854kgvZIGVmpx/zJerLitPu72zAj/sPCDRSpo5mcVm8=; b=fuBEn+MnVA4Nqbz6FdD2iC7HRyOw3yg2uj35Jy4vJQSR9kIDFXFwJnnDcZecAxlAL4 fp3Xg7JsydbrZiWhTVIk0wv0TxVwMdU42dvSKT/harDXQCv8e4NPa8IudcUhfkkBJqLf DBUdSCsbj11dlgOcg7OcB9sqCVo1zy8/ae+4joUVcyCXNVCJQi5zmOqtE6xBZLAXp+2a 09XTZ5ux6Xo4OYtB8IioJuj99xLSYr8uLXY/FwiJRETMinS6hHdnbc44NCWSTdu/tWnx 4EPxyn5nQlrr30EzzlrD5rlr3MACEo4m+H9U4dkEtGLFqwV8J//DC+G2/VeFVRouQZPv OBLA== X-Gm-Message-State: APjAAAW3keVNOtMLXdjdvpWDh1iIWsfZ49aVZwt863c758NW6I1iA6OW oWX/64DwnQ7tWLKbyTe/r9a4R7GLQ2WvDuuTggbf2Q== X-Received: by 2002:a25:d156:: with SMTP id i83mr4645824ybg.67.1561673721316; Thu, 27 Jun 2019 15:15:21 -0700 (PDT) MIME-Version: 1.0 References: <20190627214738.112614-1-rajatja@google.com> In-Reply-To: <20190627214738.112614-1-rajatja@google.com> From: Gwendal Grignou Date: Thu, 27 Jun 2019 15:15:08 -0700 Message-ID: Subject: Re: [PATCH] platform/chrome: lightbar: Get drvdata from parent in suspend/resume To: Rajat Jain Cc: Benson Leung , Enric Balletbo i Serra , Guenter Roeck , Linux Kernel , rajatxjain@gmail.com, Evan Green Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Gwendal Grignou On Thu, Jun 27, 2019 at 2:47 PM Rajat Jain 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 > --- > 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 >