From patchwork Tue Dec 11 13:36:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13474 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 98EA923E1A for ; Tue, 11 Dec 2012 13:36:26 +0000 (UTC) Received: from mail-ia0-f179.google.com (mail-ia0-f179.google.com [209.85.210.179]) by fiordland.canonical.com (Postfix) with ESMTP id 3AF94A19AD2 for ; Tue, 11 Dec 2012 13:36:26 +0000 (UTC) Received: by mail-ia0-f179.google.com with SMTP id o25so6434489iad.38 for ; Tue, 11 Dec 2012 05:36:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=mWzoV3SqJFUfBabp28NICjqBO6OU1AAd6eZpqgVlnZs=; b=Q5BtF9S8cefZaCXto+XwB8xmpBEjbP7V729bWfAjr8JO23iPQl6Mtv8CAaizLLvQ7n kujttc7j8Bg2DXZ/xYGpSGkxGlEOkDG1XfKMfx0IY/7zN5a+dkifVVxw3/7qot6svDYt 3xs7lH/lUbjmaNKMQ5296LeZEPLBBw/ZllzMHiPX/DrGZSoYdlo4dLqCkKRK5XAL3Fjf gNKzXXHRWjGN8CeXYUVV4Hu8Nmz8qYdCA7cNdAkT7HNwpY3BJIq9chSQhpGDr3G9qOsL pZ5folMq6xfFI73XYpf0XZuKtKe83JJftfLm4xLtx54Na+0W4iXo8QmPn3tuSLiH+J4T UUrA== Received: by 10.50.185.166 with SMTP id fd6mr9660625igc.62.1355232985567; Tue, 11 Dec 2012 05:36:25 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp131853igt; Tue, 11 Dec 2012 05:36:25 -0800 (PST) Received: by 10.14.213.134 with SMTP id a6mr60608040eep.45.1355232984700; Tue, 11 Dec 2012 05:36:24 -0800 (PST) Received: from eu1sys200aog116.obsmtp.com (eu1sys200aog116.obsmtp.com [207.126.144.141]) by mx.google.com with SMTP id j7si51346061eeo.54.2012.12.11.05.36.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Dec 2012 05:36:24 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.141 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.141; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.141 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob116.postini.com ([207.126.147.11]) with SMTP ID DSNKUMc200WH14yhQr8oZS65mNqWszHp4/HZ@postini.com; Tue, 11 Dec 2012 13:36:24 UTC 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 8DFD91B8; Tue, 11 Dec 2012 13:36:09 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 214824A66; Tue, 11 Dec 2012 13:36:09 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 02BC324C2FD; Tue, 11 Dec 2012 14:36:02 +0100 (CET) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 11 Dec 2012 14:36:08 +0100 From: Linus Walleij To: , Cc: Stephen Warren , Anmar Oueja , Linus Walleij Subject: [PATCH 2/2] pinctrl: skip deferral of hogs Date: Tue, 11 Dec 2012 14:36:05 +0100 Message-ID: <1355232965-16596-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnJKZ2dTmn+Sc8V7PmJ9jrzjfywaYm54QlQOPvBfIpANv8DjUOZ4k14ka2cdAX9l1oBr88q From: Linus Walleij Up until now, as hogs were always taken at the end of the pin control device registration, it didn't cause any problem. But when starting to hog pins from the device core it will cause deferral of the pin controller device itself since the default pin fetch is done *before* the device probes, so let's fix this annoyance (which is also aesthetically ugly). Signed-off-by: Linus Walleij --- drivers/pinctrl/core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 59f5a96..55d67bf 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -609,13 +609,16 @@ static int add_setting(struct pinctrl *p, struct pinctrl_map const *map) setting->pctldev = get_pinctrl_dev_from_devname(map->ctrl_dev_name); if (setting->pctldev == NULL) { - dev_info(p->dev, "unknown pinctrl device %s in map entry, deferring probe", - map->ctrl_dev_name); kfree(setting); + /* Do not defer probing of hogs (circular loop) */ + if (!strcmp(map->ctrl_dev_name, map->dev_name)) + return -ENODEV; /* * OK let us guess that the driver is not there yet, and * let's defer obtaining this pinctrl handle to later... */ + dev_info(p->dev, "unknown pinctrl device %s in map entry, deferring probe", + map->ctrl_dev_name); return -EPROBE_DEFER; }