Re: [PATCH 2/5] ARM: OMAP2+: hwmod: fetch main_clk based on hwmod name

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

 



Hi,

* Tero Kristo <t-kristo@xxxxxx> [160630 06:18]:
> With the transition to hwmod module clocks, all hwmods will have
> their main clocks named <hwmod_name>_mod_ck. Use this info to
> fetch main_clk, and use it if found.
..

>  static int _init_main_clk(struct omap_hwmod *oh)
>  {
>  	int ret = 0;
> +	char name[32];
> +	static int max_len;
> +	struct clk *clk;
>  
> -	if (!oh->main_clk)
> -		return 0;
> +	strcpy(name, oh->name);
> +	strcat(name, "_mod_ck");
> +
> +	if (strlen(name) > max_len)
> +		max_len = strlen(name);

Just noticed that this needs some improvments to avoid nasty
bugs early on. You don't seem to have max_len defined, and
you should do a strncpy using #define MOD_CLK_MAX_LEN (32 + 7)
or something similar instead of the strcpy and leave room for
the strcat.

Care to update and repost just this one?

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux