]> git.hungrycats.org Git - linux/commit
ASoC: pcm512x: Fix divide by zero issue
authorHoward Mitchell <hm@hmbedded.co.uk>
Fri, 20 Mar 2015 21:13:45 +0000 (21:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:03:56 +0000 (22:03 +0200)
commit43ebd1a85ee86416c2d45a3834e7425c396890e9
tree0598516fdb4bfd7200a7c03aedaeb08e20f0564f
parentf646e040a619bcea31a6cab378ccaccb6f4cb659
ASoC: pcm512x: Fix divide by zero issue

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 <hm@hmbedded.co.uk>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/codecs/pcm512x.c