Received: by 10.192.165.156 with SMTP id m28csp774823imm; Thu, 19 Apr 2018 07:22:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+CP03IS3gFUDkzlm2SngfUREMQGxW4YzBUSMNF6x3C8PTcPA6hA+JPQPO9z15nYZ3ZMDiE X-Received: by 2002:a17:902:4d46:: with SMTP id o6-v6mr6393929plh.243.1524147753978; Thu, 19 Apr 2018 07:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147753; cv=none; d=google.com; s=arc-20160816; b=G27gv/Fs7ZsYXnLU9Y0Tu/q5JKX7ipLtVaWY9D8cbzkn5y6qbX9fGyOehJAT1q3jYv Gg90T84sSwn7ntZBgog58JIUJaGS6iiqLFHgru0bOyAxn6Pt6cV9y73Rcc8RN/6s0dMm UKp8Ubu9w/XhCGwbu+b9fP8bP0X3bmDFNh0eIWRZ5sRurvDxLhs1lnocN88bfV+OL5Hn onHWX38S93BFtoO5zkxL/h75B8D5dEKyYlLmTVr/TY3nSzrCrs/tKREx7n0W9QNa6sOv xPXFIARQpok7En8CwVVb3v2m1ciElzoSyWl+4NOhXX6vZjCYBuH4H/mUh1/C6driGAJJ PYHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=WhIpF9Mrufj9CO3+KuAsUZjY2jZ4hoMu4dSfmNy9UFI=; b=PNb0SbTwGhoyBa7jpOcSv2HD2PqyJ981IPta8FSd7bsgKi+HAye4lvOBuCVRr3LV65 q9b/jOxFJkZ9d2MByaUKXZdy6UN0SGo1+HoS4sNpoa/RIBlcE7PaG0UxzSzSgrzM2qET EeUOmh5MR+ivZcUokrMW5VgQpxb8AFijQWJGxK04sr87ofe3wjO4iZHvrWTrfL+n1S9T w4di+34LZOAc27GQjnNT3X5tI9mvLzKSR1M8AHoUrH7fRsunUOwmWajvvQgSLOPXLADs Zl7aPAgYaCmZ5gdyZrWujhFwEXt9ZzMWeRxlI2jw1+OPATR83CpzG9OEYwPwJdx9CKM3 jOtQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t29si3148542pgo.539.2018.04.19.07.22.19; Thu, 19 Apr 2018 07:22:33 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753571AbeDSOVS (ORCPT + 99 others); Thu, 19 Apr 2018 10:21:18 -0400 Received: from sauhun.de ([88.99.104.3]:45342 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753088AbeDSOHB (ORCPT ); Thu, 19 Apr 2018 10:07:01 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 888B23139C6; Thu, 19 Apr 2018 16:06:59 +0200 (CEST) From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel-janitors@vger.kernel.org, Wolfram Sang , Kyungmin Park , Sylwester Nawrocki , Mauro Carvalho Chehab , Kukjin Kim , Krzysztof Kozlowski , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 26/61] media: platform: exynos4-is: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:05:56 +0200 Message-Id: <20180419140641.27926-27-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/media/platform/exynos4-is/media-dev.c | 6 ++---- drivers/media/platform/exynos4-is/mipi-csis.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c index 78b48a1fa26c..deb499f76412 100644 --- a/drivers/media/platform/exynos4-is/media-dev.c +++ b/drivers/media/platform/exynos4-is/media-dev.c @@ -1201,8 +1201,7 @@ static const struct media_device_ops fimc_md_ops = { static ssize_t fimc_md_sysfs_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct platform_device *pdev = to_platform_device(dev); - struct fimc_md *fmd = platform_get_drvdata(pdev); + struct fimc_md *fmd = dev_get_drvdata(dev); if (fmd->user_subdev_api) return strlcpy(buf, "Sub-device API (sub-dev)\n", PAGE_SIZE); @@ -1214,8 +1213,7 @@ static ssize_t fimc_md_sysfs_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct platform_device *pdev = to_platform_device(dev); - struct fimc_md *fmd = platform_get_drvdata(pdev); + struct fimc_md *fmd = dev_get_drvdata(dev); bool subdev_api; int i; diff --git a/drivers/media/platform/exynos4-is/mipi-csis.c b/drivers/media/platform/exynos4-is/mipi-csis.c index cba46a656338..b4e28a299e26 100644 --- a/drivers/media/platform/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/exynos4-is/mipi-csis.c @@ -891,8 +891,7 @@ static int s5pcsis_probe(struct platform_device *pdev) static int s5pcsis_pm_suspend(struct device *dev, bool runtime) { - struct platform_device *pdev = to_platform_device(dev); - struct v4l2_subdev *sd = platform_get_drvdata(pdev); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct csis_state *state = sd_to_csis_state(sd); int ret = 0; @@ -921,8 +920,7 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime) static int s5pcsis_pm_resume(struct device *dev, bool runtime) { - struct platform_device *pdev = to_platform_device(dev); - struct v4l2_subdev *sd = platform_get_drvdata(pdev); + struct v4l2_subdev *sd = dev_get_drvdata(dev); struct csis_state *state = sd_to_csis_state(sd); int ret = 0; -- 2.11.0