From patchwork Sun Dec 27 13:15:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 7923551 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7B82DBEEE5 for ; Sun, 27 Dec 2015 13:20:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA31B202AE for ; Sun, 27 Dec 2015 13:20:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D042420295 for ; Sun, 27 Dec 2015 13:20:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754402AbbL0NRk (ORCPT ); Sun, 27 Dec 2015 08:17:40 -0500 Received: from m50-135.163.com ([123.125.50.135]:42060 "EHLO m50-135.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752350AbbL0NRj (ORCPT ); Sun, 27 Dec 2015 08:17:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=mrAzIIk89mjicPQ8rB Nns+cruhvqg1G5IvoGeGn9urA=; b=pMhzbKVfcMXyocwn/C30egjMuFuJM2dGdd QmbCCmnN5aEFcwFiBosYUKkypd7vRK3SZjW0pqWHlqMwX15FEP5nt9PpnIufkyMa NIHk8UAU8b9sn9nJ8QHFxu0d9CuCeC2X0XyBf1SVaKH9lo5WpnLZSl71eg14kyfJ PnamGnsRE= Received: from localhost (unknown [116.77.145.148]) by smtp5 (Coremail) with SMTP id D9GowABXrz+P5H9Wd6p9Bw--.6220S3; Sun, 27 Dec 2015 21:16:01 +0800 (CST) From: Geliang Tang To: MyungJoo Ham , Kyungmin Park , Kukjin Kim , Krzysztof Kozlowski Cc: Geliang Tang , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/10] PM / devfreq: exynos: use to_platform_device() Date: Sun, 27 Dec 2015 21:15:39 +0800 Message-Id: X-Mailer: git-send-email 2.5.0 X-CM-TRANSID: D9GowABXrz+P5H9Wd6p9Bw--.6220S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7KFWxJryDJw4rJr4Utw15CFg_yoW8Kw4kpF WjyayIkrW8Kas5Ka10yw1qvFy5t3ZI934IgF4Sk3s5C3s5JrykJFyrJFyxAa15AFWkCF1a y3s0qa48Zw48GF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UF385UUUUU= X-Originating-IP: [116.77.145.148] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiNRHdmVSILDy2mAAAsC Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use to_platform_device() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/devfreq/exynos/exynos4_bus.c | 3 +-- drivers/devfreq/exynos/exynos5_bus.c | 9 +++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/devfreq/exynos/exynos4_bus.c b/drivers/devfreq/exynos/exynos4_bus.c index da95092..e3124bf 100644 --- a/drivers/devfreq/exynos/exynos4_bus.c +++ b/drivers/devfreq/exynos/exynos4_bus.c @@ -566,8 +566,7 @@ static int exynos4_bus_target(struct device *dev, unsigned long *_freq, u32 flags) { int err = 0; - struct platform_device *pdev = container_of(dev, struct platform_device, - dev); + struct platform_device *pdev = to_platform_device(dev); struct busfreq_data *data = platform_get_drvdata(pdev); struct dev_pm_opp *opp; unsigned long freq; diff --git a/drivers/devfreq/exynos/exynos5_bus.c b/drivers/devfreq/exynos/exynos5_bus.c index 297ea30..81da78e 100644 --- a/drivers/devfreq/exynos/exynos5_bus.c +++ b/drivers/devfreq/exynos/exynos5_bus.c @@ -85,8 +85,7 @@ static int exynos5_busfreq_int_target(struct device *dev, unsigned long *_freq, u32 flags) { int err = 0; - struct platform_device *pdev = container_of(dev, struct platform_device, - dev); + struct platform_device *pdev = to_platform_device(dev); struct busfreq_data_int *data = platform_get_drvdata(pdev); struct dev_pm_opp *opp; unsigned long old_freq, freq; @@ -145,8 +144,7 @@ out: static int exynos5_int_get_dev_status(struct device *dev, struct devfreq_dev_status *stat) { - struct platform_device *pdev = container_of(dev, struct platform_device, - dev); + struct platform_device *pdev = to_platform_device(dev); struct busfreq_data_int *data = platform_get_drvdata(pdev); struct busfreq_ppmu_data *ppmu_data = &data->ppmu_data; int busier_dmc; @@ -370,8 +368,7 @@ static int exynos5_busfreq_int_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int exynos5_busfreq_int_resume(struct device *dev) { - struct platform_device *pdev = container_of(dev, struct platform_device, - dev); + struct platform_device *pdev = to_platform_device(dev); struct busfreq_data_int *data = platform_get_drvdata(pdev); struct busfreq_ppmu_data *ppmu_data = &data->ppmu_data;