linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: OMAP: SmartReflex: pass device dependent data via platform data
Date: Thu, 20 Sep 2012 15:15:04 -0700	[thread overview]
Message-ID: <20120920221504.GK28835@atomide.com> (raw)
In-Reply-To: <1348152453-30532-3-git-send-email-j-pihet@ti.com>

Hi,

* Jean Pihet <jean.pihet@newoldbits.com> [120920 07:48]:
> --- a/drivers/power/avs/smartreflex.c
> +++ b/drivers/power/avs/smartreflex.c
> @@ -131,14 +131,11 @@ static void sr_set_clk_length(struct omap_sr *sr)
>  	struct clk *sys_ck;
>  	u32 sys_clk_speed;
>  
> -	if (cpu_is_omap34xx())
> -		sys_ck = clk_get(NULL, "sys_ck");
> -	else
> -		sys_ck = clk_get(NULL, "sys_clkin_ck");
> +	sys_ck = clk_get(NULL, sr->fck_name);
>  
>  	if (IS_ERR(sys_ck)) {
> -		dev_err(&sr->pdev->dev, "%s: unable to get sys clk\n",
> -			__func__);
> +		dev_err(&sr->pdev->dev, "%s: unable to get smartreflex fck %s\n",
> +			__func__, sr->fck_name);
>  		return;
>  	}
>  

You should be able to make this even simpler and not have to pass
the clock name around at all. Just do:

syc_ck = clk_get(NULL, "fck);
...

In the driver, and add the necessary entries to the clock alias
table. That way it's up to the SoC to set up the necessary clocks
and the driver stays generic.

> @@ -1049,6 +1039,7 @@ static int __devexit omap_sr_remove(struct platform_device *pdev)
>  
>  	list_del(&sr_info->node);
>  	iounmap(sr_info->base);
> +	kfree(sr_info->fck_name);
>  	kfree(sr_info->name);
>  	kfree(sr_info);
>  	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);

Then there's no need for the kfree of the fck_name
either.

There's an example of a similar patch done for twl-core.c as commit
defa6be1 (mfd: Fix compile for twl-core.c by removing cpu_is_omap usage)
in current linux next, except with smartreflex you probably don't
need to do any of the platform_device_alloc trickery like twl-core.c
neded to get around using the i2c numbers as names.

Regards,

Tony

  reply	other threads:[~2012-09-20 22:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20 14:47 [PATCH 0/2] ARM: OMAP: SmartReflex: pass device dependent data via platform data Jean Pihet
2012-09-20 14:47 ` [PATCH 1/2] ARM: OMAP: SmartReflex: fix error path in init function Jean Pihet
2012-09-20 14:47 ` [PATCH 2/2] ARM: OMAP: SmartReflex: pass device dependent data via platform data Jean Pihet
2012-09-20 22:15   ` Tony Lindgren [this message]
2012-09-21  6:30     ` Jean Pihet
2012-09-21 19:07       ` Tony Lindgren
2012-09-24 14:10         ` Jean Pihet
2012-09-24 14:16 ` [PATCH 0/2] " Jean Pihet
2012-09-24 14:16   ` [PATCH 1/2] ARM: OMAP: SmartReflex: fix error path in init function Jean Pihet
2012-10-02 21:59     ` Kevin Hilman
2012-09-24 14:16   ` [PATCH 2/2] ARM: OMAP: SmartReflex: pass device dependent data via platform data Jean Pihet
2012-10-02 22:21     ` Kevin Hilman
2012-10-03 13:05       ` Jean Pihet
2012-10-03 13:32     ` jean.pihet at newoldbits.com
2012-10-03 14:29       ` Kevin Hilman
2012-10-03 15:51         ` Jean Pihet
  -- strict thread matches above, loose matches on Subject: below --
2012-10-03 15:47 [PATCH 0/2] " jean.pihet at newoldbits.com
2012-10-03 15:47 ` [PATCH 2/2] " jean.pihet at newoldbits.com
2012-10-04 16:47 [PATCH 0/2] " jean.pihet at newoldbits.com
2012-10-04 16:47 ` [PATCH 2/2] " jean.pihet at newoldbits.com

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=20120920221504.GK28835@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).