Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1157596rdh; Fri, 27 Oct 2023 06:26:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7UISSQqnqW/3X+ALN5IANRiSTnQMCzjwM0cqc8m8kbn61TuplXJ/39Mb0ka5VzbMRN4j9 X-Received: by 2002:a25:b102:0:b0:d9b:d61d:690a with SMTP id g2-20020a25b102000000b00d9bd61d690amr2373357ybj.11.1698413214410; Fri, 27 Oct 2023 06:26:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698413214; cv=none; d=google.com; s=arc-20160816; b=PFpCa4iuW2PNl2KDS0Q85QpNS06pZydCQZERSfTjcIltbC9kaP+td9hH7aFqP85bOv 91HodLqSWV0M0FpI7FPpuzq8vXfqKvx1BZ4CKcazaCLAgS9KVtTEYtHoTFq5iQYE4vC+ XpI56rbwMq8aqG7kpWWAy4TUEnIQdQCqECdynBm6ptA6iW0R3sYjmcIps0xHIhmudjtw lmi65EHMpii0z0/n3NkKkFzoVOvLCzy9M6IwuObju0qIUVTVCz7S3/Kwcv9o3AcZngtA X8M3aj3YB5FpEyUlrLKSkVoNjl55ZbGBavxBxasEV1R53j5keM7yHhUTEog5G2fO/AMW 2d0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=oabVXIqAFRE28Y1GetyAqB2wgEQ9sRGP2wmSIEmAq20=; fh=111CBTJeu2oEUVf8xD/FZ92jE/S9AsLF/EXvojbzwPE=; b=pohr0Z2VAsnYpgiIxhP9MadBMpjVXyaPUBm+8UwGZ4rpH3B1tWrMNJt6oP4NkcynKz vZv/BFmisjlVWSrPCfekvI0JKk+B0umUIBimQ6jE+IENYL7A8qyBZRlqw3NjCoPBDhOx HryawzbnPQDPAv6NotnIg743z9Hhk1QtaQPwPlIFxOluGDEuW8XijUNyumA+2ApkA2Cg pmfX54e+dhWEiqry1etJlsDpk0eq3IJdHkr9iaT9wiK+Lc+8RnkAidGPmwJ2eTX8+aKI cpHgpCuM+hVR9ptyjc1/RcJVQDoKDLBebVk8OHLOFEniyVgo55E24uW1I+M80raUijV/ Qv1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m7b2Oyd9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id i30-20020a25b21e000000b00d8942d8d1a5si2857290ybj.247.2023.10.27.06.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 06:26:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m7b2Oyd9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D29B783CF934; Fri, 27 Oct 2023 06:26:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345882AbjJ0N0i (ORCPT + 99 others); Fri, 27 Oct 2023 09:26:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345458AbjJ0N0g (ORCPT ); Fri, 27 Oct 2023 09:26:36 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DEEFE5; Fri, 27 Oct 2023 06:26:34 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71ED5C433C7; Fri, 27 Oct 2023 13:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698413194; bh=NxFd9nO3ucmlh23SRQn9ZpC46HILj4aPbNXF73EekQo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=m7b2Oyd9zhPJtcjMUZofdXh2MMnITOJlLsMsFBdBxY4mhu4WPX8wELATU36R22R8p iWPIOsH9G7S6Jr9nQ6fTS57qXLHvvvp195gx1oFnx7lrdwHeViDBSWu8nQ9SJ1Cmsh v+3l9vQMLKADLk0sYfap6YFrdeU5wFZI41QZs9KW2yk9/d79KQHZ8W58pccMasBcag iAEYrMDoSTd6pIAbtimJspKgE8mJC7wDPqIy/Spx/9ZXGbBzVNpWW6RCxdPE1jLFyQ u0JxB2PHNF1c9tAmAVg9HPrXpHdX6gl5Rnp1dH54do4V/8OYz/UY0o8pNw0Un4R4ex RRBDrxHnQeoAg== Date: Fri, 27 Oct 2023 14:26:18 +0100 From: Jonathan Cameron To: Jishnu Prakash Cc: , , , , , , , , , , , , , Lars-Peter Clausen , "Bjorn Andersson" , Konrad Dybcio , Arnd Bergmann , Cosmin Tanislav , "Mike Looijmans" , Ramona Bolboaca , ChiYuan Huang , "Ibrahim Tilki" , William Breathitt Gray , Lee Jones , Leonard =?UTF-8?B?R8O2aHJz?= , Haibo Chen , , , Subject: Re: [PATCH 07/11] iio: adc: Add support for QCOM PMIC5 Gen3 ADC Message-ID: <20231027142512.37358c60@jic23-huawei> In-Reply-To: <13d5dee2-1da4-2ad0-91f8-a53b43adba2b@quicinc.com> References: <20230708072835.3035398-1-quic_jprakash@quicinc.com> <20230708072835.3035398-8-quic_jprakash@quicinc.com> <20230708165955.08c1159c@jic23-huawei> <13d5dee2-1da4-2ad0-91f8-a53b43adba2b@quicinc.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 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 27 Oct 2023 06:26:51 -0700 (PDT) > > + > >> +static const struct iio_info adc5_gen3_info = { > >> + .read_raw = adc5_gen3_read_raw, > >> + .fwnode_xlate = adc5_gen3_fwnode_xlate, > >> +}; > > ... > > > Did you mean to leave any comment here...? Nope ... is a cut mark to indicate I dropped a load of quoted text. On that note, don't bother replying to say you'll do things suggested by reviewers - we assume you will unless you say otherwise :) If you want to add a boilerplate message alongside comments on the bits that need further discussion, along the lines of "All other comments accepted." That's fine but it's not really necessary. ... > >> + > >> +static int adc5_gen3_exit(struct platform_device *pdev) > >> +{ > > As you are mixing devm manged cleanup and the explicit sort the > > result is that you remove the userspace interfaces 'after' you run > > everything in here. I'm thinking disabling the channels at least > > isn't a good idea in that case. > > > > If you want to use devm (which is good) then you need to work out how > > to register additional callbacks during probe to tear down everything in > > the right order (typically the reverse of what happens in probe) > > devm_add_action_or_reset() is the way to add those extra callbacks. > > > > If not, just don't use devm for at least those bits that will end up > > running out of order (such as iio_device_register()) and manually call their > > cleanup routines instead. > > > I checked some other examples in the iio/adc/ folder, I think I see what > you mean here. It looks like drivers with a remove callback always use > iio_device_register and iio_device_unregister instead of the devm_* > variant, due to the issue with sysfs removal as you said. > > I'll update the probe and remove functions similarly, to do explicit > cleanups as required, avoiding devm_ usage for places where it should be > avoided. Better to go the other way as Dmitry suggested. Make everything you can devm managed.