Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp221677imu; Tue, 27 Nov 2018 11:21:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/VX+i+Mqi9lQjXBSe9e/PJ/svgMq23T1+01VY0nyAoQfvwgJ98R4fq2otgb5WGJPRFqzFIj X-Received: by 2002:a17:902:b282:: with SMTP id u2mr34089191plr.89.1543346514993; Tue, 27 Nov 2018 11:21:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543346514; cv=none; d=google.com; s=arc-20160816; b=mxWqHcPU/5v3s2CksjVnrR07MQ20M5wZhpGrXg0naLQ8NWAjJT4N7qnih23M/AGkz6 /kI2I0FLeKxINoaWocAMACwyXF4dzFOzpHV5gkq93XDFRIzI5ldvDrFY4eH5LePTAOhi uICoeWLMmfQPjSgqdI/OHWXKzvD6NkJ3uqW/ad+T5FWbic70SBoPAqFi7E97HxLmZe16 Y2f9K46v/CWrfazXOViiCWD+pLPh1igpGALt9l2ZqLmCMmQFNOs4f/wNpC7aTIxdRkPO DT563SqOG5TexXeHYsmD77GuK3TKZy2ViOq0kO/wRWGU0AvetjvDJNuDOzMfvKesChHF DzmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=AJ3G8ZHnffCLd/JQmmILwA0IFDOiwrL2S1p6OX/hEbw=; b=Y186OBwRW/oTdgz1C1m9i69Ezctg4F8KYc+K93zjWxtvdIcFu7B0ooBwdF+XQhvEZ9 2Qj4MIrVVg1XU5zXpitgJmWKiP4jUtIcXtJR739MGahIvzKzdMO+cM1YZFPIy4NuWm1z boB1xGc2oQqSBPDlgmmWzMVE64d3TDvBuLIJFeYrmyfs9Xi7fE5gbwlRIbCXQljCgqeI prphX/lzMVz/ecDiMcZs6riAAdG4eiDiGD3rOhKmY75SKJFtdIYvp1Hb6Tth3THPBp56 UCHQ5xyMPa1lSJl7BDLjFFWUICfdgEqdoKCMG+pyOmogdCQ/n3GI90ofsgkehNAfpJ/E yHEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=F5nA28qT; 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=fail (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 v83si5073623pfk.264.2018.11.27.11.21.37; Tue, 27 Nov 2018 11:21:54 -0800 (PST) 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=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=F5nA28qT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727255AbeK1A2h (ORCPT + 99 others); Tue, 27 Nov 2018 19:28:37 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:44456 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726767AbeK1A2h (ORCPT ); Tue, 27 Nov 2018 19:28:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=AJ3G8ZHnffCLd/JQmmILwA0IFDOiwrL2S1p6OX/hEbw=; b=F5nA28qT5ByP95g8EcHainNre gMqOjvcjtfMKSkqwNBozFfn3U6MtYoCIYjC7vrSd4AFXO0q5ywjqYOm0Q5xaJB+KTShglxvZM1upE 5XoF/C8cWNFSvOghBfke2mGGCJ3ZKyUrHcKK3I+yfHsrqthz9BxM1HI8R1rAPuJo9kazU=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1gRdRi-0000Ho-Jy; Tue, 27 Nov 2018 13:30:34 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id D75801125056; Tue, 27 Nov 2018 13:30:33 +0000 (GMT) Date: Tue, 27 Nov 2018 13:30:33 +0000 From: Mark Brown To: Linus Walleij Cc: Charles Keepax , Liam Girdwood , Marek Szyprowski , "linux-kernel@vger.kernel.org" , patches@opensource.cirrus.com Subject: Re: [PATCH 3/3] gpio: Add reference counting for non-exclusive GPIOs Message-ID: <20181127133033.GC3206@sirena.org.uk> References: <20181122173015.23905-1-ckeepax@opensource.cirrus.com> <20181122173015.23905-3-ckeepax@opensource.cirrus.com> <20181123105729.GM16508@imbe.wolfsonmicro.main> <20181123132522.GE2089@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eHhjakXzOLJAF9wJ" Content-Disposition: inline In-Reply-To: X-Cookie: This end up. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --eHhjakXzOLJAF9wJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Nov 26, 2018 at 10:53:40PM +0100, Linus Walleij wrote: > The managed resources pretty much assume > that you tie resources to the device model and let kref inside the > kobject in struct device do all refcounting and that essentially > collides with the refcounting inside the regulator core, they both > want to control this now. If a driver is handing ownership of an object over to something else then devm is always unsuitable. > I suspect maybe the lesser evil is to bite the bullet, invent > gpiod_get_from_of_node() which is the missing API (we currently > only have devm_gpiod_get_from_of_node()) and simply > fix up the converted regulator drivers to avoid devm_* > retrieveal in the same manner as wm8994 (the already > queued patch). This will make the regulator core own the > refcounting as it does today. You're always going to need unmanaged versions of functions for use with things like this I think. --eHhjakXzOLJAF9wJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlv9RvkACgkQJNaLcl1U h9CxQQf/ctY7AoS1CbYfXUlQZE7L/vhPX1/ZrjPHwFaAXIqt7DILnrLN0UVLUT9+ Y2yqj2M4a6MVv9cgUBKYjyGtJF2afHrvWj7oV4ec6LvOzHKvYvYYZRpDf/cebWRf qbRJLz5JY75lofTTq5fP88XVkbMixXcTv1dfplHwk/+UnrYLR7+JxjxdMGnoMKmS 3QiiCZeyqFedyrO4FNMnEk4G3SDR3DfLuKLj926nvGdPalwT+vNibqWWjgHSTzgC dVzk8WOrwsysBhMtywVNwS0yni6w9JxjJQZj99zWJ5Tgz5Dn8McgJtP+0V7zrXW9 Tr9/+FAta3GKRD9l6n5NMRLE1C5ciA== =0TVT -----END PGP SIGNATURE----- --eHhjakXzOLJAF9wJ--