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 X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D92FDC63777 for ; Mon, 30 Nov 2020 16:17:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 726FC206D5 for ; Mon, 30 Nov 2020 16:17:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728077AbgK3QRJ (ORCPT ); Mon, 30 Nov 2020 11:17:09 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2179 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726770AbgK3QRI (ORCPT ); Mon, 30 Nov 2020 11:17:08 -0500 Received: from fraeml703-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Cl9Kc4bb5z67KjR; Tue, 1 Dec 2020 00:14:28 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml703-chm.china.huawei.com (10.206.15.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Mon, 30 Nov 2020 17:16:21 +0100 Received: from localhost (10.47.30.241) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Mon, 30 Nov 2020 16:16:20 +0000 Date: Mon, 30 Nov 2020 16:16:00 +0000 From: Jonathan Cameron To: Bartosz Golaszewski CC: Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , Michal Simek , linux-iio , "Bartosz Golaszewski" , Linux Kernel Mailing List , Linux ARM Subject: Re: [PATH v3 3/3] iio: adc: xilinx: use more devres helpers and remove remove() Message-ID: <20201130161600.00000d66@Huawei.com> In-Reply-To: References: <20201130142759.28216-1-brgl@bgdev.pl> <20201130142759.28216-4-brgl@bgdev.pl> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.30.241] X-ClientProxiedBy: lhreml715-chm.china.huawei.com (10.201.108.66) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Nov 2020 15:30:22 +0100 Bartosz Golaszewski wrote: > On Mon, Nov 30, 2020 at 3:28 PM Bartosz Golaszewski wrote: > > > > From: Bartosz Golaszewski > > > > In order to simplify resource management and error paths in probe() and > > entirely drop the remove() callback - use devres helpers wherever > > possible. Define devm actions for cancelling the delayed work and > > disabling the clock. > > > > Signed-off-by: Bartosz Golaszewski > > --- > > [snip] > > > > > /* Set thresholds to min/max */ > > for (i = 0; i < 16; i++) { > > @@ -1334,59 +1353,23 @@ static int xadc_probe(struct platform_device *pdev) > > ret = xadc_write_adc_reg(xadc, XADC_REG_THRESHOLD(i), > > xadc->threshold[i]); > > if (ret) > > - goto err_free_irq; > > + return ret; > > } > > > > /* Go to non-buffered mode */ > > xadc_postdisable(indio_dev); > > > > - ret = iio_device_register(indio_dev); > > + ret = devm_iio_device_register(dev, indio_dev); > > if (ret) > > - goto err_free_irq; > > + return ret; > > > > platform_set_drvdata(pdev, indio_dev); > > > > Cr*p I was supposed to drop this line... > > Jonathan: can you drop it when applying? Sure. J > > Bartosz > > [snip] > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel