Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2824693imu; Thu, 29 Nov 2018 10:49:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/WTJPYyoBOpgEjQMIWUVrqqgypluMSOsEYu0dvm5/TJV8k6u3oqFcgoGMgvtTtimg6duYzp X-Received: by 2002:a63:61c8:: with SMTP id v191mr2227298pgb.242.1543517352982; Thu, 29 Nov 2018 10:49:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543517352; cv=none; d=google.com; s=arc-20160816; b=qmA3meLOZmsZvoS01Z7+3BCuLixGuNFpwJlIEzdn0rYZi6/DSr+DVsDw9RUCotseqp ejA/WS7ZnJyl/UXvA/D19Si56U8tPCRmdGwUuUfBIXUy5kqNng2IuqPWc9OKtMAylh06 cvX+3el0S5bP4bAPoq3pVP3T7pMvBApqnEkvKucaT91bb5l5TcvqfdJwtjmu6Db7/zkL SgSyqHURVxQinsIRx4najWxawW5g0cGa+d4/eV8lp6iCk2d9mhJGrTC44wNw3NxX1RJ5 IJ8ABMEdcJLzXRPMJ5vWGrCvP2tjJTEKW84661d8jgYeWXYnFe7au6DJjCIcAUW+0LZP LTVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=3o/XV/7Qgfz2I/5HYzE6SUWlIujyWkkEJZU7j4BGDX8=; b=UXrgPKZqZ4bWncOp9+cGOg6pgDmmvw8izq43ZseI2+5lheBdKI+ukYm2esf1YGwR6q dH7ppprAAczxkcPD5dIDqhHIrKHmTUHxwsH2cHchFxV/C/Lh+IudNpFSjCT46XvKzUK1 d5wfg3CbN4CZxIx1EikqIkUqMkqY9Rv8Jz2x5bnDbpR7USCVHDYrrWDIVWgHvIYDtueM J56v5+NRQ3aQuNCJQoemu0the0ZnYF/Ugm9a9GEEAMb1Uv9gzXSPlPoGGZDGPIzryvtB 4BlsEqF9G0QQVgLYxUJq5kqvd8eRL3olxE3nhvj1nGwCKIYT1uNIBWt1HvL3Migf1iUs pA0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=qgZTqvqK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13si2201244pgi.531.2018.11.29.10.48.57; Thu, 29 Nov 2018 10:49:12 -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=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=qgZTqvqK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727589AbeK3Fow (ORCPT + 99 others); Fri, 30 Nov 2018 00:44:52 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:45771 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727388AbeK3Fov (ORCPT ); Fri, 30 Nov 2018 00:44:51 -0500 Received: by mail-oi1-f196.google.com with SMTP id b141so2481887oii.12 for ; Thu, 29 Nov 2018 10:38:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=3o/XV/7Qgfz2I/5HYzE6SUWlIujyWkkEJZU7j4BGDX8=; b=qgZTqvqKHID23mlYFPSrATE3lAjZ8t9ENyxnn8QFjaeLLjbYQoINA6aboERYwaYPng E8SmP+rOPkumPOVtA3KRouVCAni9kFsz7ezP/EPB/A7rgZOa1udAFkvxp4AE4FTLWcQB fD1aNSHlPJ2h2h8miuzSL84jdE7A/B02c1OqTyQ2a6vEguzGJJB3U63Dy6auqqVBS5oI H1ZDjzUmv9F8h++6g/C/E4DOZB+65aWrMFjrBKgU7o1QMTkxBXRL+zfpCYCVTXFMKMm8 GpT/x/VocALpYGElUcLpmmirpO0yMozolQvKNbh04SkZ74F5NE5caTgJk53avdl36PqY 64Mw== 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:content-transfer-encoding; bh=3o/XV/7Qgfz2I/5HYzE6SUWlIujyWkkEJZU7j4BGDX8=; b=JJg48cECF9915OvGnVXSr1itSseEKlYNyxh0MVF0IpcrN5XAcsUA1uqYGcHDuUpEOr EREn/eHttNBPIUtvIz1cb/K/kghOUQuFJpiz17CpCUNqxTLwom2LD48kkpXNRW7Aj3bd FBSBrMgcAw9C/eqiCDOUyxd/F8dCebnzNxwvkIu8SUB2NPBd0Z3J97CA8+aBO4m1ixwc CfT7Q/0qZ/WfR/2JUcJBa+ux81iiTiiqRwUvat711S5W8H6wgONx/8XpEYkQk//+VVjg 96JFfwgpc/tsoRTB8JCPQokZcMBX2aYSg+9MTgIUA2f6iS8q2eQsno2gXMmHDKICEYmG Qt1g== X-Gm-Message-State: AA+aEWb7lJli26p8N+yKPmmZtFTvLJwbIV8lYJYwk74imKBW09QozGMi fsusTqV39EdDT7OACQqW+Q/l6b0kA2CONZb7y0kT5A== X-Received: by 2002:aca:3785:: with SMTP id e127-v6mr1563478oia.147.1543516712174; Thu, 29 Nov 2018 10:38:32 -0800 (PST) MIME-Version: 1.0 References: <20181128104350.31902-1-linus.walleij@linaro.org> In-Reply-To: <20181128104350.31902-1-linus.walleij@linaro.org> From: Bartosz Golaszewski Date: Thu, 29 Nov 2018 19:38:20 +0100 Message-ID: Subject: Re: [PATCH 00/10] Regulator ena_gpiod fixups To: Linus Walleij Cc: Liam Girdwood , Mark Brown , LKML , ckeepax@opensource.cirrus.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org =C5=9Br., 28 lis 2018 o 11:43 Linus Walleij napi= sa=C5=82(a): > > We noticed a refcounting fight between the kernel device > core devm_* and the regulator core refcounting, pertaining > to enable GPIOd:s that may be shared between multiple > regulators. > > Fix this with a series that hand it all over to the > regulator core and remove any devm_* stuff pertaining > to these GPIOs. > > This includes a patch to gpiolib to make gpiod_get_from_node() > available. Just go ahead and apply this to the regulator > tree. > > If these need to go for fixes or not is up to the > regulator maintainer, but all commits have a proper > Fixes: tag in case they would. I have noted in the > four last commits that the gpiolib patch is a > prerequisite. > > Linus Walleij (10): > regulator: fixed: Let core handle GPIO descriptor > regulator: lm363x: Let core handle GPIO descriptor > regulator: lp8788-ldo: Let core handle GPIO descriptor > regulator: max8952: Let core handle GPIO descriptor > regulator: max8973: Let core handle GPIO descriptor > gpio: Export gpiod_get_from_of_node() > regulator: da9211: Let core handle GPIO descriptors > regulator: max77686: Let core handle GPIO descriptor > regulator: s5m8767: Let core handle GPIO descriptors > regulator: tps65090: Let core handle GPIO descriptors > > drivers/gpio/gpiolib.h | 6 ----- > drivers/regulator/da9211-regulator.c | 4 +-- > drivers/regulator/fixed.c | 4 ++- > drivers/regulator/lm363x-regulator.c | 8 ++++-- > drivers/regulator/lp8788-ldo.c | 4 ++- > drivers/regulator/max77686-regulator.c | 3 +-- > drivers/regulator/max8952.c | 8 +++--- > drivers/regulator/max8973-regulator.c | 12 ++++++--- > drivers/regulator/s5m8767.c | 37 ++++++++++++++++++-------- > drivers/regulator/tps65090-regulator.c | 10 +++---- > include/linux/gpio/consumer.h | 13 +++++++++ > 11 files changed, 72 insertions(+), 37 deletions(-) > > -- > 2.19.1 > I'm wondering if instead of using the non-devm variants of gpiod_get_*() routines, we shouldn't provide helpers in the regulator framework that would be named accordingly, for example: regulator_gpiod_get_optional() etc. even if all they do is call the relevant gpiolib function. Those helpers could then be documented as passing the control over GPIO lines over to the regulator subsystem. The reason for that is that most driver developers will automatically use devm functions whenever available and having a single non-devm function without any comment used in a driver normally using devres looks like a bug. Expect people sending "fixes" in a couple months. Bart