From patchwork Wed Jul 22 11:00:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 246993 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp425768ilg; Wed, 22 Jul 2020 04:02:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1t56wk56hX3oKsz0W/55Ih8bzspHBdLYCHv3PlRSifnEWu2HO22tIEYx7bwnDHZ+UcdU+ X-Received: by 2002:a17:906:1688:: with SMTP id s8mr5324518ejd.164.1595415753609; Wed, 22 Jul 2020 04:02:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595415753; cv=none; d=google.com; s=arc-20160816; b=e+gGXyCnlwfIMZPDjxsKv/aDPSDnYBLtnGi71MC+6aVSPwPssL0+ROTC0dquwZH2nf lUjEjlBKv0raaHTT0peKW6iLm8nlCcscVKyCL4PWL1up/IIg9seQz6CU+qmzk3rD/aP0 UZCz6ziGrgqd4UALed2mDMtjJG0s4p18VIP0ypYbC5hcKB3aMTojR2LSTExl0dxcQtp8 1xGpR3pmNwKb9W+ZbWlj1RsnERT2IrxmcVVhxNJlzJXKeeqvEVCnaAnsMpzE7U1T9sjX bEqcelEfNFlAkNxieyrWJC/PHAzTINZGSFxVTTiEEFKXcRjawiudDzMpXYcOmgnVAhBb fJaA== 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=6W/oLPmohhHYxRZou5i9u9TEyqPAIWtSiuIbdoyZTiY=; b=iAqCME5IpsQz0E/63SQ7MUDXg/fr16/p7FwOCu8BuPggB1b1FJVmdKa1Kj9jpgZB/K Ic61kvOVaq39gPbKB38Bk6RVCYjgoobxhCyaB+ZXPIFDAOBRXk4pGAQA6M6iWQ6kdjrw Vd7bqXu6xjVm5BGQ01uAKuiAQ9mYglu/iQxKJ2X+O8bBLMjtf6uCB1xf02ZM4fOdnavE L7bzq3x0bxL9w5NZav3lDFDZpZ3+hX5JHqiATcU10ulAlrybvG09MkO7j+AIITMxDT6x K6HpnT/GmTvijyg37k05hwZaD20DSBA3JgHnoDfYLtnFQtmNKB8YMO7brG0RxIR/Ios6 cJzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DxIocUz6; 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 pw26si14383667ejb.240.2020.07.22.04.02.33; Wed, 22 Jul 2020 04:02:33 -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=DxIocUz6; 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 S1726599AbgGVLCc (ORCPT + 5 others); Wed, 22 Jul 2020 07:02:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726559AbgGVLCc (ORCPT ); Wed, 22 Jul 2020 07:02:32 -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 F371BC0619DC for ; Wed, 22 Jul 2020 04:02:31 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id x9so2015166ljc.5 for ; Wed, 22 Jul 2020 04:02:31 -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=6W/oLPmohhHYxRZou5i9u9TEyqPAIWtSiuIbdoyZTiY=; b=DxIocUz6oksD5y6p8bgmoAlGe6lI3j6IqtCQy5AXCc2KrOFZB6/9epPAwZ5UEWqmli vXdMKE0yImrdi1qmzFfif1plWhG5H4klwCnzvDlvNX8T74Qy9vzfu1dML9Ve0hXF/QWH JlslU186lHSQXqE8BBTRV49U5O+acX1uQZl08o0zDyhbTepMUatzUuS3dytnp1kOh7lD jyRFVkeD0wZh5JyGcX/41PFD1VOEJqIMekP400niFQdVJIpF/U8Obw+3KXSrdA+BBcHm p4fPt5/riSadabr6TxTHKQ0yimM2thrvOGPThtAEEyv1kw3stzhHgsTX2cSHAsIZ7sof smqQ== 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=6W/oLPmohhHYxRZou5i9u9TEyqPAIWtSiuIbdoyZTiY=; b=GThfkyjCaYQ0bxEZGYHWBRXeDVqzeCd1ces63lYHnBibWIoHCyRLAyvVtDkyUF/aqY LkWNMXbiq0oxwZNPwkVhkkHNtFM/5eFFVfHIm8VHJBPyZsQNs+Wrl1R25AdlGt8HOFd5 o9w8bR96ydkKOFYeXC+rpDNhT6Wu34ZDxLZu/OmdyZ5ECtmykDgELP2+sNrAjTYGvaVW +xqRIUvX+FmvuBe2ysjEmNDqEiuDbk6eVp+dPvJ9emo9PXnULRj+ONtTR8F9l0UGBCN9 63dn7jFdh1zZkJDIRdgeMfDQb38OcFkDad10pvXCRvCoMQjhtPzitPFY5Q9xMKWD9lOb ERvg== X-Gm-Message-State: AOAM530b0yCl5BLb1qPwavNVzBaLdgF6VrgYhFnxCzjiLY6p4iwxauXh Dy5H50PopcSm40Jvd9yENj8pHxpJKAD5dw== X-Received: by 2002:a2e:98c6:: with SMTP id s6mr2374206ljj.181.1595415750197; Wed, 22 Jul 2020 04:02:30 -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 b26sm7325416lji.36.2020.07.22.04.02.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 04:02:29 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Bartosz Golaszewski , Linus Walleij , William Breathitt Gray Subject: [PATCH] gpio: pcie-idio-24: Use irqchip template Date: Wed, 22 Jul 2020 13:00:27 +0200 Message-Id: <20200722110027.192782-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 call to gpiochip_irqchip_add(). The irqchip is instead added while adding the gpiochip. Cc: William Breathitt Gray Signed-off-by: Linus Walleij --- drivers/gpio/gpio-pcie-idio-24.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) -- 2.26.2 Acked-by: William Breathitt Gray diff --git a/drivers/gpio/gpio-pcie-idio-24.c b/drivers/gpio/gpio-pcie-idio-24.c index 1d475794a50f..a68941d19ac6 100644 --- a/drivers/gpio/gpio-pcie-idio-24.c +++ b/drivers/gpio/gpio-pcie-idio-24.c @@ -457,6 +457,7 @@ static int idio_24_probe(struct pci_dev *pdev, const struct pci_device_id *id) int err; const size_t pci_bar_index = 2; const char *const name = pci_name(pdev); + struct gpio_irq_chip *girq; idio24gpio = devm_kzalloc(dev, sizeof(*idio24gpio), GFP_KERNEL); if (!idio24gpio) @@ -490,6 +491,15 @@ static int idio_24_probe(struct pci_dev *pdev, const struct pci_device_id *id) idio24gpio->chip.set = idio_24_gpio_set; idio24gpio->chip.set_multiple = idio_24_gpio_set_multiple; + girq = &idio24gpio->chip.irq; + girq->chip = &idio_24_irqchip; + /* 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_edge_irq; + raw_spin_lock_init(&idio24gpio->lock); /* Software board reset */ @@ -501,13 +511,6 @@ static int idio_24_probe(struct pci_dev *pdev, const struct pci_device_id *id) return err; } - err = gpiochip_irqchip_add(&idio24gpio->chip, &idio_24_irqchip, 0, - handle_edge_irq, IRQ_TYPE_NONE); - if (err) { - dev_err(dev, "Could not add irqchip (%d)\n", err); - return err; - } - err = devm_request_irq(dev, pdev->irq, idio_24_irq_handler, IRQF_SHARED, name, idio24gpio); if (err) {