Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp122912imj; Wed, 13 Feb 2019 05:47:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ915/ZQW/snbHzAvK0+sivK7pe0pU1DCVhkA2sKNTBnVpZnIS4VUfcTmtf85Lpd1I52nJw X-Received: by 2002:a63:5207:: with SMTP id g7mr540071pgb.253.1550065629813; Wed, 13 Feb 2019 05:47:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550065629; cv=none; d=google.com; s=arc-20160816; b=IJLXDK13TLySGM8V08u3Yddg3hWsBjK3tVfqACxhgsTr/qpk18HTcGa6GkDWfwzrbe ucu4y1SIKLfPGy6HkyFHpfjBVfvr3YHasKO9aCK59wiu2mQyA/Nkf7FxXNpstcLfI0W7 cCnDGRhJVLNs13Tg0c50kQHocXvQ2tlElNoV/hKMCSkWfrhQUnkunn/TbMpqU1gYunF3 3MfFt1wy7ZeJBLKsJCoGtc685D1ce+UsQZP3s6PxBL3gnoq/HU2exWk/xgHRxtR+PbIa DVtiH4UXz7WwViSCDCn/SgYTGmtbLHQ0rcbZj7MR/Ns5xOHrr1v09pP3DuCUupeKj1iX cPrg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=0C7K0eAFzTojaCE9tmgScTwK0uLdVczd+Uix0NoCjso=; b=YPciXTSP8SMhy6em/5K5VDik/pIt72Vq7HxV8mghGNSdYWfSFU5y+6ToXr0IXMcLtl 18SHp71KKuN3ZW0neaBHPWbAyhfR/LFFv9YDurmF08bsOY6QuRkluFyzAyFK15UejiYy jXFm1L8gzHwQ5OJQY/OjZg0o9HRkwL9QBU+B4N2LseWH/4xJ9g852lH43D7FGrkLuptM /NU5JpetId97Pm37vwC9LH3Mi8IBVmPEagyEfBycdBNYlp9OBTnI/cz3GnCahlljDThy C9SCh3PRpOwD5MZYTPnc4ORJe390gALVO9ZTafd+96tYoeb0vvdwAVQ0F+JqNowm2drJ SEuw== 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 a17si16186670pfn.213.2019.02.13.05.46.53; Wed, 13 Feb 2019 05:47:09 -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 S2388915AbfBMKw0 (ORCPT + 99 others); Wed, 13 Feb 2019 05:52:26 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:24171 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729685AbfBMKwZ (ORCPT ); Wed, 13 Feb 2019 05:52:25 -0500 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1DAg5d6024997; Wed, 13 Feb 2019 11:51:48 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2qhv0m6nkc-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 13 Feb 2019 11:51:47 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 85E553D; Wed, 13 Feb 2019 10:51:46 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5F67C4EE6; Wed, 13 Feb 2019 10:51:46 +0000 (GMT) Received: from [10.48.0.167] (10.75.127.51) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 13 Feb 2019 11:51:45 +0100 Subject: Re: [PATCH v2 3/3] pwm: core: add consumer device link To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= CC: , , , , , , , , , , 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> <20190212090304.3j4iqj6sodtdvhr7@pengutronix.de> From: Fabrice Gasnier Message-ID: <72cab2a3-976a-44c6-5596-fd4e443ff2e8@st.com> Date: Wed, 13 Feb 2019 11:51:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190212090304.3j4iqj6sodtdvhr7@pengutronix.de> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG4NODE1.st.com (10.75.127.10) To SFHDAG5NODE3.st.com (10.75.127.15) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-13_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/12/19 10:03 AM, Uwe Kleine-König wrote: > 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. Hello Uwe, I just sent a v3 with that change, Thanks Fabrice > > Best regards > Uwe >