From patchwork Fri May 24 08:08:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 165090 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp3251055ili; Fri, 24 May 2019 01:08:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlw/mDWTeNQb3vNE/VwAjqvvDFGxr0f+qx4k8dvby5uUOWXL1bV/YOSRo+qAXMl2l5YM/Q X-Received: by 2002:a63:534f:: with SMTP id t15mr104864287pgl.445.1558685327653; Fri, 24 May 2019 01:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558685327; cv=none; d=google.com; s=arc-20160816; b=CYNam2b28caBeVhBqIWFcsoA4QxRx3cPYHU9eFSOg/gPkNwKr01JigyEU1xwFi2AVk A/mtbqvAziwtrTjgNXBtGwlf5fV1ZodCp/qgg7yFKrW4KI7fAOYXXdee727E/48+L3rX 8hvUKO9vg1rEI0nXpY9sZafuvm20hgstBn4QXhGDvst/PpghtJZmg9m43Nig69opboLK TZonbj7wMlOoLI7fepysM8DLdhHDzy96Dti8RdLQB55AfnVH0k0WHmV66Kyyqosdy/8/ sh+FXQeAuGQz8KL6fPuhcHWF5TzyioNatCcYeXUcJ2XQt2caN3IJZiA8mwLIJtaDnKm5 n3Cg== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=47BMQdLR7bja0wVOm3y003+9mQi2F7wpyQcEeaV61G4=; b=IaPLflo/fXo6DEoXCel6eJ5i/6V7HjPc4aXqHwk6AO7Y7hLKSbooT5Clq56Ll3lqm6 p93xZLV30QvHwMqq2al/UlVp8w8w2J/ryc6X7pR6aLmU3eacAwKt4WWW1YwWyOz1HRDn 2n/eTHig9g0dpmTeZzMJtXj7tBeQJZS32n8YYVOjEs4Nvrz7vprIWg0RRVPyHGDC3Nu3 vT32XCVgDeXeqySbQTKFWZYicQ7k50az0nv0L1bIRUcdOtgBw5DeVmFxIUAZyzgaeAq0 DfHtJzyRCDtXsyOkiWQIpYHzvhklTZwOjQyzIzeAgZzAJBzeP27i4MCwTB9hCmK9nUnc 5cdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tRf9oi3W; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-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 v20si2767088pgi.563.2019.05.24.01.08.47; Fri, 24 May 2019 01:08:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-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=tRf9oi3W; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-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 S2388960AbfEXIIr (ORCPT + 5 others); Fri, 24 May 2019 04:08:47 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:43340 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388959AbfEXIIq (ORCPT ); Fri, 24 May 2019 04:08:46 -0400 Received: by mail-lf1-f66.google.com with SMTP id u27so6406048lfg.10 for ; Fri, 24 May 2019 01:08:45 -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:mime-version :content-transfer-encoding; bh=47BMQdLR7bja0wVOm3y003+9mQi2F7wpyQcEeaV61G4=; b=tRf9oi3WPr72KA5JL3sFRe1+og4j3l2Ro3tzWWGxSB2KchLmR06thHvO9EvQL/zuk+ D7IqaFtZVH8+Zbf30LQQcZbB6nDy7qIDTvv8/cmfyX1Dp1SBfTZyPWHLLL4iT2WbNV/H VHX+/n+r7sH5cjPKRu+A/fQMkyMRFoKt5SYDvkxAHooVTPNSwooFuHKW7eDaXAzuHBan 7FJoYaR25kyj6z30kCH2TTw+C9KDQIqI5vE5Dd6Dui+Jw2FRyhFiYWvpdePf4C53d2BZ hDtkJtp83CX8gvqSp3uMtI5MXUo5hk540ttey6lFOY7KQvFE1s3nOY1Oc1CfkwQchUBN 4VWg== 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:mime-version :content-transfer-encoding; bh=47BMQdLR7bja0wVOm3y003+9mQi2F7wpyQcEeaV61G4=; b=uaHtH8Leug/5yz1YiBWWgBKNCB0caK04xO7S6xvNCJPVsh5sw6qejWCl+FVlzQ8Vrz wg2Tkr5yfUIIxoCjjikq/LFPDdn5OxU23rfQKwDrD963Dg5MCVaOKRpN5+v84O/X0Vxf oj+compOq1PcKh/FscsfkX6RK7TzFOOLA6elM3kgYM1+Szu5N1sVMQNtyVDa5dvyjV/x /zMGxQUa4o0EcNJxCA3wyHC1nGQV/XeH5nDXnTvKB+1mMjbsc7YZEmQLyCO8/fxSmgnJ 2DyTr3DLtRhcXM3pEuayM4v0plnu6CjVHOKEWHaI4BqWhu4g6B2j6kfpqA99Y7NqN9Yr qPGg== X-Gm-Message-State: APjAAAUbNHumesepIp1xPgtWHOjAhHlD6Dqx+ykyYCSoAGfpDnNWrqqQ 2qLOuv5wcn2/K8/w0n6eV9i8lQMM8Ps= X-Received: by 2002:a19:700b:: with SMTP id h11mr4483601lfc.25.1558685324212; Fri, 24 May 2019 01:08:44 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id j22sm448486lfh.14.2019.05.24.01.08.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 May 2019 01:08:43 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Benjamin Gaignard Subject: [PATCH] pinctrl: core: Do not add device links for hogs Date: Fri, 24 May 2019 10:08:39 +0200 Message-Id: <20190524080839.7118-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Hogs would create circular device links, so do not link the device to itself. Cc: Benjamin Gaignard Signed-off-by: Linus Walleij --- drivers/pinctrl/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index d757c51d7114..41adb4e47dc0 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -1271,7 +1271,9 @@ static int pinctrl_commit_state(struct pinctrl *p, struct pinctrl_state *state) goto unapply_new_state; } - pinctrl_link_add(setting->pctldev, p->dev); + /* Do not link hogs (circular dependency) */ + if (p != setting->pctldev->p) + pinctrl_link_add(setting->pctldev, p->dev); } p->state = state;