Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2563986ybd; Thu, 27 Jun 2019 14:50:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxy6CwxpHiH3C10MNpF76zJVbyl3/DTD3xt9NkLiu//vMcn1dHIkBe4+lbQEoZ1qkToRiNr X-Received: by 2002:a63:c006:: with SMTP id h6mr5713950pgg.285.1561672202271; Thu, 27 Jun 2019 14:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561672202; cv=none; d=google.com; s=arc-20160816; b=TnnakdX268znnKs3JZcKavy0+nDxcTWYG6D0NH6PGbnJkPt5i6n9okgrZhl8vpbKMR h0lftDY7T2tMOU865LCr8kP0pjfVAzSqp7IXZ+FRxGdeSdfEOe1wu6AtLwOkqn7N7DJ9 3fOyfhEQCbwNAFr16sNJGeo0cPBqmr7A/bmZV+EEsH/v4tX3ZmsHKxLSh/Utbqd3pxqf O5mqvF05sSCBAeOgabwQqrluIgv1fig9fNhkdoEUt6xlvUmjPXbl1SkgQNkD2N+lYOf2 oUXebijlebRmtedUHDSE+TTkjXWW7kKnnoiFhqQvJX8zPHYl09F+KRfExdAGnxwQoQRw wvwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=Jlmh+4kvOZQk9V9h6xlrXM5stBpJondK1dVakdnE3YI=; b=d/KEmSVPEaEmcfSSx/P7kim0OBO9LntnZkWZsyRWfIaoOTUywyhnXkkKiwMitr+23w eZ1hw+2pAlthULxNiXWc0yTfP7/uUXDq6cuDcCpK6PKIKXSGqctJdQRHikOhS4VoHmFD ZZ8Pl+u4n2ZKvM6qAyQvxLNe/GmflIiEjrxCGyIVzh3HL+ypLpCXBR91mGxpkf1Sjupg MEnhhtEhNiR8v5lW74jsA8QFNVkoj+I3ZX3waN7DTAoidTzN09fs8aPijC56tkqaCV98 CRfyPoUczwfv6J0104NdSlcboJoLpAJFIxYqkR1+oqVDTBS+pM4jPhLUiVWOpVWIGZ/8 vDEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=N921I7so; 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 i198si210552pfe.228.2019.06.27.14.49.45; Thu, 27 Jun 2019 14:50:02 -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=N921I7so; 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 S1726695AbfF0Vr4 (ORCPT + 99 others); Thu, 27 Jun 2019 17:47:56 -0400 Received: from mail-vk1-f201.google.com ([209.85.221.201]:43406 "EHLO mail-vk1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726441AbfF0Vrz (ORCPT ); Thu, 27 Jun 2019 17:47:55 -0400 Received: by mail-vk1-f201.google.com with SMTP id j140so1021197vke.10 for ; Thu, 27 Jun 2019 14:47:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=Jlmh+4kvOZQk9V9h6xlrXM5stBpJondK1dVakdnE3YI=; b=N921I7sobL6tUfzVAJrxbRSoqp9aoCJA4aKLgZUYxvjD4LM1wKRjDuPguikbjutYLB /AXcOI2nAoqZfSt3Qy0JIwrQ3t4qI/PbCejCfP/7T5RWDihEPONFK2Soe/tcyFxY54Lt 6i5t640suQlraueInzE4Xubx2HXj2wGc+UnbhoEdhY4fqDK+VtR2uA6L+C06m1JqiTP4 +YyFAu87vktTuzTccLPP9KVVQKG2IVmo7ot1G20GckAB0liJRgw64G27XGB3LBmjcfeD m943yvQM2PnkWUFatGA/FDsL2aSTEHkuaVc5dDe587a64V2uiNkW6wY1g60z437/clwE 5aYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=Jlmh+4kvOZQk9V9h6xlrXM5stBpJondK1dVakdnE3YI=; b=QQe0JhGFfUR6izKcA9BJhh+yChaf5rDIiv0F93ZVnB3vhHO1G+UhHofyQwkwfbK5sU TPLgWoNXHcA7hhhgXrOx/taSkWffH1eS0yqG1O13eI63ts4Lh9dDWsGWjMCI9UnYlu+/ lsEkWrZ/4DaA8B/rILPQfChCPfRLbiQ4BQho/X3XabJ2UvOlgUlKLJjTVQrvyeHby6vK V7+Ko0+YOYffFrxSJUux7MLTuctB09oWRHF18WHicEuTUaonDd5kGWk7NGpjmybGwWUJ mCUJiHhQGtlKkhZXJnt7AZCbOVnA7tY3UBPeaeuiEY1RQR0HPTj0q3cdqVIWMdcwZP3m hGPw== X-Gm-Message-State: APjAAAVdaXhRhhycVnpNCoT36UAphkZ7vgVep41FfjoUAIrWrGvyvPZH tSOoIInuJfN0Cl2yDzKHcw1NAEZ+xP+j X-Received: by 2002:a1f:3692:: with SMTP id d140mr2487711vka.88.1561672074496; Thu, 27 Jun 2019 14:47:54 -0700 (PDT) Date: Thu, 27 Jun 2019 14:47:38 -0700 Message-Id: <20190627214738.112614-1-rajatja@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog Subject: [PATCH] platform/chrome: lightbar: Get drvdata from parent in suspend/resume From: Rajat Jain To: Benson Leung , Enric Balletbo i Serra , Guenter Roeck , linux-kernel@vger.kernel.org, rajatxjain@gmail.com, evgreen@google.com, gwendal@google.com Cc: Rajat Jain 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 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