From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EBBDCA9EA1 for ; Fri, 18 Oct 2019 12:29:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C5382089C for ; Fri, 18 Oct 2019 12:29:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YM7Ln8RP"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FHn4bQGU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C5382089C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=m6J0dR1XfBhZyy0YIbOcqtOJ2CQsa8FnExLc7Khh8Js=; b=YM7Ln8RPtkGR2j8ge8lt1Douis XHwoSoV9z2gShu4x7cdCwVJSzrqTq+G3Uv6XMp144f8IZzOutdfi8jvdJarSjlxO+LD73u3s+N0kW +HlAKzVYKrXpQcuR+UH4jLTkmWWR4QYoT4wZR7Mfq8c8uzeWf8avhKDbuMLl/Wl5Gp0l4KGdHpQO9 ZK/mrShN6WJcn/iuivUbC3D47yvYZXdYYRlwSc/ZHFhetHv6YXP45ZaNgDtQTPIc36oaOtkL4CUMX gSu1bphL9vKpc+nCKh3KYXEKUpnOaWd6NBFnNxfvNpuygiVPMeMPMzuwqotQtC1ibxT/xQgqCCji+ lRUnRCeg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLRNn-00040n-Ao; Fri, 18 Oct 2019 12:29:27 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLRNM-0003cB-Lx for linux-arm-kernel@lists.infradead.org; Fri, 18 Oct 2019 12:29:02 +0000 Received: by mail-wr1-x442.google.com with SMTP id r3so6077104wrj.6 for ; Fri, 18 Oct 2019 05:29:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JOGbCAX9wvou6ywsxAyjFayUMg5QkjoPiWUMNf49UP4=; b=FHn4bQGUrrme8bhdcuqbKlKd4iJXjl0H680Dwdil6m5suU5dWL94Fgcyp/05VQzwrM IpHa8A90edNgbxCwOirUmCs3KMllZWamn0ZPjdUit+YGXPGCn/AtWY/S0v2uCdwJBAFH U/vk2d8CtrJgbBYDu7xAQgLbdcILRIy9qqgMYzbHvLjL8pcImeWmPwFTEuku/0jxQsGY Om6RbYNvZZP5ddmrJKbFgHvMnAnM0XF12HW2K71fIqtA9pF8DXdf/MXGzkGXYgxn0M4j GYj7PJ0cCmn6SZJSBAAwc0eBtAuEgQIBBtX95N7/SJWTIJag3z7yfa+pa8tQrRyNwHH6 bn0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JOGbCAX9wvou6ywsxAyjFayUMg5QkjoPiWUMNf49UP4=; b=NIG8rych1FaY1jfN6jTMRLtq2hwVWXVspOgl5fPoxJTz/qwBY76m54MMTFugxKZMGe E6tPW6wjAKx5R6JxhGJJvXAm2bt6ASO59MdrPusiyE9sfbBX659iw8JS6omMepFWsjgz Mq+tVRjJpUWC9w4uaov99gcKIvAKAE9McHj8Hs0tsFbyv5d/bTjiW5ZxWghkiZFR4BLb ascpf1KZpQ0AuJ+fhQdyI8p4eRWzPuIWUlBIRI5Tt2ocDoJ0g7DyQ2iZgGe7Z+R5F6ka 8RH+wqRy3U4Ddho2hjOwNpsfQL7JmBIGqa/f+/kGk18o4oxmp9NUN1v3DbIsDJpMrBKy rZpw== X-Gm-Message-State: APjAAAXd/lNVgK9HuMiU9cE2snkbdNK2oaIkdtf0auWNmk90Meu7taUN 2IFs+0AGG0C9rZBf6ub7BbnXKRaTTio= X-Google-Smtp-Source: APXvYqxhqYisy4iiE3UsQz9L4d23eqq/hgE36QscL1/8FgBQ17hh2NLS5RjkL0/X2RyHXS88imp4Xg== X-Received: by 2002:a5d:522f:: with SMTP id i15mr7209770wra.257.1571401739165; Fri, 18 Oct 2019 05:28:59 -0700 (PDT) Received: from localhost.localdomain ([95.149.164.47]) by smtp.gmail.com with ESMTPSA id e3sm5033820wme.39.2019.10.18.05.28.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 05:28:58 -0700 (PDT) From: Lee Jones To: broonie@kernel.org, linus.walleij@linaro.org, daniel.thompson@linaro.org, arnd@arndb.de Subject: [PATCH 2/2] mfd: mfd-core: Honour Device Tree's request to disable a child-device Date: Fri, 18 Oct 2019 13:26:47 +0100 Message-Id: <20191018122647.3849-3-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191018122647.3849-1-lee.jones@linaro.org> References: <20191018122647.3849-1-lee.jones@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191018_052900_713057_C1571A69 X-CRM114-Status: GOOD ( 12.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lee Jones , baohua@kernel.org, stephan@gerhold.net, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Reported-by: Barry Song Reported-by: Stephan Gerhold Signed-off-by: Lee Jones --- 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 eafdadd58e8b..24c139633524 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -182,6 +182,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.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel