From patchwork Mon Feb 5 14:34:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 10200549 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C0236601A1 for ; Mon, 5 Feb 2018 14:38:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A81792858B for ; Mon, 5 Feb 2018 14:38:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99D41286C7; Mon, 5 Feb 2018 14:38:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 018C52858B for ; Mon, 5 Feb 2018 14:38:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=naIIbXxxyD1bCY94gbpdyB932JSTScg3COQ7X9Pt7do=; b=SmGBRjGL/OevWOzFMmFn9Kb+m7 VwnXEi6Hht5DdeIPPFwubaC4PXImsj0HsyRQOvlPWW3Hao71D94QuuBchgJ6RsuH8pwCamD3uVKdK Tk9FxCgc8iWwwlCBrLsmrDI7CF1Y0FMn/Rz+wiN7Ugml4r2VwxaQ3VO+nrw9XBhKdax6FogyZakZ1 zaTP7ehu43i9DRP8TAwS8n3HdHMMMmsBvjVAbSExAByWm1+LYvws6lS+cTe+DW+KuXnK3ke/hp2PQ VG8rR8bLgoxdf1MFOVb9/XSudVS8D55ZZEQAgWAsAw0zfyvYDYM0qwy4kUKPvTrjrmLu0KOosVK+7 0tnpBXyg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eihuU-0003Rw-Qa; Mon, 05 Feb 2018 14:38:18 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eihrr-0000Gh-FE; Mon, 05 Feb 2018 14:35:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=QEeVcN2+LxYZWRwNXkHxafyD3x0sLys/bc4nuZBaW+A=; b=iWc9+D+0hnKlOxupvsczpYiY5 hntMzEmDo+mFSkDfSdXufKZu2viEG10OhpzbTwzEGsoOv41WChYAeVOPerIMGh9bXGDMoxP96AfmG WqdVNdzt1AxKrcjpmz/13ukTy81mqQMFtJ9hxSkIC2+Fu8kHML5zFELhtLdqfoep7hMBW1xcpE8dC Xb02oOlkesPMlapfq5ABdZ6S7yWD9oDjRxhMBrIlSCtXx1qmjfE/cVcEEXuVmxVYyC36CGNmcKIq+ 3UuqY3pXDasgCivbvaT4xkQ3S0+09C99vvp2lVKMF6d/JROt8zFMmSKvAhvnO/h/u2AkMoV97W+my iBri7HOtg==; Received: from gloria.sntech.de ([95.129.55.99]) by merlin.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eihro-00005C-5H; Mon, 05 Feb 2018 14:35:33 +0000 Received: from ip9234b6d7.dynamic.kabel-deutschland.de ([146.52.182.215] helo=phil.fritz.box) by gloria.sntech.de with esmtpsa (TLS1.1:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1eihrF-0005IM-Vi; Mon, 05 Feb 2018 15:34:58 +0100 From: Heiko Stuebner To: hjc@rock-chips.com, architt@codeaurora.org, a.hajda@samsung.com, kishon@ti.com Subject: [PATCH 8/9] drm/rockchip: dw_hdmi: store rockchip_hdmi reference in phy_data object Date: Mon, 5 Feb 2018 15:34:34 +0100 Message-Id: <20180205143435.4723-9-heiko@sntech.de> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180205143435.4723-1-heiko@sntech.de> References: <20180205143435.4723-1-heiko@sntech.de> X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, Jose.Abreu@synopsys.com, algea.cao@rock-chips.com, Heiko Stuebner , devicetree@vger.kernel.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, robh+dt@kernel.org, Laurent.pinchart@ideasonboard.com, linux-arm-kernel@lists.infradead.org, zhengyang@rock-chips.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When using special phy handling operations we'll often need access to the rockchip_hdmi struct. As the chip-data that occupies the phy_data pointer initially gets assigned to the rockchip_hdmi struct we can not re-use this phy_data pointer to hold the reference to the rockchip_hdmi struct, similar to how meson-hdmi does it for example. Signed-off-by: Heiko Stuebner --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 512f8556e7c0..5a62328887d5 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -342,7 +342,7 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, void *data) { struct platform_device *pdev = to_platform_device(dev); - const struct dw_hdmi_plat_data *plat_data; + struct dw_hdmi_plat_data *plat_data; const struct of_device_id *match; struct drm_device *drm = data; struct drm_encoder *encoder; @@ -357,9 +357,14 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, return -ENOMEM; match = of_match_node(dw_hdmi_rockchip_dt_ids, pdev->dev.of_node); - plat_data = match->data; + plat_data = devm_kmemdup(&pdev->dev, match->data, + sizeof(*plat_data), GFP_KERNEL); + if (!plat_data) + return -ENOMEM; + hdmi->dev = &pdev->dev; hdmi->chip_data = plat_data->phy_data; + plat_data->phy_data = hdmi; encoder = &hdmi->encoder; encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, dev->of_node);