Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2447005ybl; Thu, 9 Jan 2020 12:57:44 -0800 (PST) X-Google-Smtp-Source: APXvYqwpNefYMNi9ta3TTEZRZ6xanjCegWuclQ2O2oO9Oxobpa+Uae2ZrDZ2t3AT/aEaNMTEy2Wt X-Received: by 2002:a9d:6f8c:: with SMTP id h12mr10492643otq.185.1578603464630; Thu, 09 Jan 2020 12:57:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578603464; cv=none; d=google.com; s=arc-20160816; b=ROH1NDYR1DChNK0Cy4o22z3QbEUurOyjlBwzgsoazmwi8z75Ti19a6AY5zijoWySeq Vifn20MQilSNIQMYy/XDOPxm20vGIV7vociXhadwhNzgQXe/Y1UTknOyn5BABSpsY/9L +HC9q25pIrV2MuakTyAcieqMlV6m+nCSPB5K13zELZFYXuybs4w5yG01qgheUjLT1xM3 lPHYe7c5o7u6HQot26oTGxUnHeLmFG9gOqXDlfsq4SXAdHm4wpapdsL/DKy3FpwhiSc+ Oeu/sT1hJ819pZEoU9INA+ajwhLQQl0kmhTbGeUg9staXv/kz1+hwRj+BlNXyb9Wrj5t 5XZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=QnbDylJTOPEHMGCYCMHvFEFeV9xhyoGzgJKkNwOv3zo=; b=lbUZEZXQwNhCbHnepTcNCU1Fn7FQcCYUh1mm/7knRm/wnd/fpa7BJazGpbKJg7xwy/ Ioi9e0FxbG+q6ebeZAxqSt+XasTxZ3U0U7PJFzuCLTdZOvSAgqjHcEZDe1bnDuCZtCjf 4vDKQVmb0tFVyViuV2E7k+SXoFvacC3tGd87zzJdFfhMhkvycY4fMNclZmGKqW/Lb0lv 7c2L24dvttSBCIsVGZVXtZyGLc/rjhPRQ7RMVwGNQRK0o3VYfzo4sx7Lef4vsXLBR9wb dMr1/h6WJCky+ynAkJib8HoxaIEv7iOmNDGMe8+vbDHQ5qvNiozWcv8sirdkySXhIeOB DjAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l20si4133684oil.224.2020.01.09.12.57.33; Thu, 09 Jan 2020 12:57:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730674AbgAIUiW (ORCPT + 99 others); Thu, 9 Jan 2020 15:38:22 -0500 Received: from foss.arm.com ([217.140.110.172]:36560 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730663AbgAIUiW (ORCPT ); Thu, 9 Jan 2020 15:38:22 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9236331B; Thu, 9 Jan 2020 12:38:21 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 188F03F534; Thu, 9 Jan 2020 12:38:20 -0800 (PST) Date: Thu, 9 Jan 2020 20:38:19 +0000 From: Mark Brown To: Peter Seiderer Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Annaliese McDermond , Takashi Iwai , Jaroslav Kysela , Liam Girdwood Subject: Re: [PATCH v1] ASoC: tlv320aic32x4: handle regmap_read error gracefully Message-ID: <20200109203819.GG3702@sirena.org.uk> References: <20191227152056.9903-1-ps.report@gmx.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8bBEDOJVaa9YlTAt" Content-Disposition: inline In-Reply-To: <20191227152056.9903-1-ps.report@gmx.net> X-Cookie: Killing turkeys causes winter. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --8bBEDOJVaa9YlTAt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Dec 27, 2019 at 04:20:56PM +0100, Peter Seiderer wrote: > @@ -338,7 +338,8 @@ static unsigned long clk_aic32x4_div_recalc_rate(struct clk_hw *hw, > unsigned int val; > - regmap_read(div->regmap, div->reg, &val); > + if (regmap_read(div->regmap, div->reg, &val)) > + return 0; Is this the best fix - shouldn't we be returning an error here? We don't know what the value programmed into the device actually is so zero might be wrong, and we still have the risk that the value we read from the device may be zero if the device is misprogrammed. --8bBEDOJVaa9YlTAt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl4XjzoACgkQJNaLcl1U h9BsYwf9FFgKoSbL5lC50mSEVqCPZLbUHO3dBKRJnmTHcEUvNS5eWPVNpH+cT04y JmhyR9UvkDd0uD8uGILu33O7WQB2p+0vL++3ZNHxmiuPahdDQIsU4LSOd1KxECjK 0CUOK7TRBEhrsDtzGRJASf+1DO8GRqs5abAjTRAkFPBG4mVUtDmPrIaaqxdrS8IG QX2WU53Ee3PidUrDbmVFC7LOxN93YlujLBKhuWwVuD2IvIfzYGmDPIsmUAvKX8wD /+cVC0PrjVec5we3himey5e5o1BwfO8IUK6Fshea6548M90d/oQCioPjxKvLjvNc B/udO2IZjDYCm1uIFshxEGTtGtQlQw== =A/xb -----END PGP SIGNATURE----- --8bBEDOJVaa9YlTAt--