Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1773325ybg; Sat, 19 Oct 2019 02:12:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMbAXMp3LTbY/XysUXiDdx1qVtrbRqQ+NVjwMvRSZ8ZxgV19UWNZl7YxF/vznCchMkPZ8N X-Received: by 2002:a17:906:f15:: with SMTP id z21mr12768155eji.119.1571476344270; Sat, 19 Oct 2019 02:12:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571476344; cv=none; d=google.com; s=arc-20160816; b=alL1j/pdYXZFuOgNjXEVkGfwfXgiYQwTsnTJktE14K+nIBTAxTfbtJp2xMGUs/Ln/T ZxF237nRa/WLfuslgN1WNqBzKGVasQNWCgeoLVBVjpLtqqhLohfq6EeElzd4jWhUyUJg dVM15TOyVk9CMRNpihpq2bUhzVdG9XHXfQH8llkGXfE82AxLaSG2Gxnyoj8L4XVg3f08 3x9ivvFWvxYwfkBWvQbdTLBVikBY8HV2nzCv5rNa0iY1JfOEmez4mjvkl31ZIIMMcB4z 6MOLcW8B9fvEFkoIR1lYUbT0txhMRHCkKktNuyoBhJ3wEFgoJwSEYkp4I2aRmgBXyCp0 j3Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=EOib82iT5CcKVuaANOyyLKj2kVTsPwHhlhNQRIgyrY0=; b=uNEkZwWrmkewLCSYYEDIUvWdpiiQISlp3jjPdVemQ4PMCfoPEKDZ7lwSN32GbsWavn C2iyH5EfaHagwvjWvfjggijRYVtZ5uQndpG6Q5x4QmW1stlSdLSUB6hlQ7u2lWR8DvKp LF21hOU9gzbCfb+5zk7Vxqi+3ebRB1BQhrmdFwU+SQj99Vk3Qa643UEwJcm+p5rzWsnj yhmZ20LxtEQ0aXvOm73BNmlzdet92VUPXtMo32KDHCl5k1nD5JiLm6EZD4QzapkUE+fe ZQ79PL6THaOiIGhKmZxmJDw39asuXWoyS641D5TYeFMin7E3nGHmPeMp5MksFoG9bdPg 19vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=swhyE8aX; 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=pass (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 e4si303320ejq.72.2019.10.19.02.12.00; Sat, 19 Oct 2019 02:12:24 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=swhyE8aX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2443287AbfJRTKX (ORCPT + 99 others); Fri, 18 Oct 2019 15:10:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:59490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2443280AbfJRTKX (ORCPT ); Fri, 18 Oct 2019 15:10:23 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 137B62070B; Fri, 18 Oct 2019 19:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571425822; bh=SV8Vv5FvDe2SpzdgeslYgVDRdktvHpA3+HZ2ioDyY+k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=swhyE8aXu2rhXWjbH/OHfscJsQ35cA/seBvUbMpUNbtKhE6uEg+ooPdTHIn/fqOm9 akfk2pq6oEpcUrKZ2+HIEo42KVYyLI9KfAOgia7b9WcPt74QZDAq6gEldz8FbJVEp+ TRLMggQbp7cGYYbX3I+sQSHRXpapijDGul+f6OMc= Date: Fri, 18 Oct 2019 20:10:16 +0100 From: Jonathan Cameron To: "Ardelean, Alexandru" Cc: "hslester96@gmail.com" , "Popa, Stefan Serban" , "gregkh@linuxfoundation.org" , "linux-iio@vger.kernel.org" , "devel@driverdev.osuosl.org" , "lars@metafoo.de" , "Hennerich, Michael" , "pmeerw@pmeerw.net" , "knaack.h@gmx.de" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] staging: iio: ad9834: add a check for devm_clk_get Message-ID: <20191018201016.0a7fde4f@archlinux> In-Reply-To: <3acc69aceb04667ba34200f54c59b3d160ab2f5d.camel@analog.com> References: <20191016142540.26450-1-hslester96@gmail.com> <3acc69aceb04667ba34200f54c59b3d160ab2f5d.camel@analog.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 17 Oct 2019 12:56:33 +0000 "Ardelean, Alexandru" wrote: > On Wed, 2019-10-16 at 22:25 +0800, Chuhong Yuan wrote: > > ad9834_probe misses a check for devm_clk_get and may cause problems. > > Add a check like what ad9832 does to fix it. > > > > This could also use a Fixes tag, but not a big deal. > > Reviewed-by: Alexandru Ardelean Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. As a general point though, the fact that a devm error handler actually has things to do suggests this code doesn't pass the obviously correct test. Nothing to do with this patch mind you! Jonathan > > > Signed-off-by: Chuhong Yuan > > --- > > drivers/staging/iio/frequency/ad9834.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/staging/iio/frequency/ad9834.c > > b/drivers/staging/iio/frequency/ad9834.c > > index 038d6732c3fd..23026978a5a5 100644 > > --- a/drivers/staging/iio/frequency/ad9834.c > > +++ b/drivers/staging/iio/frequency/ad9834.c > > @@ -417,6 +417,10 @@ static int ad9834_probe(struct spi_device *spi) > > st = iio_priv(indio_dev); > > mutex_init(&st->lock); > > st->mclk = devm_clk_get(&spi->dev, NULL); > > + if (IS_ERR(st->mclk)) { > > + ret = PTR_ERR(st->mclk); > > + goto error_disable_reg; > > + } > > > > ret = clk_prepare_enable(st->mclk); > > if (ret) {