From patchwork Tue Jul 28 07:27:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 247211 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp299039ilg; Tue, 28 Jul 2020 00:29:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwo3AVFJ+48bHCHmzYH4nRyj+3lO8SPY+04GovFO3xqzbQpjEojeGVWMwCAo6Hnba5qQuo8 X-Received: by 2002:a05:6402:176e:: with SMTP id da14mr25277660edb.262.1595921353836; Tue, 28 Jul 2020 00:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595921353; cv=none; d=google.com; s=arc-20160816; b=WFWqfG7ZOUm7DoSYx3myG4ok2/9L1scTs++NHjMHhJI1KGZGm3ua4ueS8eP4Rwbaay bi/JMlI2TT2bDgqVSt8FPUyRc9e1OO17JRmesgeEuwiZw9OKsv5wQu61FSAu5d16/QBg +TjsyCyG4kdehRb0bJnMHN8TCMRnS/X783Pu8sM84j44Nu7FlQLW4FTPFudY70LDTQD3 6vj4EmMOQtt+CQw1HkoOeet6zPara6yhGT6SjtfzvsuQd2vcBzGssa2KLFTk7VdlAV1y W4wKU5+A9hHVPKU/XloVJyvxhs+K4em0Bp5VOJDQHBYQtLifOlUa/0WZii/reJGubdPY jbEA== 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=Vl/1AzReSowGHK7rWhVKeID56AYucjcDR0PS1Rw0UJs=; b=zEqBwNeZFD+H/SFbXwPuDJwTVrOJC+iwi6IZJvFrOAq0YllzJYka29Ot2k+snQlePR Q6TGDOwYq4S+OTsogGtAB4e9WGw87M0j/4GKBtELSV+f4ZYMFc4EwFCm6R5hf9cS/Ep6 ZlTkLe4nv04WvaiMjCJTsskG4cwKd9QB1j1e1gn0j3kNN74kBal8kkDTELXuOHFx/rGC UxanEo7Rjwn1+8yxHEhLcJzMMFlNGh6rS0PWwIHE/p2aC4QMb0vdIp4OKikXn3vf5hQz CfqUSgSMqdFT6JQX1iXm1xrWghYnaZvEP2qs5gx6cXp5B4iHwziIrSSE/QnkJH1ByaEl Ziyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BnVg4hjx; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id c3si4279089edm.469.2020.07.28.00.29.13; Tue, 28 Jul 2020 00:29:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BnVg4hjx; spf=pass (google.com: domain of linux-gpio-owner@vger.kernel.org designates 23.128.96.18 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 S1727860AbgG1H3N (ORCPT + 6 others); Tue, 28 Jul 2020 03:29:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbgG1H3N (ORCPT ); Tue, 28 Jul 2020 03:29:13 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99B50C061794 for ; Tue, 28 Jul 2020 00:29:12 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id j22so4552875lfm.2 for ; Tue, 28 Jul 2020 00:29:12 -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=Vl/1AzReSowGHK7rWhVKeID56AYucjcDR0PS1Rw0UJs=; b=BnVg4hjxnMBM4u1v1/bEErLwlKbB8FFzicHCgiT2zY/kIC2Mm/lOGosy6GycuhAFAX /shU3Iif9RIHc49CXO14jPx7H4P2XEY6BJRrI6VaQw16mTTeZnCrP9SmKgORDPcUMoGU nOttlECF6UYyeqNutzrJBkr0K6jkYXEMl+xP9X3hO/kogKd6Ynz1xPqcH6Ui/3SJJhbC ryLvzmtrY6+es58g0mLjB1yMIesC4UiVhu2b4pp5ZqGY8JSIPJYcJEbIZRhy4Wq9aSfZ lNf06Qujzplu28SluZKb3dIzq/TWOV0TaG/j8jjvJT8MjhlAvNpYCy8Tl8021PL+QsMk 3g5g== 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=Vl/1AzReSowGHK7rWhVKeID56AYucjcDR0PS1Rw0UJs=; b=F1yINUO25BrTDOAuAw0Ks5khyHiHFsuag6l5WsOczk6QbdbDEwW2X+0URVUE0rM0hG DXchtNKPLHk+LwETlP9d7XNlVLp8AOr7XWrbgbGVS1Q3+UDalyh7XeuV83t5uamVNEVu IKBB9lrsfLQ8xbrS6lRdMXzuNTUrPhCcbZxkRvjzELlNQXRjEVh0YgwlDf0Oy/jSskqx AzRxGckcEAydLElcBsSFRL4KbCmGe2jKO4Dp/eotgLULctqGnIYCbT2lDKLK6/fm0g27 Ks+GJJwfbkTLt7LX1bRXOA0RivE93jtV5+wuiqVmchzFp2s6AHJQ+jnHnvld/7vsk5zg huEA== X-Gm-Message-State: AOAM531nsQh6sRjycyK+SAHQnTC1uTs9vk3fYodOzrgH4DAijjRYIuzg rYXwT7v3ATgtAa84ossy+Ym7Zk24oHncnw== X-Received: by 2002:a19:257:: with SMTP id 84mr13150167lfc.208.1595921350439; Tue, 28 Jul 2020 00:29:10 -0700 (PDT) Received: from localhost.localdomain (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id h23sm3600656lfk.37.2020.07.28.00.29.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2020 00:29:09 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Bartosz Golaszewski , Linus Walleij , Patrice Chotard , Serge Semin Subject: [PATCH] gpio: stmpe: Move chip registration Date: Tue, 28 Jul 2020 09:27:06 +0200 Message-Id: <20200728072706.348725-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Make sure to register the GPIO chip after requesting the interrupt and setting up the IRQ members of the irqchip. Fixes: 9745079609df ("gpio: stmpe: Use irqchip template") Cc: Patrice Chotard Reported-by: Serge Semin Signed-off-by: Linus Walleij --- drivers/gpio/gpio-stmpe.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.26.2 diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 395ee51445ea..6c48809d0505 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -500,12 +500,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev) if (ret) goto out_free; - ret = gpiochip_add_data(&stmpe_gpio->chip, stmpe_gpio); - if (ret) { - dev_err(&pdev->dev, "unable to add gpiochip: %d\n", ret); - goto out_disable; - } - if (irq > 0) { struct gpio_irq_chip *girq; @@ -528,6 +522,12 @@ static int stmpe_gpio_probe(struct platform_device *pdev) girq->threaded = true; } + ret = gpiochip_add_data(&stmpe_gpio->chip, stmpe_gpio); + if (ret) { + dev_err(&pdev->dev, "unable to add gpiochip: %d\n", ret); + goto out_disable; + } + platform_set_drvdata(pdev, stmpe_gpio); return 0;