From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:42845 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbbEBRBt (ORCPT ); Sat, 2 May 2015 13:01:49 -0400 Subject: Patch "ASoC: pcm512x: Fix divide by zero issue" has been added to the 4.0-stable tree To: hm@hmbedded.co.uk, broonie@sirena.org.uk, gregkh@linuxfoundation.org Cc: , From: Date: Sat, 02 May 2015 19:01:08 +0200 Message-ID: <143058606816278@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled ASoC: pcm512x: Fix divide by zero issue to the 4.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: asoc-pcm512x-fix-divide-by-zero-issue.patch and it can be found in the queue-4.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From f073faa73626f41db7050a69edd5074c53ce6d6c Mon Sep 17 00:00:00 2001 From: Howard Mitchell Date: Fri, 20 Mar 2015 21:13:45 +0000 Subject: ASoC: pcm512x: Fix divide by zero issue From: Howard Mitchell commit f073faa73626f41db7050a69edd5074c53ce6d6c upstream. If den=1 and pllin_rate>20MHz then den and num are adjusted to 0 causing a divide by zero error a few lines further on. Therefore this patch correctly scales num and den such that pllin_rate/den < 20MHz as required in the device data sheet. Signed-off-by: Howard Mitchell Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/codecs/pcm512x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/sound/soc/codecs/pcm512x.c +++ b/sound/soc/codecs/pcm512x.c @@ -576,8 +576,8 @@ static int pcm512x_find_pll_coeff(struct /* pllin_rate / P (or here, den) cannot be greater than 20 MHz */ if (pllin_rate / den > 20000000 && num < 8) { - num *= 20000000 / (pllin_rate / den); - den *= 20000000 / (pllin_rate / den); + num *= DIV_ROUND_UP(pllin_rate / den, 20000000); + den *= DIV_ROUND_UP(pllin_rate / den, 20000000); } dev_dbg(dev, "num / den = %lu / %lu\n", num, den); Patches currently in stable-queue which might be from hm@hmbedded.co.uk are queue-4.0/asoc-pcm512x-add-analogue-prefix-to-analogue-volume-controls.patch queue-4.0/asoc-pcm512x-fix-divide-by-zero-issue.patch