From patchwork Fri Oct 13 14:59:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10005049 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 6858E60216 for ; Fri, 13 Oct 2017 15:03:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58BF3290A0 for ; Fri, 13 Oct 2017 15:03:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D82C290A2; Fri, 13 Oct 2017 15:03:10 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F347A290A0 for ; Fri, 13 Oct 2017 15:03:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE76A6EBE9; Fri, 13 Oct 2017 15:00:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from galahad.ideasonboard.com (galahad.ideasonboard.com [IPv6:2001:4b98:dc2:45:216:3eff:febb:480d]) by gabe.freedesktop.org (Postfix) with ESMTPS id AFB5D6EBE1 for ; Fri, 13 Oct 2017 15:00:11 +0000 (UTC) Received: from avalon.bb.dnainternet.fi (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id 2F95221457; Fri, 13 Oct 2017 16:59:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1507906761; bh=sTcNKuPVgYdpIfFErzQswkCIFo9ni6TyKI3VTbPJMpU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pbtlHCyMTNMzRa0/Ou7bbrJshJPlVpAAmISuk2uOA5Uaf7QsFQgZGW2aRBY2evVyx qD1gagAsV+L4yYo40z/r4rTnJMi0vvMHNCycIZAcYIQqYlioU70SO/5WZ8PW0gNmMz t4pJKK3A+EVVLja/Jfq5SMku90o0CxbjnbGRRgPU= From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Subject: [PATCH 39/48] drm: omapdrm: dsi: Store the struct device pointer in struct dsi_data Date: Fri, 13 Oct 2017 17:59:35 +0300 Message-Id: <20171013145944.26557-40-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171013145944.26557-1-laurent.pinchart@ideasonboard.com> References: <20171013145944.26557-1-laurent.pinchart@ideasonboard.com> Cc: Tomi Valkeinen X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The dsi_data structure stores a pointer to a struct platform_device. The driver only uses the dev member of the platform device structure. Store the struct device pointer instead and use it directly. Signed-off-by: Laurent Pinchart Reviewed-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/dss/dsi.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 4f67dd70f279..9be26eb262f3 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -332,7 +332,7 @@ struct dsi_of_data { }; struct dsi_data { - struct platform_device *pdev; + struct device *dev; void __iomem *proto_base; void __iomem *phy_base; void __iomem *pll_base; @@ -1146,7 +1146,7 @@ static int dsi_runtime_get(struct dsi_data *dsi) DSSDBG("dsi_runtime_get\n"); - r = pm_runtime_get_sync(&dsi->pdev->dev); + r = pm_runtime_get_sync(dsi->dev); WARN_ON(r < 0); return r < 0 ? r : 0; } @@ -1157,7 +1157,7 @@ static void dsi_runtime_put(struct dsi_data *dsi) DSSDBG("dsi_runtime_put\n"); - r = pm_runtime_put_sync(&dsi->pdev->dev); + r = pm_runtime_put_sync(dsi->dev); WARN_ON(r < 0 && r != -ENOSYS); } @@ -1168,7 +1168,7 @@ static int dsi_regulator_init(struct dsi_data *dsi) if (dsi->vdds_dsi_reg != NULL) return 0; - vdds_dsi = devm_regulator_get(&dsi->pdev->dev, "vdd"); + vdds_dsi = devm_regulator_get(dsi->dev, "vdd"); if (IS_ERR(vdds_dsi)) { if (PTR_ERR(vdds_dsi) != -EPROBE_DEFER) @@ -4953,7 +4953,7 @@ static int dsi_get_clocks(struct dsi_data *dsi) { struct clk *clk; - clk = devm_clk_get(&dsi->pdev->dev, "fck"); + clk = devm_clk_get(dsi->dev, "fck"); if (IS_ERR(clk)) { DSSERR("can't get fck\n"); return PTR_ERR(clk); @@ -5048,7 +5048,7 @@ static void dsi_init_output(struct dsi_data *dsi) { struct omap_dss_device *out = &dsi->output; - out->dev = &dsi->pdev->dev; + out->dev = dsi->dev; out->id = dsi->module_id == 0 ? OMAP_DSS_OUTPUT_DSI1 : OMAP_DSS_OUTPUT_DSI2; @@ -5070,7 +5070,7 @@ static void dsi_uninit_output(struct dsi_data *dsi) static int dsi_probe_of(struct dsi_data *dsi) { - struct device_node *node = dsi->pdev->dev.of_node; + struct device_node *node = dsi->dev->of_node; struct property *prop; u32 lane_arr[10]; int len, num_pins; @@ -5084,7 +5084,7 @@ static int dsi_probe_of(struct dsi_data *dsi) prop = of_find_property(ep, "lanes", &len); if (prop == NULL) { - dev_err(&dsi->pdev->dev, "failed to find lane data\n"); + dev_err(dsi->dev, "failed to find lane data\n"); r = -EINVAL; goto err; } @@ -5093,14 +5093,14 @@ static int dsi_probe_of(struct dsi_data *dsi) if (num_pins < 4 || num_pins % 2 != 0 || num_pins > dsi->num_lanes_supported * 2) { - dev_err(&dsi->pdev->dev, "bad number of lanes\n"); + dev_err(dsi->dev, "bad number of lanes\n"); r = -EINVAL; goto err; } r = of_property_read_u32_array(ep, "lanes", lane_arr, num_pins); if (r) { - dev_err(&dsi->pdev->dev, "failed to read lane data\n"); + dev_err(dsi->dev, "failed to read lane data\n"); goto err; } @@ -5110,7 +5110,7 @@ static int dsi_probe_of(struct dsi_data *dsi) r = dsi_configure_pins(&dsi->output, &pin_cfg); if (r) { - dev_err(&dsi->pdev->dev, "failed to configure pins"); + dev_err(dsi->dev, "failed to configure pins"); goto err; } @@ -5216,7 +5216,7 @@ static int dsi_init_pll_data(struct dss_device *dss, struct dsi_data *dsi) struct clk *clk; int r; - clk = devm_clk_get(&dsi->pdev->dev, "sys_clk"); + clk = devm_clk_get(dsi->dev, "sys_clk"); if (IS_ERR(clk)) { DSSERR("can't get sys_clk\n"); return PTR_ERR(clk); @@ -5320,7 +5320,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data) return -ENOMEM; dsi->dss = dss; - dsi->pdev = pdev; + dsi->dev = dev; dev_set_drvdata(dev, dsi); spin_lock_init(&dsi->irq_lock);