From: Imre Deak Date: Wed, 28 Apr 2010 12:02:19 +0000 (+0300) Subject: gpu: pvr: more accurate error reporting when clk_set_rate fails X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf66695eea3a27c4fa6c34235a75394a710bae4d;p=sgx.git gpu: pvr: more accurate error reporting when clk_set_rate fails We reported a rounded-down MHz value when clk_set_rate failed, but this didn't make the reason clear when the Hz value didn't match exactly any supported rate. So report Hz values instead. Signed-off-by: Imre Deak --- diff --git a/pvr/sysutils.c b/pvr/sysutils.c index 0f803d0..3f51465 100644 --- a/pvr/sysutils.c +++ b/pvr/sysutils.c @@ -483,11 +483,11 @@ static enum PVRSRV_ERROR InitSgxClocks(struct SYS_DATA *psSysData) rate = clk_round_rate(psSysSpecData->psSGX_FCK, sgx_get_max_freq() + 1); r = clk_set_rate(psSysSpecData->psSGX_FCK, rate); if (r < 0) { - rate = clk_get_rate(psSysSpecData->psSGX_FCK); - rate /= 1000000; - pr_warning("error %d when setting SGX fclk to %luMHz, " - "falling back to %luMHz\n", - r, sgx_get_max_freq() / 1000000, rate); + unsigned long current_rate; + + current_rate = clk_get_rate(psSysSpecData->psSGX_FCK); + pr_warning("error %d when setting SGX fclk to %lu Hz, " + "falling back to %lu Hz\n", r, rate, current_rate); } else { pr_info("SGX clock rate %lu MHz\n", rate / 1000000); };