Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3590467imj; Tue, 12 Feb 2019 01:04:23 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ4pSzQQXS9cEArbkuOrz1prsLTI0PPfe9SjVDUWVC1diMY7GeOPGgvaLbUC2MUr3Lwi4B5 X-Received: by 2002:a62:1212:: with SMTP id a18mr2969763pfj.217.1549962263832; Tue, 12 Feb 2019 01:04:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549962263; cv=none; d=google.com; s=arc-20160816; b=A2nWIHaTFi0lLbi1nnnBr2AJwjZZ01QKTnpiNGIR70XdUQVOOof+fb6n+vqXBPCnhX 5+gYzaZZv8NDEbWju1nl23Pb4PhiNBa4F0Mu7G13bqZxTidJ+bAl1GnFx4NhbfYo5x8h dy3B28TjifrbYAYTLPheJk8JxTqh9XrwQndN5iNB58Xb4aKkPKEFtUIaFRleh5j37kjb czo1z9XNGQGpWyxqtX6o5SIU0P5FQnuWHMvAX8OO8t3HQI06yRSwYB136TkXpKWRC0sx T4jMdTG7faXW1TvRT9JGmgOdlpntprW0o1mdstLG0a9gkZLJKGRkNmWI8AA69xSaUrda nRCg== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=5szVxZbTtUJEdisLMoEOdYYzjZ1WUwhBUHr70nc0+gI=; b=i40963K1EtS4R8wnKc7lcwoBRIxpqx1P2RntTCPOsZ5srCmHBe9DxDhnuyTZ2Qi456 wXA6W3AEhHgaLIfwO7aCddPDaff+N4hglqPQ244osZpkoZZiLxHw7BKgRVuD8WMNyvIv t2mVTLn89pcvW4Y2sdwOfFGw7AjayMt8YRWgZMO33+3YsERz/KzggavWuhQnZm1ww9f2 tyuEu/oKFqRu28nVD2oJOcDuuDtnF78ef29Hhpq7Ieo/DQ/NfiVWYZMGxYY87NnRDGVY RppLMd6rsayYbK0bzmV3ntRfihqpDB0SW2Zu4b4gquWcj6ADhgO1vPx88CgqG1SgyDnS 3P1A== ARC-Authentication-Results: i=1; mx.google.com; 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 r18si12514935pls.115.2019.02.12.01.04.07; Tue, 12 Feb 2019 01:04:23 -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; 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 S1728663AbfBLJDO (ORCPT + 99 others); Tue, 12 Feb 2019 04:03:14 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:45433 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728086AbfBLJDN (ORCPT ); Tue, 12 Feb 2019 04:03:13 -0500 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gtTy6-0005hT-DZ; Tue, 12 Feb 2019 10:03:06 +0100 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1gtTy4-0001GE-Kh; Tue, 12 Feb 2019 10:03:04 +0100 Date: Tue, 12 Feb 2019 10:03:04 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Fabrice Gasnier Cc: thierry.reding@gmail.com, robh+dt@kernel.org, tduszyns@gmail.com, mark.rutland@arm.com, alexandre.torgue@st.com, mcoquelin.stm32@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: Re: [PATCH v2 3/3] pwm: core: add consumer device link Message-ID: <20190212090304.3j4iqj6sodtdvhr7@pengutronix.de> References: <1549901522-15071-1-git-send-email-fabrice.gasnier@st.com> <1549901522-15071-4-git-send-email-fabrice.gasnier@st.com> <20190211190628.eisyi6wjus4ltrrn@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Fabrice, On Tue, Feb 12, 2019 at 09:31:37AM +0100, Fabrice Gasnier wrote: > On 2/11/19 8:06 PM, Uwe Kleine-K?nig wrote: > > On Mon, Feb 11, 2019 at 05:12:02PM +0100, Fabrice Gasnier wrote: > >> @@ -943,6 +950,8 @@ struct pwm_device *devm_of_pwm_get(struct device *dev, struct device_node *np, > >> if (!IS_ERR(pwm)) { > >> *ptr = pwm; > >> devres_add(dev, ptr); > >> + device_link_add(dev, pwm->chip->dev, > >> + DL_FLAG_AUTOREMOVE_CONSUMER); > > > > IMHO it's surprising that devm_of_pwm_get() does more than of_pwm_get() > > + devres stuff. I'd put device_link_add() into of_pwm_get(). > > Hi Uwe, > > I also agree with this. But I think this implies modifying the API for > of_pwm_get(): > /** > * of_pwm_get() - request a PWM via the PWM framework > + * @dev: device for PWM consumer > * @np: device node to get the PWM from > * @con_id: consumer name > > It seems there aren't much of_pwm_get() users currently. > Does this look sensible ? In my eyes this looks sensible, yes. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |