All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Valentin <eduardo.valentin@ti.com>
To: Sachin Kamat <sachin.kamat@linaro.org>
Cc: linux-pm@vger.kernel.org, jonghwa3.lee@samsung.com,
	eduardo.valentin@ti.com, rui.zhang@intel.com,
	amit.daniel@samsung.com, patches@linaro.org
Subject: Re: [PATCH 3/3] thermal: exynos: Clean up non-DT remnants
Date: Thu, 29 Aug 2013 08:17:00 -0400	[thread overview]
Message-ID: <521F3BBC.5030504@ti.com> (raw)
In-Reply-To: <1376893723-22138-3-git-send-email-sachin.kamat@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 3518 bytes --]

On 19-08-2013 02:28, Sachin Kamat wrote:
> Commit 1cd1ecb6 ("thermal: exynos: Remove non DT based support")
> cleaned up some non-DT code. However, there were few more things
> needed for complete cleanup to make this driver DT only.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>

> ---
>  drivers/thermal/samsung/Kconfig      |    2 +-
>  drivers/thermal/samsung/exynos_tmu.c |   30 ++++++++++++------------------
>  2 files changed, 13 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/thermal/samsung/Kconfig b/drivers/thermal/samsung/Kconfig
> index 92492e4..f760389 100644
> --- a/drivers/thermal/samsung/Kconfig
> +++ b/drivers/thermal/samsung/Kconfig
> @@ -1,6 +1,6 @@
>  config EXYNOS_THERMAL
>  	tristate "Exynos thermal management unit driver"
> -	depends on ARCH_HAS_BANDGAP
> +	depends on ARCH_HAS_BANDGAP && OF
>  	help
>  	  If you say yes here you get support for the TMU (Thermal Management
>  	  Unit) driver for SAMSUNG EXYNOS series of SoCs. This driver initialises
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index a033dbb..b43afda 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -481,7 +481,6 @@ static irqreturn_t exynos_tmu_irq(int irq, void *id)
>  	return IRQ_HANDLED;
>  }
>  
> -#ifdef CONFIG_OF
>  static const struct of_device_id exynos_tmu_match[] = {
>  	{
>  		.compatible = "samsung,exynos4210-tmu",
> @@ -502,27 +501,22 @@ static const struct of_device_id exynos_tmu_match[] = {
>  	{},
>  };
>  MODULE_DEVICE_TABLE(of, exynos_tmu_match);
> -#endif
>  
>  static inline struct  exynos_tmu_platform_data *exynos_get_driver_data(
>  			struct platform_device *pdev, int id)
>  {
> -#ifdef CONFIG_OF
>  	struct  exynos_tmu_init_data *data_table;
>  	struct exynos_tmu_platform_data *tmu_data;
> -	if (pdev->dev.of_node) {
> -		const struct of_device_id *match;
> -		match = of_match_node(exynos_tmu_match, pdev->dev.of_node);
> -		if (!match)
> -			return NULL;
> -		data_table = (struct exynos_tmu_init_data *) match->data;
> -		if (!data_table || id >= data_table->tmu_count)
> -			return NULL;
> -		tmu_data = data_table->tmu_data;
> -		return (struct exynos_tmu_platform_data *) (tmu_data + id);
> -	}
> -#endif
> -	return NULL;
> +	const struct of_device_id *match;
> +
> +	match = of_match_node(exynos_tmu_match, pdev->dev.of_node);
> +	if (!match)
> +		return NULL;
> +	data_table = (struct exynos_tmu_init_data *) match->data;
> +	if (!data_table || id >= data_table->tmu_count)
> +		return NULL;
> +	tmu_data = data_table->tmu_data;
> +	return (struct exynos_tmu_platform_data *) (tmu_data + id);
>  }
>  
>  static int exynos_map_dt_data(struct platform_device *pdev)
> @@ -532,7 +526,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
>  	struct resource res;
>  	int ret;
>  
> -	if (!data)
> +	if (!data || !pdev->dev.of_node)
>  		return -ENODEV;
>  
>  	/*
> @@ -754,7 +748,7 @@ static struct platform_driver exynos_tmu_driver = {
>  		.name   = "exynos-tmu",
>  		.owner  = THIS_MODULE,
>  		.pm     = EXYNOS_TMU_PM,
> -		.of_match_table = of_match_ptr(exynos_tmu_match),
> +		.of_match_table = exynos_tmu_match,
>  	},
>  	.probe = exynos_tmu_probe,
>  	.remove	= exynos_tmu_remove,
> 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 295 bytes --]

  reply	other threads:[~2013-08-29 12:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-19  6:28 [PATCH 1/3] thermal: exynos: Fix typos in Kconfig Sachin Kamat
2013-08-19  6:28 ` [PATCH 2/3] thermal: exynos: Fix potential NULL pointer dereference Sachin Kamat
2013-08-29 12:17   ` Eduardo Valentin
2013-08-19  6:28 ` [PATCH 3/3] thermal: exynos: Clean up non-DT remnants Sachin Kamat
2013-08-29 12:17   ` Eduardo Valentin [this message]
2013-08-26 14:15 ` [PATCH 1/3] thermal: exynos: Fix typos in Kconfig Sachin Kamat
2013-08-28  9:01   ` amit daniel kachhap
2013-08-29 12:17 ` Eduardo Valentin
2013-08-30  8:35   ` Zhang Rui
2013-08-30 12:36     ` Eduardo Valentin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=521F3BBC.5030504@ti.com \
    --to=eduardo.valentin@ti.com \
    --cc=amit.daniel@samsung.com \
    --cc=jonghwa3.lee@samsung.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rui.zhang@intel.com \
    --cc=sachin.kamat@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.