From patchwork Thu Jul 16 10:06:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 235639 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp647728ilg; Thu, 16 Jul 2020 03:06:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNePLGUE272siJuACV+/13lMgJ2B1LphN1oFg9I93i7z/L/RQdykBRxov3MDEluFosIJTq X-Received: by 2002:a17:906:7387:: with SMTP id f7mr2835869ejl.131.1594894004561; Thu, 16 Jul 2020 03:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594894004; cv=none; d=google.com; s=arc-20160816; b=CYj8ruddNAE2SE2LoSe7hyBIKBmwhKyhUJSCumimQXmepwqT/LlZBFoib4vGeLKq3p t3m0Ufl4D6zD9LSFEeVOHNHhvlecObAyyTPEyIifGgAskm0YCE+egEbSWliVrOCPnWM3 Q0nF7Re0cPe1577GZlVlsWVjPcMl+T+8OUhyhOv6AM0+7tBz5OnpaJwT+8D+4nEtjc0X F2T+5XENDiuIRfv08ULa79QxRDqH62ZHmSNEsFvYM+ddo97lAZIBJXWpkbxybM69QGKk B3UgH9F8lO0DH7VssHojuPf4qrNBrVBMf+WoepPgoLLHyPLx8AEuKAqTqLOv4kDS05Fw U28Q== 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=assvlrGhZdtMJ0Zn3X2YWbUyaJC6SrxIJ2dc8swcu0c=; b=Jo9kqe0sujTLn6YII6rpAKZMowCFs1FWpaKz7+5ZK7HKpacZkMDknBgzLtNxk/Ef0k OKpfoDXhXZ2fqjO3USXsDyNEWZ2Dp+ARd1s80KAyN8+joeLy2/MdlhZzKVHM77MXAl7m tsPaMav46nkYV1z9HsiDTN9TgHQqiuRlTbj8OgZhVQ8utM2CKIxdK9kTg5W+Imt72xM/ Z+EfppwctbK7DHhOBMeqA/oZpAw2XwVzjX28dIAMWISm6mj+WWe05gUQ7gliIehDeIcd z1SKCu/rzPgd0t4U5GKyKpoN8jItB7pPl8QZGclINhtVUR+wVeS8jvhIWea//+zKm42C Viaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VU1lzn0u; 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 l12si2902019edq.180.2020.07.16.03.06.44; Thu, 16 Jul 2020 03:06:44 -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=VU1lzn0u; 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 S1726105AbgGPKGn (ORCPT + 5 others); Thu, 16 Jul 2020 06:06:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725965AbgGPKGn (ORCPT ); Thu, 16 Jul 2020 06:06:43 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1F3DC061755 for ; Thu, 16 Jul 2020 03:06:42 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id s9so6435522ljm.11 for ; Thu, 16 Jul 2020 03:06:42 -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=assvlrGhZdtMJ0Zn3X2YWbUyaJC6SrxIJ2dc8swcu0c=; b=VU1lzn0ulnKeWhfbf1+CeuxeKiVQSIGyVdBoOuDSjBKasSKPx69v48p+ejV5Ce+64P Hkv3FBfVA9MZs5C6AsXEHnr5xid9XyhV6oGjqHyRSPWZ5XYuXstozA9yvUhuy1nvoBP2 fGFMQ84W3vtB4eBNwWxAlnpGJhY9veqBZCnFZ5iTON9O53lBUdReHsitkrHNjbTl8woc +4LJqAImcSzUQgYcr+F7rS0+L1cMuKzcpZyXZGQu55910QaNYOWIG/asWVLLHx+WmgGx ytZc1RyvvDFmr38GodxosIf7ATz7kWGddSxQxlNOwFsJKBBeC+nfmzdff6VKvLOqPdbW Fe4g== 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=assvlrGhZdtMJ0Zn3X2YWbUyaJC6SrxIJ2dc8swcu0c=; b=hGGja61qLi6sYbmModEI2CLxo1B+baZAwdNsaO9nOOSm5dYTrp7YdEHaaEvemOASHt FUORNqZViCWZml3F5XLAqPUssZ0xVg6n+wbcgXsu2ho3BQcf12xilNcJSHkabz9gx29e mGCIlHHwv3mns8ZHLF4L5o1JMIiTRNOFRr7PPeMC5sPvxt+7eGpqId26vmC9qp3bixKA PBMvuuOm8+K8X+45sck6Glr+qeqLw4dtY4A1NmT+g77EmlMHC1TVe73xtLz5Cs9B7t8O IksJpdexklf352XQ4TqH08JIpW1IRGIPA1vAQHOj2XiFEW3M7a/X7MkSh6K4zz58Juyr z52w== X-Gm-Message-State: AOAM5320ONOWfp4Gui4OvBv3m5410AhN7TRhnLIojcInaiclBX/V9zHj Ej4ox5FyebKdCOgu4vp4eDDevlx/vmM= X-Received: by 2002:a2e:b607:: with SMTP id r7mr1711617ljn.5.1594894001242; Thu, 16 Jul 2020 03:06:41 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id z23sm949981ljz.3.2020.07.16.03.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 03:06:40 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Bartosz Golaszewski , Linus Walleij , Patrice Chotard , Alexandre TORGUE Subject: [PATCH] gpio: stmpe: Use irqchip template Date: Thu, 16 Jul 2020 12:06:38 +0200 Message-Id: <20200716100638.112451-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 This makes the driver use the irqchip template to assign properties to the gpio_irq_chip instead of using the explicit calls to gpiochip_irqchip_add_nested() and gpiochip_set_nested_irqchip(). The irqchip is instead added while adding the gpiochip. Cc: Patrice Chotard Cc: Alexandre TORGUE Signed-off-by: Linus Walleij --- drivers/gpio/gpio-stmpe.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) -- 2.26.2 Reviewed-by: Patrice Chotard diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 542706a852e6..395ee51445ea 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -507,6 +507,8 @@ static int stmpe_gpio_probe(struct platform_device *pdev) } if (irq > 0) { + struct gpio_irq_chip *girq; + ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, stmpe_gpio_irq, IRQF_ONESHOT, "stmpe-gpio", stmpe_gpio); @@ -514,20 +516,16 @@ static int stmpe_gpio_probe(struct platform_device *pdev) dev_err(&pdev->dev, "unable to get irq: %d\n", ret); goto out_disable; } - ret = gpiochip_irqchip_add_nested(&stmpe_gpio->chip, - &stmpe_gpio_irq_chip, - 0, - handle_simple_irq, - IRQ_TYPE_NONE); - if (ret) { - dev_err(&pdev->dev, - "could not connect irqchip to gpiochip\n"); - goto out_disable; - } - gpiochip_set_nested_irqchip(&stmpe_gpio->chip, - &stmpe_gpio_irq_chip, - irq); + girq = &stmpe_gpio->chip.irq; + girq->chip = &stmpe_gpio_irq_chip; + /* This will let us handle the parent IRQ in the driver */ + girq->parent_handler = NULL; + girq->num_parents = 0; + girq->parents = NULL; + girq->default_type = IRQ_TYPE_NONE; + girq->handler = handle_simple_irq; + girq->threaded = true; } platform_set_drvdata(pdev, stmpe_gpio);