Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966077AbbLPRGy (ORCPT ); Wed, 16 Dec 2015 12:06:54 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:56406 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934333AbbLPRGw (ORCPT ); Wed, 16 Dec 2015 12:06:52 -0500 Authentication-Results: ppops.net; spf=none smtp.mail=rf@opensource.wolfsonmicro.com From: Richard Fitzgerald To: CC: , , Subject: [PATCH] ASoC: arizona: In arizona_calc_fratio make new codecs the default case Date: Wed, 16 Dec 2015 17:06:24 +0000 Message-ID: <1450285584-14472-1-git-send-email-rf@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310007 definitions=main-1512160276 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1289 Lines: 46 This patch rearranges the switch statement in arizona_calc_fratio so that older codecs are the special cases, with the default case applying to newer codecs (WM8998 and later). This is preferable because it avoids having to patch new cases in every time a new codec is added. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/arizona.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index d90b3c5..38a73e3 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c @@ -2020,18 +2020,18 @@ static int arizona_calc_fratio(struct arizona_fll *fll, } switch (fll->arizona->type) { + case WM5102: + case WM8997: + return init_ratio; case WM5110: case WM8280: if (fll->arizona->rev < 3 || sync) return init_ratio; break; - case WM8998: - case WM1814: + default: if (sync) return init_ratio; break; - default: - return init_ratio; } cfg->fratio = init_ratio - 1; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/