From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3281E77375 for ; Sat, 30 Sep 2023 14:37:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234225AbjI3Ohl (ORCPT ); Sat, 30 Sep 2023 10:37:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234202AbjI3Ohk (ORCPT ); Sat, 30 Sep 2023 10:37:40 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 324FAC5; Sat, 30 Sep 2023 07:37:38 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED0C4C433C7; Sat, 30 Sep 2023 14:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696084657; bh=8Fc/CeyGTNVfQR93VmyE2psqKuXvZfPHfaLUp1L7J3A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=o6Cqf/Fc75retJsJnzU1RZ910q51QLx3aAp8Z0SNJqznHx/nSw9qmogYotNTqB0j/ 2lEzUxZf6PEn7YkYNAKlCC/eKlQkHoA7h31Nstdj0CtTmfqCo//GV84q0wah//NXoW IqY8dSjEO10mlbkvj2R3TS2MzN0zV3tDiP73VXaeI6/kcHqWgkrd/aLJWCfQbzMZwL vMh6GCd7UW7vyGEIWpgkYniVBcBI9myl4x2hwUfmV3b73J9pSo4Fq6tHQTrLiFxeqq VLTtOQx7JvUtNnXwObtYaEjcooBpPr1S39NSD0/pHA7V9sYi3I997Z7BBW0kKH+xaX 9eDYC1gssdpRg== Date: Sat, 30 Sep 2023 15:37:36 +0100 From: Jonathan Cameron To: David Lechner Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-staging@lists.linux.dev, David Lechner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Hennerich , Nuno =?UTF-8?B?U8Oh?= , Axel Haslam , Philip Molloy , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 04/27] staging: iio: resolver: ad2s1210: check return of ad2s1210_initial() Message-ID: <20230930153736.52229088@jic23-huawei> In-Reply-To: <20230929-ad2s1210-mainline-v3-4-fa4364281745@baylibre.com> References: <20230929-ad2s1210-mainline-v3-0-fa4364281745@baylibre.com> <20230929-ad2s1210-mainline-v3-4-fa4364281745@baylibre.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Fri, 29 Sep 2023 12:23:09 -0500 David Lechner wrote: > From: David Lechner > > From: David Lechner > > This adds a check to the return value of ad2s1210_initial() since it > can fail. The call is also moved before devm_iio_device_register() so > that we don't have to unregister the device if it fails. > > Signed-off-by: David Lechner Applied > --- > > v3 changes: > * This is a new patch split out from "staging: iio: resolver: ad2s1210: > fix probe" > > drivers/staging/iio/resolver/ad2s1210.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c > index 8fde08887f7f..b5e071d7c5fd 100644 > --- a/drivers/staging/iio/resolver/ad2s1210.c > +++ b/drivers/staging/iio/resolver/ad2s1210.c > @@ -672,6 +672,10 @@ static int ad2s1210_probe(struct spi_device *spi) > if (ret < 0) > return ret; > > + ret = ad2s1210_initial(st); > + if (ret < 0) > + return ret; > + > indio_dev->info = &ad2s1210_info; > indio_dev->modes = INDIO_DIRECT_MODE; > indio_dev->channels = ad2s1210_channels; > @@ -683,7 +687,6 @@ static int ad2s1210_probe(struct spi_device *spi) > return ret; > > st->fclkin = spi->max_speed_hz; > - ad2s1210_initial(st); > > return 0; > } >