From patchwork Wed May 18 12:19:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume GARDET X-Patchwork-Id: 623537 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3r8tZC3n9Lz9t3h for ; Wed, 18 May 2016 22:20:19 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 850E8A74FB; Wed, 18 May 2016 14:20:17 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E6Wkj0TMSTgD; Wed, 18 May 2016 14:20:17 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C732EA74C5; Wed, 18 May 2016 14:20:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D7EC8A74C5 for ; Wed, 18 May 2016 14:20:12 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1a2lyNCd9KRI for ; Wed, 18 May 2016 14:20:12 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by theia.denx.de (Postfix) with ESMTPS id A4467A74A8 for ; Wed, 18 May 2016 14:20:08 +0200 (CEST) Received: from OLI01.site (unknown [82.244.147.214]) by smtp2-g21.free.fr (Postfix) with ESMTP id 3476C2003E7; Wed, 18 May 2016 12:10:42 +0200 (CEST) From: Guillaume GARDET To: u-boot@lists.denx.de Date: Wed, 18 May 2016 14:19:43 +0200 Message-Id: <1463573983-18597-1-git-send-email-guillaume.gardet@free.fr> X-Mailer: git-send-email 1.8.4.5 Cc: Tom Rini , Sandor Yu , Fabio Estevam , Guillaume GARDET Subject: [U-Boot] [PATCH] video: ipu: Fix build with hard-float ARM toolchain X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Build with hard-float ARM toolchain was broken by commit 3cb4f25c: 'video: ipu: avoid overflow issue'. To fix it, we use do_div function. Build tested for mx6qsabrelite_defconfig. Signed-off-by: Guillaume GARDET Cc: Peng Fan Cc: Sandor Yu Cc: Anatolij Gustschin Cc: Stefano Babic Cc: Fabio Estevam Cc: Tom Rini --- drivers/video/ipu_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c index 36d4b23..e319c82 100644 --- a/drivers/video/ipu_common.c +++ b/drivers/video/ipu_common.c @@ -352,7 +352,8 @@ static int ipu_pixel_clk_set_rate(struct clk *clk, unsigned long rate) */ __raw_writel((div / 16) << 16, DI_BS_CLKGEN1(clk->id)); - clk->rate = (u64)(clk->parent->rate * 16) / div; + do_div(parent_rate, div); + clk->rate = parent_rate; return 0; }