From patchwork Fri Nov 26 15:13:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Keeping X-Patchwork-Id: 12693762 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7578CC433F5 for ; Fri, 26 Nov 2021 15:15:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Om+v4cAPTuqbuG+wx0nK3EX8PgjHAAlxcvbmOmk4iHE=; b=qGBJVLXX7KdLdt dHhXSxSsBacg9ZiTqXSPb6nYPv6zYLLfgVsIU4oeJysEDLl2HzDKReqppaIlh+ICqcDUwIvgwoqql OPiUfcZCAaRpmMUkyDBuJhV4WqZQmLmG1jaACcIXs7u8uD4LQ9I2G239N2K1UsYplcl/sB+yD+JJp uO8dPUN4F5kKm9sxU84/RdIbI1kaUYOG9KR0NmR794foAy6LsLGPpy2DSdTFfshTeGRY4aL4mTiF/ /7RO2NKAuESJe2svq4pzlNd+cr6Mq18T3n1GYQaXAX6u90SwmKxz8oLANc1uXLtad68Dxw+pM2sn5 Y1+06RWGsqXGBa3qpsDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqcvR-00Asz8-IU; Fri, 26 Nov 2021 15:14:09 +0000 Received: from [2001:8b0:1628:5005::111] (helo=metanate.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqcvN-00AsyL-MT; Fri, 26 Nov 2021 15:14:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Content-Type:Reply-To:Content-ID:Content-Description: In-Reply-To:References; bh=8pc6wenaS6YAPAESN8lcSW+nzlJ+wUHkM23DdCXDUPI=; b=nc bHZ30ylo71HCEHK+uBOQKh2Shpj2pl8TRL5IY2VIcvrhW1kjYleG4bRZwIK+r2d2U5Xm2LXWOBv+M NqoUnI6ZpB+tPPLdB+lNKSaXmqwHdSUov/L8yMfm2XKUBEgl1pbRj3/vMQqXb1DtkD8IhJYNcBgXY XeXQxoyYuzjka/XZrdWDy9qVnitCCxOxP2mXe1fV1vWY6oHLNB/xWU/vQAlOY/BCeYYpxh/Pqgt8S gaR8LyAXeZYEh0A3IhJwKh6n6GK2dOYQVI3USiuxuRmU5Koma+uGhWVeTyKnb/6YsA//0zqEJA/E2 VCXOI+bu0dFif6KDPhL6q7Cyh/tdVjnA==; Received: from [81.174.171.191] (helo=donbot.metanate.com) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mqcvG-0007c2-5e; Fri, 26 Nov 2021 15:13:58 +0000 From: John Keeping To: linux-gpio@vger.kernel.org Cc: John Keeping , Linus Walleij , Heiko Stuebner , Jianqun Xu , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl/rockchip: fix gpio device creation Date: Fri, 26 Nov 2021 15:13:52 +0000 Message-Id: <20211126151352.1509583-1-john@metanate.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Authenticated: YES X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211126_071405_760474_DD62F5D4 X-CRM114-Status: GOOD ( 13.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org GPIO nodes are not themselves busses, so passing rockchip_bank_match here is wrong. Passing NULL instead uses the standard bus match table which is more appropriate. devm_of_platform_populate() shows that this is the normal way to call of_platform_populate() from a device driver, so in order to match that more closely also add the pinctrl device as the parent for the newly created GPIO controllers. Specifically, using the wrong match here can break dynamic GPIO hogs as marking the GPIO bank as a bus means that of_platform_notify() will set OF_POPULATED on new child nodes and if this happens before of_gpio_notify() is called then the new hog will be skipped as OF_POPULATED is already set. Fixes: 9ce9a02039de ("pinctrl/rockchip: drop the gpio related codes") Signed-off-by: John Keeping --- drivers/pinctrl/pinctrl-rockchip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 438808a867cf..d8dd8415fa81 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -2735,7 +2735,7 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev) platform_set_drvdata(pdev, info); - ret = of_platform_populate(np, rockchip_bank_match, NULL, NULL); + ret = of_platform_populate(np, NULL, NULL, &pdev->dev); if (ret) return dev_err_probe(dev, ret, "failed to register gpio device\n");