Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp508634pxb; Fri, 3 Sep 2021 07:05:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4/LK6ZpAKxFEQtJ0+i9omMCv9lPvBAPQeynB7ReVmUzNiTWPM66CrkMrfMmvPQIhnse1w X-Received: by 2002:a50:ed06:: with SMTP id j6mr4225791eds.148.1630677902608; Fri, 03 Sep 2021 07:05:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630677902; cv=none; d=google.com; s=arc-20160816; b=TrAgTrRz1lAAlFmnhHncKbmAW9Rginyn0VEAFARC29uy8iwmj2ZaCXbrB837qJmE0V MRPO3HzDmXk2sztwol9l/+bo8hlZWJoyjDkda6HueRQU+M0FkTvHR/CgWK5zlyQOgcMi mUbC93VFQsZNkv/pIn7yYO4jVZiZIkTiDk0+EhALU0skqmwL9dz2+PSLxDDhTXLi1GPr vWxInXlhTMbK6Gl5OWsJ9VjVWMmoBIvJso6muRQfryn9v/MWzUyf0/itOKEwOY3WYmxF 10OOTMD3mocRAxd9cLkFp/0IPBc2CxVZbbvJZ6n5na05i20n88CGY4YIBOSf5jy7W+cK LQig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Q2X4nwUe8mYHMGoeC9p2a/q4AU1Of4/9r5BuWQNLjMM=; b=NWVe0wQn8mmj6XvDH8xgrcVqTCORKIhrg1OhU/4WQC676IaSe05yXU79V7OLD3G78O +4E0CSj/nV/2c0krZiKsv+roexTAWP6snvAChvAzK3X6BjNsFmqe3GxSaWV4CLItr19l nlSSoMed4aeQa4jS3Eqqt5Jlc28f9Ixl59GDS+shdhABEgwrY+cIbE8rSvIWaMaVvZHn +A99ZKIXMdED8ekfk9C3ZzlX0gT0xcIoCTVniefSLfcuROeV5pi46FCXyVAdgi+u9wlA DszjVRV8WKNY/3IfElp8jIpUn3JIfJSQenv2QJZ1j5x2h2ttaMkUdCx65NpOAfheH3pS XLeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=WVAQwR5n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j21si5326345edr.537.2021.09.03.07.04.37; Fri, 03 Sep 2021 07:05:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=WVAQwR5n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347669AbhICN5z (ORCPT + 99 others); Fri, 3 Sep 2021 09:57:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348354AbhICN5z (ORCPT ); Fri, 3 Sep 2021 09:57:55 -0400 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49F93C061575 for ; Fri, 3 Sep 2021 06:56:55 -0700 (PDT) Received: by mail-qk1-x736.google.com with SMTP id 22so5826810qkg.2 for ; Fri, 03 Sep 2021 06:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=deviqon.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Q2X4nwUe8mYHMGoeC9p2a/q4AU1Of4/9r5BuWQNLjMM=; b=WVAQwR5nQjRZNGqJMfwXUR1CgAKXImetNQpTcRffgVKyuNhp4CqS6CcfJb5oOyyUqM lMk+NYKA/9dy3Dy24t45MQYP9OdrQea19rhqf5/FXgTgYaLudrP9ONH/C+JINlBV1Bzt ZeIsGXgfO2yr1RdRl3xgOwS0Nko4o4LrQ5NY+nvdbpS7hopwqVu9zdDp+sxv7RtxAWGX Q0G+2Z4NflRQ/Lf5ygv7mivjv9SMCIBYU9DihXFGEOzWaK+saPVafHjDW/7YVfhyUpIa v9e6EAV0BBS1OA0l8IXSCR14fta3o1MMdSowpEQt8Ux5cb21M7s28b8JvoTdIBubTUkN 1PIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Q2X4nwUe8mYHMGoeC9p2a/q4AU1Of4/9r5BuWQNLjMM=; b=Guvf+vizcYl9SExrTdtiiBajmJkp7zx1o8hEe/9E3mGaccJDC7/OLIGxPka/e/OYbR mqqxh9ollBJAGZ5KK3QcAZ/8ocnHJCek8YIvF50t/7eFhQYKTojCjhr60xAzU6FeEDPE LZ/+onOOcT7yl/lzWCCSFcdXYi689/ra1oTA4AjnOJynmded7hydNi2QtXqc4m393f+E 2yRuqa8gVG22bOvnwtaUwqLIRkB5zW5Rc/e5wCoVf8Hu+/uziCB/SC0QEKazAFfOFfqd EoZc0i+PclGtMGfgsSrp6J35sTAGPLbwf0yp6N4RV4G9KNMesqPTslL2MNo+0zx8eQBz OK6g== X-Gm-Message-State: AOAM531uNZyPwq31rm16v/y1YRSvvbpYqMQYSxwJhSKAw948NxWVt3qP 2vCVIxfFADDtI/VaR4Pm+bFLOmUKjWZoCWUMcQTy/06a99p3SQ== X-Received: by 2002:a37:ab0d:: with SMTP id u13mr783559qke.521.1630677414467; Fri, 03 Sep 2021 06:56:54 -0700 (PDT) MIME-Version: 1.0 References: <20210903072917.45769-1-aardelean@deviqon.com> <20210903072917.45769-2-aardelean@deviqon.com> In-Reply-To: From: Alexandru Ardelean Date: Fri, 3 Sep 2021 16:56:43 +0300 Message-ID: Subject: Re: [PATCH 1/5] iio: inkern: introduce devm_iio_map_array_register() short-hand function To: Andy Shevchenko Cc: linux-iio , Linux Kernel Mailing List , linux-doc@vger.kernel.org, Jonathan Cameron , hdegoede@redhat.com, wens@csie.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 3 Sept 2021 at 16:40, Andy Shevchenko wrote: > > On Fri, Sep 03, 2021 at 10:29:13AM +0300, Alexandru Ardelean wrote: > > This change introduces a device-managed variant to the > > iio_map_array_register() function. It's a simple implementation of calling > > iio_map_array_register() and registering a callback to > > iio_map_array_unregister() with the devm_add_action_or_reset(). > > > > The function uses an explicit 'dev' parameter to bind the unwinding to. It > > could have been implemented to implicitly use the parent of the IIO device, > > however it shouldn't be too expensive to callers to just specify to which > > device object to bind this unwind call. > > It would make the API a bit more flexible. > > AFAIU this dev pointer is kinda discussable thing. What scenario do you expect > (have in mind) when it shouldn't use parent? So, this brings me back to an older discussion about devm_ when I thought about making some devm_ function that implicitly takes uses the parent of the IIO device. Jonathan mentioned that if we go that route, maybe we should prefix it with iiom_ . But we weren't sure at the time if that makes sense. The idea was to bind the management of the unwinding to either the parent of the IIO device, or the IIO device itself (indio_dev->dev). We kind of concluded that it may probably not be a good to hide anything and make standard a devm_ function with an explicit 'dev' object parameter. I found a recent mention here (while searching for iiom_ on linux-iio): https://lore.kernel.org/linux-iio/20210313192150.74c0a91b@archlinux/ > > -- > With Best Regards, > Andy Shevchenko > >