lkml.org 
[lkml]   [2013]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 6/8] MFD:rtsx: Add callback function conv_clk_and_div_n
On Fri, Dec 28, 2012 at 10:41:45AM +0800, wei_wang@realsil.com.cn wrote:
> diff --git a/drivers/mfd/rts5209.c b/drivers/mfd/rts5209.c
> index ba74de8..98fe0f3 100644
> --- a/drivers/mfd/rts5209.c
> +++ b/drivers/mfd/rts5209.c
> @@ -174,6 +174,7 @@ static const struct pcr_ops rts5209_pcr_ops = {
> .card_power_off = rts5209_card_power_off,
> .switch_output_voltage = rts5209_switch_output_voltage,
> .cd_deglitch = NULL,
> + .conv_clk_and_div_n = NULL,

This isn't needed. It's set to NULL by default.

> - N = (u8)(clk - 2);
> + if (pcr->ops->conv_clk_and_div_n)
> + N = (u8)pcr->ops->conv_clk_and_div_n(clk, CLK_TO_DIV_N);
> + else
> + N = (u8)(clk - 2);

These unneeded casts are confusing. Why are we doing them anyway?

regards,
dan carpenter



\
 
 \ /
  Last update: 2013-01-03 14:21    [W:1.195 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site