From patchwork Wed Jul 22 11:17:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 247011 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp439396ilg; Wed, 22 Jul 2020 04:19:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwxTrJFJcl1XrZTBgi/KXdFMuqxezoV11WqhwQ8WteQSrVlM4Q3HD+zPdSsuJ5hl5IEDvQ X-Received: by 2002:a17:906:ce43:: with SMTP id se3mr29073475ejb.543.1595416787510; Wed, 22 Jul 2020 04:19:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595416787; cv=none; d=google.com; s=arc-20160816; b=HTqkakUFp2PZXxAXDNDpXumO+k0rNEjoiVVZl7ScptswoFEgyrurR/tzODoVRbbxmi q8ajXOaqrOxy0BITWhflzu4g6e7fwkOX/83mvGc9xPwvcmZvONggrBH4Wylyq+XYMU1K nQ9KPzMvrXvZp/41Zd/vZptEPsW6surh0SCtqOxIpnDgSngzzXNzPPN++yFf0ByGbKKQ bA2gfpIMUw4uwwvgpJqADitmx2TNF3yasyknAb89rwVO0fvmPwHDSiUxAOhsARlO2gvJ bkGUMny6Ec3Bx3IuIqNzf3AXKmY0ZxPisA5tHtR3r+Jkbon688qA+0uKpIwRiZSBdWsV Dycg== 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=AhRoQFCJDJNAYkk8149hNtdal6BdWja6VHiCqSxe3pE=; b=W/O3aM8U6M3x3ayRPQHzvNLEVaJvrxqNDFW2JL3eJ0OuRneWnIe1+kqKQVGLgNZro4 w07b0c7TtP5JLardfRLiiqvimxl4kue3cOUgcu4exrcQ6gOTntNJc8fOfQtzsRPBWf4n dFMdPJK5XL+WFClxF1yV1ooljphijhtsN5wXKAhCBaQ288ayKpZ6uFpGQfhKEAupsKJ5 DJKfm4y4KPOpEzF7HXM2lS7Sfje0sVMkhCdRzouOE47DD3SA/GpxPd3vpZv5AfSsV7IZ qdevEBVyqyX/Ot5nykGPJFm5MyrR6NmllLt483NXgoSxiRMd1+D3pY5ebLEVWkATRi5P LuSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VA+mc8ih; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 y24si11049624ejj.675.2020.07.22.04.19.47; Wed, 22 Jul 2020 04:19:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=VA+mc8ih; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 S1728421AbgGVLTq (ORCPT + 2 others); Wed, 22 Jul 2020 07:19:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726028AbgGVLTq (ORCPT ); Wed, 22 Jul 2020 07:19:46 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B62DCC0619DC for ; Wed, 22 Jul 2020 04:19:45 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id h19so2025732ljg.13 for ; Wed, 22 Jul 2020 04:19:45 -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=AhRoQFCJDJNAYkk8149hNtdal6BdWja6VHiCqSxe3pE=; b=VA+mc8ihxZhOTud4Xu0JcOQ2GmNFXpavaPko+xxVXDrFjyGnPJ1QswPQGiPKUi2yTY rs8q2B8Icjq1J0+9M9WwtGwIJPpfrnM49Ax+59irri5G0cTo30tB1rQr8zek4ftpncuy d4eOVZV543AmjkXFkFc+Xd8KAaHL4OKjErPXRscK6oTvGECzzWAdTgPYRuDQXvdRD+GX Cnb+EmNnMigzc31xbVXbdEpz0b8Pe2hBM2dObH0mtgy3TLzqkXqa9G78cvXDBBYzQ+Bv sZmlODKsBqPNz7WGGzcO32pPWVSbd8FQauUmQexc3eQCG7eUrHRMNybqX+RcEF4OsDoX AmUA== 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=AhRoQFCJDJNAYkk8149hNtdal6BdWja6VHiCqSxe3pE=; b=L21DYOTYIAJwJw7E687iuljXqeGN2h3/mSFkh/D1Wuw8rihTA0TOL2+lhpszRBqCBM VG95grs00HI5RS33q7ZauUbh/GzeErc1NS0tko5YDN0hnoMFOa8AIngDMf3ToBTRy9d1 3Yfzs+QpHYG7ohYjfuaaqbrbspIRehbO1kxdcEiTnsz70U2smLTqDejX0V7U4bifUYgb +D5qRjTz/CDJ7vwICD7Cr5v3gDsZnkHvaiO4FYOhKcFIkNptooiuTxL0i9M/nb1PkI+a xH4P5qOndOcv6nDxj1a3tvDsCoTVg+B2+D0pzO6oPRA3d2WLX04POBwJLVa/Cz9B3uoI a3AQ== X-Gm-Message-State: AOAM533GQ7oTD8MHb9/XyFdZV0AkNVaH0pizun5megUFUVeMhbswbWYp XORVufjidqApVCCYxK4IZaE5JkPAp7loaw== X-Received: by 2002:a2e:b00a:: with SMTP id y10mr4153105ljk.266.1595416784197; Wed, 22 Jul 2020 04:19:44 -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 u26sm8789440lfq.72.2020.07.22.04.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 04:19:43 -0700 (PDT) From: Linus Walleij To: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Felix Fietkau , Kalle Valo , Hauke Mehrtens Cc: linux-wireless@vger.kernel.org, Linus Walleij , =?utf-8?b?UmFmYcWCIE1pxYJl?= =?utf-8?q?cki?= , Florian Fainelli Subject: [PATCH] bcma: gpio: Use irqchip template Date: Wed, 22 Jul 2020 13:17:25 +0200 Message-Id: <20200722111725.210923-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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: Rafał Miłecki Cc: Florian Fainelli Signed-off-by: Linus Walleij --- drivers/bcma/driver_gpio.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) -- 2.26.2 diff --git a/drivers/bcma/driver_gpio.c b/drivers/bcma/driver_gpio.c index a5df3d111334..8a1e4705bc87 100644 --- a/drivers/bcma/driver_gpio.c +++ b/drivers/bcma/driver_gpio.c @@ -122,6 +122,7 @@ static irqreturn_t bcma_gpio_irq_handler(int irq, void *dev_id) static int bcma_gpio_irq_init(struct bcma_drv_cc *cc) { struct gpio_chip *chip = &cc->gpio; + struct gpio_irq_chip *girq = &chip->irq; int hwirq, err; if (cc->core->bus->hosttype != BCMA_HOSTTYPE_SOC) @@ -136,15 +137,13 @@ static int bcma_gpio_irq_init(struct bcma_drv_cc *cc) bcma_chipco_gpio_intmask(cc, ~0, 0); bcma_cc_set32(cc, BCMA_CC_IRQMASK, BCMA_CC_IRQ_GPIO); - err = gpiochip_irqchip_add(chip, - &bcma_gpio_irq_chip, - 0, - handle_simple_irq, - IRQ_TYPE_NONE); - if (err) { - free_irq(hwirq, cc); - return err; - } + girq->chip = &bcma_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; return 0; } @@ -212,13 +211,13 @@ int bcma_gpio_init(struct bcma_drv_cc *cc) else chip->base = -1; - err = gpiochip_add_data(chip, cc); + err = bcma_gpio_irq_init(cc); if (err) return err; - err = bcma_gpio_irq_init(cc); + err = gpiochip_add_data(chip, cc); if (err) { - gpiochip_remove(chip); + bcma_gpio_irq_exit(cc); return err; }