From patchwork Wed Mar 10 12:54:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 397915 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4000DC43331 for ; Wed, 10 Mar 2021 12:56:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1892D65000 for ; Wed, 10 Mar 2021 12:56:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232616AbhCJMzd (ORCPT ); Wed, 10 Mar 2021 07:55:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232598AbhCJMzJ (ORCPT ); Wed, 10 Mar 2021 07:55:09 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20D37C061760; Wed, 10 Mar 2021 04:55:09 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id u187so7028710wmg.4; Wed, 10 Mar 2021 04:55:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=sSch/5wksUDthsaLNwHNQHxAijIb6OwKSPbl9xmbVF0=; b=pb73dXNrhv2abYwzcvtVroyfwEt5vMAXX0gE0L4mzVVryQ7YakAJYCCAEo4p0Qylwl 4G7nu46eXrIlChwqVxGsoCETfypqEyP7/osVMnrNPNmqKY0aYFyCTgQjIu310gXo3sOE sbvzGLmErpVTtSgbcYf7HLmKVnf4VQNcF49jqc5VB3Bh9DetID7JhCVRA6/It7/9tVTL m3nI1nTxyKYFnlhzGZUW4YIdHxdbxmvB+F88Ew8nAZOrd50hZxIkr2Vas7uM6u2ZLT/Q 06HlzjUi+TE1B3r1JlzkUpyPi68TeaMSfVCVstsdsMuMrnTyhZgm/hZeBn7YOG3DZk14 jqfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sSch/5wksUDthsaLNwHNQHxAijIb6OwKSPbl9xmbVF0=; b=RnKemzTHIBBoboW/SqPDDolpCLxZSuKL6g7buQyQzMK8krHNAM4MONEuybSoFClnzw bHe6gQ7VQFD2SxBeQ3HlKUyl/fkP1rvxpA3SCrF4cNq7IHhIL7EMmhB5ZSRDkvD0jXfr WElbyk5NSUcT8g3PjloraNiUuPIpM3Fi1lBR/KmSuTNb5IzwZpXSMR6fCpePP4KW2TbK PFhfLiQJezld8rIyFAyFnoOiamQFdqZ4qC58vjrY/xEkEnCRkLQQFYpqzTU4hSTN2iAS FcypDZMTo+bBJzI33Sbrrv/XoyM2wP9rhF+yJ4skhAuNVAyGjAVVwoUxuCNojjcaadro L/EQ== X-Gm-Message-State: AOAM5320p3P2NtZoiypdszMxdXzkO/MsW3a/Fi6dmX07GovsbSbCKcA8 DM2p9Qq/q9dHpjNYda91MUY= X-Google-Smtp-Source: ABdhPJxSmktWnpxP3NOD7h9yEQlwW/62KOpSdQ5Cg7L0OxXt6w4h9Cf+W/o+y2zhyd1UsQWzsuZa9g== X-Received: by 2002:a1c:2390:: with SMTP id j138mr3200930wmj.72.1615380907885; Wed, 10 Mar 2021 04:55:07 -0800 (PST) Received: from skynet.lan ([80.31.204.166]) by smtp.gmail.com with ESMTPSA id v6sm29403398wrx.32.2021.03.10.04.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 04:55:07 -0800 (PST) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: Linus Walleij , Rob Herring , Michael Walle , Bartosz Golaszewski , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Jonas Gorski , =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= , Necip Fazil Yildiran , Andy Shevchenko , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v6 01/15] gpio: guard gpiochip_irqchip_add_domain() with GPIOLIB_IRQCHIP Date: Wed, 10 Mar 2021 13:54:49 +0100 Message-Id: <20210310125504.31886-2-noltari@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210310125504.31886-1-noltari@gmail.com> References: <20210310125504.31886-1-noltari@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The current code doesn't check if GPIOLIB_IRQCHIP is enabled, which results in a compilation error when trying to build gpio-regmap if CONFIG_GPIOLIB_IRQCHIP isn't enabled. Fixes: 6a45b0e2589f ("gpiolib: Introduce gpiochip_irqchip_add_domain()") Suggested-by: Michael Walle Signed-off-by: Álvaro Fernández Rojas Reviewed-by: Linus Walleij Reviewed-by: Michael Walle --- v6: no changes v5: add missing Suggested-by tag v4: add patch (fix include instead of gpio-regmap.c) include/linux/gpio/driver.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 286de0520574..ecf0032a0995 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -624,8 +624,17 @@ void gpiochip_irq_domain_deactivate(struct irq_domain *domain, bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gc, unsigned int offset); +#ifdef CONFIG_GPIOLIB_IRQCHIP int gpiochip_irqchip_add_domain(struct gpio_chip *gc, struct irq_domain *domain); +#else +static inline int gpiochip_irqchip_add_domain(struct gpio_chip *gc, + struct irq_domain *domain) +{ + WARN_ON(1); + return -EINVAL; +} +#endif int gpiochip_generic_request(struct gpio_chip *gc, unsigned int offset); void gpiochip_generic_free(struct gpio_chip *gc, unsigned int offset);