From patchwork Wed Jul 22 07:34:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 246978 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp303712ilg; Wed, 22 Jul 2020 00:36:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxG+/ptDMMc6o51xx36lDmjGwza2PHXo0L6/t8KMElFB6reSaltamnyClgvJwb/HvFz4Gj8 X-Received: by 2002:aa7:da06:: with SMTP id r6mr29845754eds.189.1595403392354; Wed, 22 Jul 2020 00:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595403392; cv=none; d=google.com; s=arc-20160816; b=yX830WXuKdZOmv9AhhHPr/kexSvKC61b74UMHM+DQ+rfAK4jXVLjS2CFC2Rtl7huE0 +b6KznkV6PkUEkx58TK3B1Zq0Ovbkblb9eUZVz5MkkLfb39o66drUjSRdHsekAjznsiU Lpij1n57DCNCgyKUreYgrQR0eqdF0e99mQQh8ujmwo0CZrg0OsYOa0PNSt+qTAPX4z+S Iuer1L0Xjjve2PdVqavayrKPm+91tkHR0ua8gJWUVoLsoekv60oEQ4kDZy5p4aAxzCJy Db4rOrJZ/jlcStLw2gWB5A3zCt2bdxyzC4P/hvnKDm0kEQGPLd8c6C2ElRse72Ldn1ve 3Lug== 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=AW545wyqnzjd9cz2nVLAkT4dmk7TFu8OWbGQ6dF6vm4=; b=0wmDkFk6vwMATv4FDbs7H/rrVLPy+l8D0vS+V5VLfUqn5FyDSe4GqWaFPuQC+VL8w8 K0QmzZXmE9Xe6VXYxk5xDwrU/fjGKX9Wra+hLxmEZjBDyV9lvW7Dzv1XBDoVA2eZffpr CS/vfxVh+IDm7RxHN3iS1kaIUi1bknXvUDgziDVec2yhVvCPE0yT8Wj33YVIWpIbzAeS Sxx93a+genFiYgqwNFzZBQ4sK4ORlLaZK3mriEuSjAiJWdh/gd5yLDZ7/8wcAhVlGJQ5 utMSCMK1YYpdv9OMLlSBwkxnYwcZbkosaWMkbncQ/jYkhytY5F+xIy0I18zZubqnNiOr /rrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O6tzxIMq; 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 d26si3506058edy.410.2020.07.22.00.36.31; Wed, 22 Jul 2020 00:36:32 -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=O6tzxIMq; 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 S1728289AbgGVHgb (ORCPT + 5 others); Wed, 22 Jul 2020 03:36:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727096AbgGVHgb (ORCPT ); Wed, 22 Jul 2020 03:36:31 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBCE2C0619DC for ; Wed, 22 Jul 2020 00:36:30 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id s9so1390741ljm.11 for ; Wed, 22 Jul 2020 00:36:30 -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=AW545wyqnzjd9cz2nVLAkT4dmk7TFu8OWbGQ6dF6vm4=; b=O6tzxIMqV2MjVAreLULH90U+foKiCj1BOZTaLIXVQcK9Cba9+52dOv6ugamyJD127b 0bRGC7LDKD5B+hfMbEys7vvkGzJea5wTqZRfnzc7vtA5pk0XQ65cSSWrC0hWbbanD9h7 7Ru3FnFPHoKAskRMS+9qGRPEGsTSaX7dntVHQXzB8RMHGm6WN5eXSU92DOveqhWATGOC mzmfYo19VEZQyIrmnwNxk2qh6RE2eiAA0lk+RpsPTb7ynW++ia/jO2ATftPc3qukodnK NupBvmTDVqNkvCt+/9NC2FeqspnENY8NeArISTr1/j9Id6SsPFpfR3yIwlRUoKDLfn5M wX4A== 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=AW545wyqnzjd9cz2nVLAkT4dmk7TFu8OWbGQ6dF6vm4=; b=KhlhfbVP44AnJtVRW6p31gYDZ3kWYSXGh53cOeod3anzL84J0UWBZitTHe4ADpK5Zc CO2WiRGdUneiS7wOBtHt4FirHKGo3ygNcULghkimduGSTfG17fCI3voZvjY5AIaOBXpU Z9c4kH/gSjGu6FKNCzeyNEyCT9BBXFeEXPhVwSYiLsT3sdjdFCQd2irG0AyyKYvcUdbG olZmgaIUIgEIo0oqFqqqptUR/WvoTouJcgqdkNtb85AEuC7y3xexej/43N1MA6ZzyTPy frMzzjKEPY9Us9xy6qcMiszkeuNDdA/xzyMXSwZHxWsUswXeLF3I/q0SwSe46XH/lpY1 K43w== X-Gm-Message-State: AOAM533zsCyK9mgLWQTBJokPysn7nOE95UvZ6BsjN6ENeJ+8r8Rj+kPr lxKWLsC9keWJlv34hsJwwMagCurIYicqug== X-Received: by 2002:a2e:9bc4:: with SMTP id w4mr14992432ljj.391.1595403388947; Wed, 22 Jul 2020 00:36:28 -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 c14sm7417649lfb.69.2020.07.22.00.36.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 00:36:28 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Bartosz Golaszewski , Linus Walleij , Daniel Baluta , Octavian Purdila Subject: [PATCH] gpio: dln2: Use irqchip template Date: Wed, 22 Jul 2020 09:34:26 +0200 Message-Id: <20200722073426.38890-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(). The irqchip is instead added while adding the gpiochip. Cc: Daniel Baluta Cc: Octavian Purdila Signed-off-by: Linus Walleij --- drivers/gpio/gpio-dln2.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) -- 2.26.2 Reviewed-by: Daniel Baluta Reviewed-by: Andy Shevchenko Tested-by: Andy Shevchenko diff --git a/drivers/gpio/gpio-dln2.c b/drivers/gpio/gpio-dln2.c index 26b40c8b8a12..4c5f6d0c8d74 100644 --- a/drivers/gpio/gpio-dln2.c +++ b/drivers/gpio/gpio-dln2.c @@ -440,6 +440,7 @@ static int dln2_gpio_probe(struct platform_device *pdev) { struct dln2_gpio *dln2; struct device *dev = &pdev->dev; + struct gpio_irq_chip *girq; int pins; int ret; @@ -476,6 +477,15 @@ static int dln2_gpio_probe(struct platform_device *pdev) dln2->gpio.direction_output = dln2_gpio_direction_output; dln2->gpio.set_config = dln2_gpio_set_config; + girq = &dln2->gpio.irq; + girq->chip = &dln2_gpio_irqchip; + /* The event comes from the outside so no parent handler */ + girq->parent_handler = NULL; + girq->num_parents = 0; + girq->parents = NULL; + girq->default_type = IRQ_TYPE_NONE; + girq->handler = handle_simple_irq; + platform_set_drvdata(pdev, dln2); ret = devm_gpiochip_add_data(dev, &dln2->gpio, dln2); @@ -484,13 +494,6 @@ static int dln2_gpio_probe(struct platform_device *pdev) return ret; } - ret = gpiochip_irqchip_add(&dln2->gpio, &dln2_gpio_irqchip, 0, - handle_simple_irq, IRQ_TYPE_NONE); - if (ret < 0) { - dev_err(dev, "failed to add irq chip: %d\n", ret); - return ret; - } - ret = dln2_register_event_cb(pdev, DLN2_GPIO_CONDITION_MET_EV, dln2_gpio_event); if (ret) {