Re: [PATCH] seria: sirf: only use lookup table to set baudrate when ioclk=150MHz

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 25, 2012 at 06:26:02PM +0800, Barry Song wrote:
> @@ -375,7 +375,12 @@ static void sirfsoc_uart_set_termios(struct uart_port *port,
>  	int		threshold_div;
>  	int		temp;
>  
> -	ioclk_rate = 150000000;
> +	struct clk *clk = clk_get_sys("io", NULL);
> +	BUG_ON(IS_ERR(clk));

No.  Really, no.  Stop using BUG_ON() as some kind of crappy assert().
BUG_ON() takes the entire kernel out when it fails.  There's absolutely
no need for this what so ever - especially here.

Get the clock at probe or port initialization time.  Save that pointer.
Only give it up when the port is torn down.  And treat it as any other
clock - prepare and enable it, and disable and unprepare it when you're
done with it.

And there's no need to use this clk_get_sys() crap in drivers.  Add the
necessary clkdev entries or deal with it in DT.  Absolutely do not use
clk_get_sys() in drivers; it's there for *PLATFORM* code to use when
there's no other possibility for them and NOT drivers.
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux