Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp610336imm; Wed, 23 May 2018 02:34:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpuwq1sAEkbZ8NKBtSlnfwlQipmT/OsbjUGkEGIcBNAwI/0e/zvzLTv/8Ej4IHCHpntOKVy X-Received: by 2002:a63:93:: with SMTP id 141-v6mr1761446pga.322.1527068065401; Wed, 23 May 2018 02:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527068065; cv=none; d=google.com; s=arc-20160816; b=0vBNbea2fkPrjJjLVTXQEWKSVR0a23eXsGavyGVQG2IjRVBrjGkQXwsvBjY4Tkph9v 4q9JOl9EiEXqzO8JAuMUGeA9+dbKwmeFLVZfmllbN9Z7A2A8iljikwh8HMgazH8r/cfn FqKheLh2GuQ/4X4NKOrjOMjCmJHsCZ//nLUxXDzb+gStsW+1s6/pWjXX0JIzLx0E73ID DuJCGLsAwEk+hJ4jK7j/B1fbcLf+/QXbVPcmymJYN3joREu6DbjYOj3b3C69P26Ze8jb SYRbQyFHkVfBqZdbLGk0UiwSQhgnMZTwpH4Bzmt+7Yg8M8Eqv8K/bEm3KB07lh7meVVu 7q4A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=ESo4TJ6dvsntBD/F5qNj0+6uBMVjV9wF1g0cdekhdu4=; b=gWlsNOKUD/pscZ7UJKfiXXYRdvBAVbYFkRivzNHqsoXKgzDXLsDjduup/7wivzVDmH 0wgOwhwIehJXDcopA5stxdOiehoR8KmK7uDSgPD1wswKEeHsPOHuCU7K3CBpfb0t0YAU wATsJmTzf56wwLCMgfSsa4ugxd9VZaVUJcmojue9HHlx/TqX66fsp5ETpkyap05qcEWN xGY7dzfd7vwEyU9KJhfR017ZEA/ajWOnz+h4jHKFmGJtnJvJWPoqlWk6HQGhToIZXvAq +hkUoaONR3bnd6BYC4szQzkUiaHxm0p1dZKeNtlRv6XOlTX6udus8eRBwplkaeXR2o/y dn4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=aJDeafAH; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e68-v6si19078956pfl.132.2018.05.23.02.34.10; Wed, 23 May 2018 02:34:25 -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=@ti.com header.s=ti-com-17Q1 header.b=aJDeafAH; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932378AbeEWJdQ (ORCPT + 99 others); Wed, 23 May 2018 05:33:16 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:17719 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932155AbeEWJdK (ORCPT ); Wed, 23 May 2018 05:33:10 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w4N9X2Lq011948; Wed, 23 May 2018 04:33:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1527067982; bh=ESo4TJ6dvsntBD/F5qNj0+6uBMVjV9wF1g0cdekhdu4=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=aJDeafAHZUAOJ0KPA35DV3RKIuM2zaFfr0gHCTsuQHhKXr42HC1wUfATshU2L6jsz T5eqMnYr0u5C/uGrZ7Y8OQ/Qumbf6Od5GJl9+RYEaYAwiT55n9MR9aKavOa5man/r9 sgGGbDcNfOdPXSi1uQ6jgtUmBM0Spo+9a0vv5e5o= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4N9X2KJ020151; Wed, 23 May 2018 04:33:02 -0500 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 23 May 2018 04:33:01 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Wed, 23 May 2018 04:33:01 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4N9WxoI016615; Wed, 23 May 2018 04:32:59 -0500 Subject: Re: [PATCH 15/61] gpu: drm: omapdrm: displays: simplify getting .drvdata To: Wolfram Sang , CC: , , David Airlie , References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> <20180419140641.27926-16-wsa+renesas@sang-engineering.com> From: Tomi Valkeinen Message-ID: <09116562-53e8-a6ca-42af-fcfd15f940ed@ti.com> Date: Wed, 23 May 2018 12:32:59 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180419140641.27926-16-wsa+renesas@sang-engineering.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/04/18 17:05, Wolfram Sang wrote: > We should get drvdata from struct device directly. Going via > platform_device is an unneeded step back and forth. > > Signed-off-by: Wolfram Sang > --- > > Build tested only. buildbot is happy. Please apply individually. > > drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 18 ++++++------------ > 1 file changed, 6 insertions(+), 12 deletions(-) > > diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c > index 428de90fced1..8f8573a00e07 100644 > --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c > +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c > @@ -412,8 +412,7 @@ static const struct backlight_ops dsicm_bl_ops = { > static ssize_t dsicm_num_errors_show(struct device *dev, > struct device_attribute *attr, char *buf) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct panel_drv_data *ddata = platform_get_drvdata(pdev); > + struct panel_drv_data *ddata = dev_get_drvdata(dev); > struct omap_dss_device *in = ddata->in; > u8 errors = 0; > int r; > @@ -444,8 +443,7 @@ static ssize_t dsicm_num_errors_show(struct device *dev, > static ssize_t dsicm_hw_revision_show(struct device *dev, > struct device_attribute *attr, char *buf) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct panel_drv_data *ddata = platform_get_drvdata(pdev); > + struct panel_drv_data *ddata = dev_get_drvdata(dev); > struct omap_dss_device *in = ddata->in; > u8 id1, id2, id3; > int r; > @@ -476,8 +474,7 @@ static ssize_t dsicm_store_ulps(struct device *dev, > struct device_attribute *attr, > const char *buf, size_t count) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct panel_drv_data *ddata = platform_get_drvdata(pdev); > + struct panel_drv_data *ddata = dev_get_drvdata(dev); > struct omap_dss_device *in = ddata->in; > unsigned long t; > int r; > @@ -511,8 +508,7 @@ static ssize_t dsicm_show_ulps(struct device *dev, > struct device_attribute *attr, > char *buf) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct panel_drv_data *ddata = platform_get_drvdata(pdev); > + struct panel_drv_data *ddata = dev_get_drvdata(dev); > unsigned int t; > > mutex_lock(&ddata->lock); > @@ -526,8 +522,7 @@ static ssize_t dsicm_store_ulps_timeout(struct device *dev, > struct device_attribute *attr, > const char *buf, size_t count) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct panel_drv_data *ddata = platform_get_drvdata(pdev); > + struct panel_drv_data *ddata = dev_get_drvdata(dev); > struct omap_dss_device *in = ddata->in; > unsigned long t; > int r; > @@ -558,8 +553,7 @@ static ssize_t dsicm_show_ulps_timeout(struct device *dev, > struct device_attribute *attr, > char *buf) > { > - struct platform_device *pdev = to_platform_device(dev); > - struct panel_drv_data *ddata = platform_get_drvdata(pdev); > + struct panel_drv_data *ddata = dev_get_drvdata(dev); > unsigned int t; > > mutex_lock(&ddata->lock); > Thanks, I have picked this up. Tomi -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki