Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp871714ybx; Thu, 7 Nov 2019 03:59:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwFZnCXWlX9Ray/9NhKhW+hgT7WE2BKjc0h6DLn53O5fJcb03d2pnHE0a0rfIvKDbne1+Td X-Received: by 2002:a17:906:2921:: with SMTP id v1mr2570438ejd.236.1573127977990; Thu, 07 Nov 2019 03:59:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573127977; cv=none; d=google.com; s=arc-20160816; b=sXGrrqq5l4a92ohizjrwaHL3R7UwtyzIvgDzlma/FKqSuH6Nb15xirijq9irItkOEs z8Oclh6ztkH0SLG0p6GSuRQOLzbWVrSs/FIf2KQUCS0dtxVj8sk4jNbfh4z9dAsv6ENh 2JrP8QiYpcn4+2ColInZp2vx81ZJt43i/iDVDISPCe6A1vAeXorgqFNaGwQKiesnI42C cBoPE2T8LFp9RRqHPGHjOwH+VMvkXGSK0WToKLutaJwO1Dkm0yJijQxXCmoEcpthLcoQ txyZcaoAJZVesEquZzfW8twiq5kJSg+hwSf1R6xXZPsHTuX/GpiCiyiwpgPCCbdp6OFG R1Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Ayk5We1vI12jLcW3zDErdcAcqNSpWsXr0NVSETpZ+JY=; b=CVA8HipyclvUXBtHvj5IWiPWfs01e55ZYm2UkI3EVbN0iTLa9+8xgNx0sSqamgBECi amvyt2C7WRW9nw5R8cUGd6cjRodNbEqVkby4uBCbJIlNqlMN3cgsAbzB77yhXnbkl40P E5dHgDcPWFbPIFIdXKb7xtNfJ8uNy7uj9GfTRw/2UQV9mX77Mc0aWDgMnTJAd/+UXDng qaoLZjBRmqADQD9nNW3Yqvmrkl2mqVuK/h9D9bqNFyT0KA3Ok7pOwKRY6UeJODGrvGxU /RVpXCbUBIaV/GkZs38/WHqT/lA46iX2xe1g+rhiZdQw6BGqbKFrU+SiQBYhr/uCR8Am pEFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LY4v6pcm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si1361413eda.251.2019.11.07.03.59.14; Thu, 07 Nov 2019 03:59:37 -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=@linaro.org header.s=google header.b=LY4v6pcm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388430AbfKGLzC (ORCPT + 99 others); Thu, 7 Nov 2019 06:55:02 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36899 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727178AbfKGLzC (ORCPT ); Thu, 7 Nov 2019 06:55:02 -0500 Received: by mail-wr1-f67.google.com with SMTP id t1so2708230wrv.4 for ; Thu, 07 Nov 2019 03:55:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Ayk5We1vI12jLcW3zDErdcAcqNSpWsXr0NVSETpZ+JY=; b=LY4v6pcmezZwNcfXllRMIlIjE5qYGtgxeDhF7eBdaYPb609c6eo6pIgq4c6K+FqEoC zOxS/HgDxakHr18mXqyWj8cSn4feSZNsUjMXog5Y6AagnyEL9DWa0LKNH27cqIeixJR+ fvGQ24iVw9AXyh9U+iUKb8ks05Wh9U/iNIMcYtHT7IkZVo+++N7kV68Vs4ATLZ1zA39k yT5+8kK4aDbxSp+TxPKeEtBaGAcWxkHoZkGXBZVDzSKz4eUbTR6u+YEx15NmKunp2aGu kzLSIWjQX7eTE7XW6L5VLZh2AmZSCk8y5kvmTCuoGrilR1aCC99UOx6jiLjgoV5UztwW 7Nfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Ayk5We1vI12jLcW3zDErdcAcqNSpWsXr0NVSETpZ+JY=; b=O9eE75mcxGihFaXEsxMRz/TIHgKS1qmyKv2PPtvl0MwR6vgA8E+xY3OOY0vqWda826 pLdt9EsXyv4WnwMcUVDukOpolRu1IzNCMjPT6lLRQFgJfUe55q0ROj80LMFjSoflwz3N NOW8wRt5J4t7RSLxev6owm9MIfKXxwxPTaGpfK/bEGfayyn/J3iRSIScM5FjPInKj5HO n1V9KjyrrsKvj6o1EhUuGzreWR6Fk2r+L4aCVapMSlQ2IYu87uBxNSKf4+TdqYqNr4i9 JYcLTGEWvusAfA65+ppQ9S+8eBA7Z3CXUSTsIO3jjhpwpRqLAu96eDER0TrBkIdRMgWH T1pw== X-Gm-Message-State: APjAAAXzx7b/OMQ1arYboq9nDFCD5Odk9620BrKS0DPUfuZXs9yKsz1m rxxx+E9ZW6NhwD+NOq78zMkCWw== X-Received: by 2002:adf:e488:: with SMTP id i8mr2465007wrm.302.1573127699748; Thu, 07 Nov 2019 03:54:59 -0800 (PST) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id s21sm1895785wmh.28.2019.11.07.03.54.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 03:54:58 -0800 (PST) Date: Thu, 7 Nov 2019 11:54:56 +0000 From: Daniel Thompson To: Lee Jones Cc: broonie@kernel.org, arnd@arndb.de, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, baohua@kernel.org, stephan@gerhold.net, Barry Song Subject: Re: [PATCH 1/1] mfd: mfd-core: Honour Device Tree's request to disable a child-device Message-ID: <20191107115456.esxtcgo2pt7eq3v5@holly.lan> References: <20191107111950.1189-1-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191107111950.1189-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 07, 2019 at 11:19:50AM +0000, Lee Jones wrote: > Until now, MFD has assumed all child devices passed to it (via > mfd_cells) are to be registered. It does not take into account > requests from Device Tree and the like to disable child devices > on a per-platform basis. > > Well now it does. > > Link: https://www.spinics.net/lists/arm-kernel/msg366309.html > Link: https://lkml.org/lkml/2019/8/22/1350 > > Reported-by: Barry Song > Reported-by: Stephan Gerhold > Signed-off-by: Lee Jones Reviewed-by: Daniel Thompson > --- > drivers/mfd/mfd-core.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c > index cb3e0a14bbdd..f5a73af60dd4 100644 > --- a/drivers/mfd/mfd-core.c > +++ b/drivers/mfd/mfd-core.c > @@ -152,6 +152,11 @@ static int mfd_add_device(struct device *parent, int id, > if (parent->of_node && cell->of_compatible) { > for_each_child_of_node(parent->of_node, np) { > if (of_device_is_compatible(np, cell->of_compatible)) { > + if (!of_device_is_available(np)) { > + /* Ignore disabled devices error free */ > + ret = 0; > + goto fail_alias; > + } > pdev->dev.of_node = np; > pdev->dev.fwnode = &np->fwnode; > break; > -- > 2.24.0 >