Received: by 10.223.185.116 with SMTP id b49csp2205379wrg; Thu, 15 Feb 2018 08:05:18 -0800 (PST) X-Google-Smtp-Source: AH8x225szlvcLjB646inm+vwdAoT1awVB8EKeMxKi50p/bfDifULy1fYbDW2riF3ATs6ZVNmk3cd X-Received: by 10.99.191.78 with SMTP id i14mr2662162pgo.9.1518710718455; Thu, 15 Feb 2018 08:05:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518710718; cv=none; d=google.com; s=arc-20160816; b=CXcVuf3WjEzbcgq2xPIFzUUgoD8hdTMmhKzmNVfDH0AaJu/YAuVdIFa3JY2mxWHAV4 F+OUP3KMXYLy81BtYTa87v33hSgAKek8XS+R+J/rxrhTKSWCdhYcuOPaw8XYakJX+dgq mHa3rBFxzZXZrkGRcGPeYmlyp5egPZXbrr0gJpFomd2npplMfRIf9lp4sy8zquV0F2eN j9J9P03LF8JzmfPyPoFNbMFPLCyS2rOQuGslAvAyPPdgLdY2LZ20DOCu2LJBoKED4lyC hShk+oaBXebu7rKaYFBP+Bk7AS3VRC7LGX2+do/Pcp+7U2BRBk52ejuG8vm0f/dQnqtv 5MSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=s/osf1EIb+lepXJLv36k9VZtZXeg5pKErILc9SUNRTU=; b=ysihDvusEFVj8yuItiKmW75v311MEYqiav9L1cmhG1b/jo7jZuR51Y5b6XRNbnFvtP uCrbM7laIvtmP6QOsOuyRqE1flG3+g9tDE1rW9/RZ8Hg7ns2/YVxJ7Sl+JXMM5HPUylF BumApivqwmD3CZNpRrQKAxvrHT/isyygramgYglHpBOYQyj7BbGo7EHGaTSl7MzXenql fqQ6SImbCd12QREJvRTiYYwwla/lJc5Ax44cs4j9gPDGQoElyKVTCyBj+3xABlL0ive4 nmbEa2xzbcUQCgfWzM97afQkvEglnHASU8F2kitUd4KLE1RNBrMG5F/0bQ6LxlcKpC+G 9IsA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l28-v6si1224995pli.144.2018.02.15.08.05.03; Thu, 15 Feb 2018 08:05:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425476AbeBOQCY (ORCPT + 99 others); Thu, 15 Feb 2018 11:02:24 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35906 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424703AbeBOPqn (ORCPT ); Thu, 15 Feb 2018 10:46:43 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4BDC9FBE; Thu, 15 Feb 2018 15:46:42 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Mastykin , Linus Walleij Subject: [PATCH 4.15 177/202] pinctrl: mcp23s08: fix irq setup order Date: Thu, 15 Feb 2018 16:17:57 +0100 Message-Id: <20180215151722.126756239@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Mastykin commit 02e389e63e3523828fc3832f27e0341885f60f6f upstream. When using mcp23s08 module with gpio-keys, often (50% of boots) it fails to get irq numbers with message: "gpio-keys keys: Unable to get irq number for GPIO 0, error -6". Seems that irqs must be setup before devm_gpiochip_add_data(). Signed-off-by: Dmitry Mastykin Signed-off-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman --- drivers/pinctrl/pinctrl-mcp23s08.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/pinctrl/pinctrl-mcp23s08.c +++ b/drivers/pinctrl/pinctrl-mcp23s08.c @@ -896,16 +896,16 @@ static int mcp23s08_probe_one(struct mcp goto fail; } - ret = devm_gpiochip_add_data(dev, &mcp->chip, mcp); - if (ret < 0) - goto fail; - if (mcp->irq && mcp->irq_controller) { ret = mcp23s08_irq_setup(mcp); if (ret) goto fail; } + ret = devm_gpiochip_add_data(dev, &mcp->chip, mcp); + if (ret < 0) + goto fail; + mcp->pinctrl_desc.name = "mcp23xxx-pinctrl"; mcp->pinctrl_desc.pctlops = &mcp_pinctrl_ops; mcp->pinctrl_desc.confops = &mcp_pinconf_ops;