clocksource: sh_mtu2: Turn sh_mtu2_priv fields into local variables
The rate and periodic fields are used in a single function only, as local variables. Remove them from the structure. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Tested-by: Wolfram Sang <wsa@sang-engineering.com>
This commit is contained in:
parent
276bee05d8
commit
f92d62f539
1 changed files with 5 additions and 5 deletions
|
@ -39,8 +39,6 @@ struct sh_mtu2_priv {
|
||||||
struct clk *clk;
|
struct clk *clk;
|
||||||
int irq;
|
int irq;
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
unsigned long rate;
|
|
||||||
unsigned long periodic;
|
|
||||||
struct clock_event_device ced;
|
struct clock_event_device ced;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -122,6 +120,8 @@ static void sh_mtu2_start_stop_ch(struct sh_mtu2_priv *p, int start)
|
||||||
|
|
||||||
static int sh_mtu2_enable(struct sh_mtu2_priv *p)
|
static int sh_mtu2_enable(struct sh_mtu2_priv *p)
|
||||||
{
|
{
|
||||||
|
unsigned long periodic;
|
||||||
|
unsigned long rate;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
pm_runtime_get_sync(&p->pdev->dev);
|
pm_runtime_get_sync(&p->pdev->dev);
|
||||||
|
@ -137,13 +137,13 @@ static int sh_mtu2_enable(struct sh_mtu2_priv *p)
|
||||||
/* make sure channel is disabled */
|
/* make sure channel is disabled */
|
||||||
sh_mtu2_start_stop_ch(p, 0);
|
sh_mtu2_start_stop_ch(p, 0);
|
||||||
|
|
||||||
p->rate = clk_get_rate(p->clk) / 64;
|
rate = clk_get_rate(p->clk) / 64;
|
||||||
p->periodic = (p->rate + HZ/2) / HZ;
|
periodic = (rate + HZ/2) / HZ;
|
||||||
|
|
||||||
/* "Periodic Counter Operation" */
|
/* "Periodic Counter Operation" */
|
||||||
sh_mtu2_write(p, TCR, 0x23); /* TGRA clear, divide clock by 64 */
|
sh_mtu2_write(p, TCR, 0x23); /* TGRA clear, divide clock by 64 */
|
||||||
sh_mtu2_write(p, TIOR, 0);
|
sh_mtu2_write(p, TIOR, 0);
|
||||||
sh_mtu2_write(p, TGR, p->periodic);
|
sh_mtu2_write(p, TGR, periodic);
|
||||||
sh_mtu2_write(p, TCNT, 0);
|
sh_mtu2_write(p, TCNT, 0);
|
||||||
sh_mtu2_write(p, TMDR, 0);
|
sh_mtu2_write(p, TMDR, 0);
|
||||||
sh_mtu2_write(p, TIER, 0x01);
|
sh_mtu2_write(p, TIER, 0x01);
|
||||||
|
|
Loading…
Add table
Reference in a new issue