From patchwork Tue Jun 23 19:54:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 191595 Delivered-To: patch@linaro.org Received: by 2002:a54:3249:0:0:0:0:0 with SMTP id g9csp1364099ecs; Tue, 23 Jun 2020 14:19:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy20MQBGfFUa8HOPLZ3tzUSGgRtdWtp/ou43ittnp8S7kI+9ahQe3wCrm2a2Z427BypLMEL X-Received: by 2002:a05:6402:17f6:: with SMTP id t22mr11113382edy.141.1592947146809; Tue, 23 Jun 2020 14:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592947146; cv=none; d=google.com; s=arc-20160816; b=fUFtjO9KydSdg6gDCQ32Cmvxrk6XC9AoVJx/U+BNcbWa4JbJ9PGV1sYq7ppYsNnKoq pDTUv6fbKkmyN66PC702paRZJXKyWMHeUJEkuHmnRAjMkIWc90+It0zf8k4iusS1oB5q oFOGgY5L/psLrhwW8taNXTgE/ZS+hoQnb2IdVgg+MOt8yj1blKjim9/hsX9PNZdw06Ie Rb5vhuLOeTHnkHPwiPfK5UHBjN0Vj5ilhgKNt+aQHmzSDRvGs8wZP3YvWU3RPW8gBI8M UvpaNzRrYKUEXDxj9zP7orincZJQEK1UFsIWO2j3cwzFFIllISiasy3eL9lcJ/GDVkkT +H8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OzgM/9iktEVqxx4qPObAEBg0jVZh96TrWEp6DDZZ4WE=; b=nszrbh/R8AxRS1Hb0oqbKOtUPbQYE0KqkuPKlXPOyBw/lUPFEy9awh5Byv/nrIIdC9 Vthth4L8paw++UjOT+hxydj7HBT0e8Ufzq5NTAwdE+z5NCXaYWtkY7kEQN7hc7sfVPYi QQOFWawjkc+qH1MHUzVqOdnp6XLckezA0+9KgdBB7wsyc+/4csemYFUme9QsP8TMM974 WR+d/frelCUj8uFjxSpsLORpjNqhaQokIoKJYAjR2q0t5L0JkP7VwTjqxW2mXuCDf7TO 4DxwEGNfCr5I2NXGyodzMD5Z88IgS7GPhkH44o+wGXsZDuxqYWYgxOdJ68851J5J38Sh 3xWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Q/5sb38d"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a24si1478615ejk.208.2020.06.23.14.19.06; Tue, 23 Jun 2020 14:19:06 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Q/5sb38d"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392204AbgFWVTF (ORCPT + 15 others); Tue, 23 Jun 2020 17:19:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:44324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390004AbgFWUZW (ORCPT ); Tue, 23 Jun 2020 16:25:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C50EB2064B; Tue, 23 Jun 2020 20:25:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592943922; bh=M86fOLiCQkK9k6YYz0e5I3FGzgfHy4XRhEqm5QpA51c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q/5sb38dIN4mFnikJ2EFpNmnHLZyYT6kG2Ryqlp6q00FGybvPO7cew9UYeQDAOaeI VIjPQjvxmDGl3fgen/aresLv2z79JCoXN16Tvv9Avmg8kBCuoroNZ8QOr5KGdZy4LA hrRiqZjkjYrCd185s+xkLuYqknY2XoCXf4DTxFNg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Kandagatla , Sasha Levin Subject: [PATCH 5.4 104/314] slimbus: ngd: get drvdata from correct device Date: Tue, 23 Jun 2020 21:54:59 +0200 Message-Id: <20200623195343.812290910@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195338.770401005@linuxfoundation.org> References: <20200623195338.770401005@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Srinivas Kandagatla [ Upstream commit b58c663059b484f7ff547d076a34cf6d7a302e56 ] Get drvdata directly from parent instead of ngd dev, as ngd dev can probe defer and previously set drvdata will become null. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200417093618.7929-1-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/slimbus/qcom-ngd-ctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index 29fbab55c3b38..01a17d84b6064 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1354,7 +1354,6 @@ static int of_qcom_slim_ngd_register(struct device *parent, ngd->pdev->driver_override = QCOM_SLIM_NGD_DRV_NAME; ngd->pdev->dev.of_node = node; ctrl->ngd = ngd; - platform_set_drvdata(ngd->pdev, ctrl); platform_device_add(ngd->pdev); ngd->base = ctrl->base + ngd->id * data->offset + @@ -1369,12 +1368,13 @@ static int of_qcom_slim_ngd_register(struct device *parent, static int qcom_slim_ngd_probe(struct platform_device *pdev) { - struct qcom_slim_ngd_ctrl *ctrl = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; + struct qcom_slim_ngd_ctrl *ctrl = dev_get_drvdata(dev->parent); int ret; ctrl->ctrl.dev = dev; + platform_set_drvdata(pdev, ctrl); pm_runtime_use_autosuspend(dev); pm_runtime_set_autosuspend_delay(dev, QCOM_SLIM_NGD_AUTOSUSPEND); pm_runtime_set_suspended(dev);