From nobody Wed Apr 8 10:32:43 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 620DCECAAA1 for ; Fri, 2 Sep 2022 21:40:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbiIBVkb (ORCPT ); Fri, 2 Sep 2022 17:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231204AbiIBVk1 (ORCPT ); Fri, 2 Sep 2022 17:40:27 -0400 Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3291B2CCAC for ; Fri, 2 Sep 2022 14:40:19 -0700 (PDT) Received: by mail-qv1-xf36.google.com with SMTP id y17so2412172qvr.5 for ; Fri, 02 Sep 2022 14:40:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=xMrbWUY6zwIx3C/ybxag/rE7UT2Nj7W56VkoAh9Wle8=; b=NfdZGBLUYxOfd0iRQmmgqdPNUIOCNG10zN/1mBMpSNBIJfxVF84r8HKTk6fRQPssLo AqIXg+mhMMNU3RkgetY55baklrCOfNuZYxssO1m9jV7gv0Fc433K0YJ438t6kyW4NYAc 24HOTICGTo5tNhpVkerh0TaDoiXvNeQ5U/fzchE9ZabKnOwsHB9GOs4wq2S/mzVmMO3B laKfXhIrMdGMlKpEs9In+Xn2bTVGHioa03dofEAXecJMz5K60gA0km4VgfNv6L1C16Fp 2R8S9BD6Z97OrbUm47f7jc2iUZuwCb7FR4t6/8ZGgY8ufslkOLEGE9CgGjhr27mQUKuG Adrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=xMrbWUY6zwIx3C/ybxag/rE7UT2Nj7W56VkoAh9Wle8=; b=UL2DYst52xmu7OjxdKd/c73ePja6agWHmSh2bfpU0zcmWN3G7dhRAw8Rhmo8CXXFkc J3Fv9o5/OuwJnkb+gmCOnIU5spUD2esbDgnZmepD59awBFvRm4XQ2YB+cO83Sns9YVLl LNy54hCeNuZ8vxRx1SezhtlDy/N5lHVHCqudfbLQ7w8kCmkAlG4uJbk2ZHH4mde1eXN/ tZsj0Sz3Uyql6Hh/f5VNMxoAlX+dlghT7W9xzbzT7bc2mWd/tDcLzGpug/vnaMq1Nkj8 rkpv1c9zSfhOfRJZzld0JfnbCcDyHO6zJhihY5zVfUFfW4ThippPTC5OPz3Yx0x+PVDi DOaQ== X-Gm-Message-State: ACgBeo17f29LkvhA+8+Tsyd7JRxssAEGtMN8lJ8mVm7o3LuYlv4xGXg1 IB9PNSOhOxDgYuU0MIQrG/Llbg== X-Google-Smtp-Source: AA6agR6jDjhaLewM868f5dZUQDWZdeXFGETjL2RBbYT5x8nl805M4ouJtIAIOoAKWRton7fMIlMnfQ== X-Received: by 2002:a0c:ab07:0:b0:474:9c36:413e with SMTP id h7-20020a0cab07000000b004749c36413emr30915739qvb.56.1662154818756; Fri, 02 Sep 2022 14:40:18 -0700 (PDT) Received: from fedora.attlocal.net (69-109-179-158.lightspeed.dybhfl.sbcglobal.net. [69.109.179.158]) by smtp.gmail.com with ESMTPSA id 15-20020ac84e8f000000b0031f0b43629dsm1819533qtp.23.2022.09.02.14.40.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 14:40:18 -0700 (PDT) From: William Breathitt Gray To: brgl@bgdev.pl, linus.walleij@linaro.org Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, William Breathitt Gray Subject: [PATCH 1/4] gpio: 104-dio-48e: Make irq_chip immutable Date: Fri, 2 Sep 2022 13:45:23 -0400 Message-Id: X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Kernel warns about mutable irq_chips: "not an immutable chip, please consider fixing!" Make the struct irq_chip const, flag it as IRQCHIP_IMMUTABLE, add the new helper functions, and call the appropriate gpiolib functions. Signed-off-by: William Breathitt Gray --- drivers/gpio/gpio-104-dio-48e.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-104-dio-48e.c b/drivers/gpio/gpio-104-dio-48= e.c index a41551870759..74cc71bb3984 100644 --- a/drivers/gpio/gpio-104-dio-48e.c +++ b/drivers/gpio/gpio-104-dio-48e.c @@ -164,6 +164,7 @@ static void dio48e_irq_mask(struct irq_data *data) dio48egpio->irq_mask &=3D ~BIT(0); else dio48egpio->irq_mask &=3D ~BIT(1); + gpiochip_disable_irq(chip, offset); =20 if (!dio48egpio->irq_mask) /* disable interrupts */ @@ -191,6 +192,7 @@ static void dio48e_irq_unmask(struct irq_data *data) iowrite8(0x00, &dio48egpio->reg->enable_interrupt); } =20 + gpiochip_enable_irq(chip, offset); if (offset =3D=3D 19) dio48egpio->irq_mask |=3D BIT(0); else @@ -213,12 +215,14 @@ static int dio48e_irq_set_type(struct irq_data *data,= unsigned int flow_type) return 0; } =20 -static struct irq_chip dio48e_irqchip =3D { +static const struct irq_chip dio48e_irqchip =3D { .name =3D "104-dio-48e", .irq_ack =3D dio48e_irq_ack, .irq_mask =3D dio48e_irq_mask, .irq_unmask =3D dio48e_irq_unmask, - .irq_set_type =3D dio48e_irq_set_type + .irq_set_type =3D dio48e_irq_set_type, + .flags =3D IRQCHIP_IMMUTABLE, + GPIOCHIP_IRQ_RESOURCE_HELPERS, }; =20 static irqreturn_t dio48e_irq_handler(int irq, void *dev_id) @@ -322,7 +326,7 @@ static int dio48e_probe(struct device *dev, unsigned in= t id) dio48egpio->chip.set_multiple =3D dio48e_gpio_set_multiple; =20 girq =3D &dio48egpio->chip.irq; - girq->chip =3D &dio48e_irqchip; + gpio_irq_chip_set_chip(girq, &dio48e_irqchip); /* This will let us handle the parent IRQ in the driver */ girq->parent_handler =3D NULL; girq->num_parents =3D 0; --=20 2.37.2 From nobody Wed Apr 8 10:32:43 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7991C6FA86 for ; Fri, 2 Sep 2022 21:40:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230144AbiIBVkn (ORCPT ); Fri, 2 Sep 2022 17:40:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231224AbiIBVka (ORCPT ); Fri, 2 Sep 2022 17:40:30 -0400 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D18B37197 for ; Fri, 2 Sep 2022 14:40:20 -0700 (PDT) Received: by mail-qv1-xf2d.google.com with SMTP id jy14so2391475qvb.12 for ; Fri, 02 Sep 2022 14:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=+5W3kIyuKIp9hTxfCgunIN6PQveCEir/569gHMdhyOc=; b=j80KkNfzDLQPPP6jv+cQ+Yydwhz8HRQENT41Pf6dYvGrapRyr4+S4vD35MwkFID5UD knJCoiJd9cGE7jfrOB86i/HLLX805ds1QfLcCsgRubE/fwP9gaCvURLDAfWPlwUO0yFn RY5OP2vnCUuRYV1CYFrduWMtWprZ+XHFybLpXrOLT/7qLxlZ/LnL6lmUvwJvGo2OlWeU vjtog/5KK2zQglRC/YeLVMJOietAySDpFQ48GN+jnrxPAJRnSIu2VXmM4a2IGExpBlrr X2iCmLV2q1mywLlrNiQCtQ6+zKk+fi95ExuEfQ3aF8Duvpp27azmsq6TIAEfwmZbdzmO f5iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=+5W3kIyuKIp9hTxfCgunIN6PQveCEir/569gHMdhyOc=; b=OVL1GyiHQlPxRHW5nFkXxhaVbVr7MfDfzW4XcOt09e/TwYeD+RAaxsFLu0XsQVETRw sX1uSgnoqVsMIEPJHW6wHRtrjXU0NbMaHD+MtKl755sZXf7kHeiYQgDUpRpxSMre5Cd1 rq8/rXwWR5+gddO9BgMuuZBYTZ0gLdG2KlCdZtEOwih+7wasL2W3V430wZF00LlNPJMg 3iUyBTPKJr5nqIA3IYpT9YghZr6wqn0MOpLrXV348J4zkYoIBrMF4oL76r5TGofwt8II lWfFeSBoY+xwleIV34jcNMG5o/1I7nodXX/2g6wmXOua8IhAPgoWr3XCE2G8TkeO8lrV jF6g== X-Gm-Message-State: ACgBeo38HqNc51FosQuZr0fo3cjvXDLaqz6CHRAa5glogejPwG80umOW NG9ioiAc5vZ6AudNPBxL8+iAAHeDLeR07g== X-Google-Smtp-Source: AA6agR4TFJACeWR/WS95zWZP4ea+baOtunwHv3hkiI+TUYWmdBYAuBl3hVo13YauYO8E83rcId6E6Q== X-Received: by 2002:a05:6214:20a2:b0:476:9071:2e60 with SMTP id 2-20020a05621420a200b0047690712e60mr30255860qvd.110.1662154819521; Fri, 02 Sep 2022 14:40:19 -0700 (PDT) Received: from fedora.attlocal.net (69-109-179-158.lightspeed.dybhfl.sbcglobal.net. [69.109.179.158]) by smtp.gmail.com with ESMTPSA id 15-20020ac84e8f000000b0031f0b43629dsm1819533qtp.23.2022.09.02.14.40.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 14:40:19 -0700 (PDT) From: William Breathitt Gray To: brgl@bgdev.pl, linus.walleij@linaro.org Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, William Breathitt Gray Subject: [PATCH 2/4] gpio: 104-idi-48: Make irq_chip immutable Date: Fri, 2 Sep 2022 13:45:24 -0400 Message-Id: X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Kernel warns about mutable irq_chips: "not an immutable chip, please consider fixing!" Make the struct irq_chip const, flag it as IRQCHIP_IMMUTABLE, add the new helper functions, and call the appropriate gpiolib functions. Signed-off-by: William Breathitt Gray --- drivers/gpio/gpio-104-idi-48.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-104-idi-48.c b/drivers/gpio/gpio-104-idi-48.c index 40be76efeed7..3286b914a2cf 100644 --- a/drivers/gpio/gpio-104-idi-48.c +++ b/drivers/gpio/gpio-104-idi-48.c @@ -113,6 +113,7 @@ static void idi_48_irq_mask(struct irq_data *data) spin_lock_irqsave(&idi48gpio->lock, flags); =20 idi48gpio->irq_mask[boundary] &=3D ~mask; + gpiochip_disable_irq(chip, offset); =20 /* Exit early if there are still input lines with IRQ unmasked */ if (idi48gpio->irq_mask[boundary]) @@ -140,6 +141,7 @@ static void idi_48_irq_unmask(struct irq_data *data) =20 prev_irq_mask =3D idi48gpio->irq_mask[boundary]; =20 + gpiochip_enable_irq(chip, offset); idi48gpio->irq_mask[boundary] |=3D mask; =20 /* Exit early if IRQ was already unmasked for this boundary */ @@ -164,12 +166,14 @@ static int idi_48_irq_set_type(struct irq_data *data,= unsigned int flow_type) return 0; } =20 -static struct irq_chip idi_48_irqchip =3D { +static const struct irq_chip idi_48_irqchip =3D { .name =3D "104-idi-48", .irq_ack =3D idi_48_irq_ack, .irq_mask =3D idi_48_irq_mask, .irq_unmask =3D idi_48_irq_unmask, - .irq_set_type =3D idi_48_irq_set_type + .irq_set_type =3D idi_48_irq_set_type, + .flags =3D IRQCHIP_IMMUTABLE, + GPIOCHIP_IRQ_RESOURCE_HELPERS, }; =20 static irqreturn_t idi_48_irq_handler(int irq, void *dev_id) @@ -267,7 +271,7 @@ static int idi_48_probe(struct device *dev, unsigned in= t id) idi48gpio->chip.get_multiple =3D idi_48_gpio_get_multiple; =20 girq =3D &idi48gpio->chip.irq; - girq->chip =3D &idi_48_irqchip; + gpio_irq_chip_set_chip(girq, &idi_48_irqchip); /* This will let us handle the parent IRQ in the driver */ girq->parent_handler =3D NULL; girq->num_parents =3D 0; --=20 2.37.2 From nobody Wed Apr 8 10:32:43 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D920DC6FA82 for ; Fri, 2 Sep 2022 21:40:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231199AbiIBVk1 (ORCPT ); Fri, 2 Sep 2022 17:40:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbiIBVkY (ORCPT ); Fri, 2 Sep 2022 17:40:24 -0400 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A304038476 for ; Fri, 2 Sep 2022 14:40:21 -0700 (PDT) Received: by mail-qk1-x730.google.com with SMTP id g16so2728008qkl.11 for ; Fri, 02 Sep 2022 14:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=bR3hEleHn1hDXjDK6nUjMSvBYEAsUeJzCzyUGuVERRQ=; b=wuzCTnre6tTsSegsWv8KZyKcXhhqdhcG6fFIvRHpUAcFTLq9edlgDAeNCrP1BZBuQs +snDeAgYpQ9ou4o7gjLmO4qAPCuMqjAMbSPDH6nE3m4Wt26glIh+Q+WnQ8h2JPbH743C XofCCIy/C62BWw7Gz4ktIrZQqvhlIuwS7utzOIyMLVq6TDdCeNhT05Niap6zzINjxe9d VRnsUCafjeFcUtRGslnzqSsXeskPb0D729WRKiT3jNNohcyEJmY1jMASfZ0wmaKpZmpH seXeBDvkWD9yhDdZJxHZ8g6wAsmC/bSfQs1ikHOQO7BCPMuu2XRckAw5U3BgMDCidcWo 28Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=bR3hEleHn1hDXjDK6nUjMSvBYEAsUeJzCzyUGuVERRQ=; b=otOpNwzsYl5yBZVtiQZInKQJK7O1I4Marin2cMCGr63lbXd7+tbKTnDsYCPu896Q9k PB2Rt4DEsS+jfbDPP/Nh8opQe7VDVOIbqUX10gtgEZQXjDYOQn6MTofNCWPr6uiimsvy mRkmXM0ml9zMxogBgc93yhVJeQWImLcgvNeHJp8ADVzkuw2OmKJQv3IPZimN2iXXGd2s UksXU1R91w9L0AarI536t1OXJp6v0OVfXD4lPEg3Ttc42XzAROwmqFcyP/BALy8gbKII ZcELQ1Zhh1SfTLQmIlY6LG/jyVpmns3fIvhUuaTAYuoDYuzvRo5kNDQb0T6ZwNN9E06a 9oMg== X-Gm-Message-State: ACgBeo0TcNqVP2nmfAhUrZg2DmzFblvv+qFJOftiMow7EZf9DGo5Gk9V aebcq1vQI/P+cnHKehxdmhyEh4RtDOrhBA== X-Google-Smtp-Source: AA6agR5GjIxXkb/bcDLBsnO3UPU6jpE1pq17eJNvvjhLBlYBn3BCFQ7DqD21u9qoZ70EX7rLo01JsA== X-Received: by 2002:a05:620a:4094:b0:6bb:8514:9c84 with SMTP id f20-20020a05620a409400b006bb85149c84mr24438491qko.134.1662154820356; Fri, 02 Sep 2022 14:40:20 -0700 (PDT) Received: from fedora.attlocal.net (69-109-179-158.lightspeed.dybhfl.sbcglobal.net. [69.109.179.158]) by smtp.gmail.com with ESMTPSA id 15-20020ac84e8f000000b0031f0b43629dsm1819533qtp.23.2022.09.02.14.40.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 14:40:20 -0700 (PDT) From: William Breathitt Gray To: brgl@bgdev.pl, linus.walleij@linaro.org Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, William Breathitt Gray , Frede@cmslaser.com Subject: [PATCH 3/4] gpio: 104-idio-16: Make irq_chip immutable Date: Fri, 2 Sep 2022 13:45:25 -0400 Message-Id: <1a97e3f21f695f238fad9366e5976694b41a5da0.1662140119.git.william.gray@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Kernel warns about mutable irq_chips: "not an immutable chip, please consider fixing!" Make the struct irq_chip const, flag it as IRQCHIP_IMMUTABLE, add the new helper functions, and call the appropriate gpiolib functions. Signed-off-by: William Breathitt Gray --- drivers/gpio/gpio-104-idio-16.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/gpio/gpio-104-idio-16.c b/drivers/gpio/gpio-104-idio-1= 6.c index 65a5f581d981..4756e583f223 100644 --- a/drivers/gpio/gpio-104-idio-16.c +++ b/drivers/gpio/gpio-104-idio-16.c @@ -174,10 +174,11 @@ static void idio_16_irq_mask(struct irq_data *data) { struct gpio_chip *chip =3D irq_data_get_irq_chip_data(data); struct idio_16_gpio *const idio16gpio =3D gpiochip_get_data(chip); - const unsigned long mask =3D BIT(irqd_to_hwirq(data)); + const unsigned long offset =3D irqd_to_hwirq(data); unsigned long flags; =20 - idio16gpio->irq_mask &=3D ~mask; + idio16gpio->irq_mask &=3D ~BIT(offset); + gpiochip_disable_irq(chip, offset); =20 if (!idio16gpio->irq_mask) { raw_spin_lock_irqsave(&idio16gpio->lock, flags); @@ -192,11 +193,12 @@ static void idio_16_irq_unmask(struct irq_data *data) { struct gpio_chip *chip =3D irq_data_get_irq_chip_data(data); struct idio_16_gpio *const idio16gpio =3D gpiochip_get_data(chip); - const unsigned long mask =3D BIT(irqd_to_hwirq(data)); + const unsigned long offset =3D irqd_to_hwirq(data); const unsigned long prev_irq_mask =3D idio16gpio->irq_mask; unsigned long flags; =20 - idio16gpio->irq_mask |=3D mask; + gpiochip_enable_irq(chip, offset); + idio16gpio->irq_mask |=3D BIT(offset); =20 if (!prev_irq_mask) { raw_spin_lock_irqsave(&idio16gpio->lock, flags); @@ -217,12 +219,14 @@ static int idio_16_irq_set_type(struct irq_data *data= , unsigned int flow_type) return 0; } =20 -static struct irq_chip idio_16_irqchip =3D { +static const struct irq_chip idio_16_irqchip =3D { .name =3D "104-idio-16", .irq_ack =3D idio_16_irq_ack, .irq_mask =3D idio_16_irq_mask, .irq_unmask =3D idio_16_irq_unmask, - .irq_set_type =3D idio_16_irq_set_type + .irq_set_type =3D idio_16_irq_set_type, + .flags =3D IRQCHIP_IMMUTABLE, + GPIOCHIP_IRQ_RESOURCE_HELPERS, }; =20 static irqreturn_t idio_16_irq_handler(int irq, void *dev_id) @@ -299,7 +303,7 @@ static int idio_16_probe(struct device *dev, unsigned i= nt id) idio16gpio->out_state =3D 0xFFFF; =20 girq =3D &idio16gpio->chip.irq; - girq->chip =3D &idio_16_irqchip; + gpio_irq_chip_set_chip(girq, &idio_16_irqchip); /* This will let us handle the parent IRQ in the driver */ girq->parent_handler =3D NULL; girq->num_parents =3D 0; --=20 2.37.2 From nobody Wed Apr 8 10:32:43 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1863C6FA82 for ; Fri, 2 Sep 2022 21:40:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231279AbiIBVks (ORCPT ); Fri, 2 Sep 2022 17:40:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbiIBVkb (ORCPT ); Fri, 2 Sep 2022 17:40:31 -0400 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0BF43E744 for ; Fri, 2 Sep 2022 14:40:22 -0700 (PDT) Received: by mail-qk1-x736.google.com with SMTP id f14so2805681qkm.0 for ; Fri, 02 Sep 2022 14:40:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=a/6y1tnbijdXc5qSMdd4IK5j90OSsiP2sEjvKMKEBTI=; b=K6w/ph2YvbrAoqqGMdDTbzaJxkU/GCskA/gO5HYUyptfDzMuD/PCZN1AbjYE3Gz7kp 4qog5itKarci+dzN0DwAog50b8cVEWazuo1qmQbyjZzx4E7UdlnoZWRUB/dwB5pHj3v8 dqf50X1ggz6hSRBfL7zG0xJ6GyDhVmlADQKfkdiJUXCX4J4Wu51qxWaHi5XmELZEqF+3 KOdG549A38ufAzxL+PHq59/SFtS3W4i9tr9FaiKwl7dyXHUpYW7EXoBAoKMWyWLMRs0r X2dref2ucuJ9yK/mW1v3ZguZpL9hmvpWKa64EWt++3TyJTjV0/wCRB8Ef5MH1ai19vZh txcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=a/6y1tnbijdXc5qSMdd4IK5j90OSsiP2sEjvKMKEBTI=; b=7GMrfvqK0xwbCs0LP4VPFsodQTn9ECriqZR4xL+oaU+2uz1HRS1GVTctW5tgIBKNJl cOZKtu7TGXj1PXOJ64OXGESQO+lBN4gBhcsT2ysR9cqsz5AT6dxL65t8iqnW4iFOWCoX Wo/17K20BofpbgQjyQdCn3eLJb9ac/uDy/AzHwU38xe7rM1jNLIU7uZvGPuzXW7tt3jb tvLS6uHIRZyhHec1vYBJ7V7bIEGxN8oRwlQtSXiUHEhtvj5U/fRwd3r76iHcv3s57T4N /bfLImodFFoRnYn0Ygu2vesZrdFL53bxP8pFMHa5Zyq/ICHTmLRzIvd9T02s/DOAWrax V8VQ== X-Gm-Message-State: ACgBeo3r6J2f5pZ/G7iPqh7i7f6AD3U5s2iNBUIWEpAyUO4BIo4KFCgZ aASmQZv/0+Kvif1LmDYc3wR12A== X-Google-Smtp-Source: AA6agR6OyuWkqksbnk9o2odwFhmHjE3fR48VDFM11LQr6zwHpcQ+2cXpaK5b2lZ0sKIUAtzPPBNrgA== X-Received: by 2002:ae9:e841:0:b0:6b9:c69e:ac99 with SMTP id a62-20020ae9e841000000b006b9c69eac99mr24436570qkg.450.1662154821173; Fri, 02 Sep 2022 14:40:21 -0700 (PDT) Received: from fedora.attlocal.net (69-109-179-158.lightspeed.dybhfl.sbcglobal.net. [69.109.179.158]) by smtp.gmail.com with ESMTPSA id 15-20020ac84e8f000000b0031f0b43629dsm1819533qtp.23.2022.09.02.14.40.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Sep 2022 14:40:20 -0700 (PDT) From: William Breathitt Gray To: brgl@bgdev.pl, linus.walleij@linaro.org Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, William Breathitt Gray Subject: [PATCH 4/4] gpio: ws16c48: Make irq_chip immutable Date: Fri, 2 Sep 2022 13:45:26 -0400 Message-Id: X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Kernel warns about mutable irq_chips: "not an immutable chip, please consider fixing!" Make the struct irq_chip const, flag it as IRQCHIP_IMMUTABLE, add the new helper functions, and call the appropriate gpiolib functions. Signed-off-by: William Breathitt Gray --- drivers/gpio/gpio-ws16c48.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-ws16c48.c b/drivers/gpio/gpio-ws16c48.c index b098f2dc196b..59fb10641598 100644 --- a/drivers/gpio/gpio-ws16c48.c +++ b/drivers/gpio/gpio-ws16c48.c @@ -265,6 +265,7 @@ static void ws16c48_irq_mask(struct irq_data *data) raw_spin_lock_irqsave(&ws16c48gpio->lock, flags); =20 ws16c48gpio->irq_mask &=3D ~mask; + gpiochip_disable_irq(chip, offset); port_state =3D ws16c48gpio->irq_mask >> (8 * port); =20 /* Select Register Page 2; Unlock all I/O ports */ @@ -295,6 +296,7 @@ static void ws16c48_irq_unmask(struct irq_data *data) =20 raw_spin_lock_irqsave(&ws16c48gpio->lock, flags); =20 + gpiochip_enable_irq(chip, offset); ws16c48gpio->irq_mask |=3D mask; port_state =3D ws16c48gpio->irq_mask >> (8 * port); =20 @@ -356,12 +358,14 @@ static int ws16c48_irq_set_type(struct irq_data *data= , unsigned flow_type) return 0; } =20 -static struct irq_chip ws16c48_irqchip =3D { +static const struct irq_chip ws16c48_irqchip =3D { .name =3D "ws16c48", .irq_ack =3D ws16c48_irq_ack, .irq_mask =3D ws16c48_irq_mask, .irq_unmask =3D ws16c48_irq_unmask, - .irq_set_type =3D ws16c48_irq_set_type + .irq_set_type =3D ws16c48_irq_set_type, + .flags =3D IRQCHIP_IMMUTABLE, + GPIOCHIP_IRQ_RESOURCE_HELPERS, }; =20 static irqreturn_t ws16c48_irq_handler(int irq, void *dev_id) @@ -463,7 +467,7 @@ static int ws16c48_probe(struct device *dev, unsigned i= nt id) ws16c48gpio->chip.set_multiple =3D ws16c48_gpio_set_multiple; =20 girq =3D &ws16c48gpio->chip.irq; - girq->chip =3D &ws16c48_irqchip; + gpio_irq_chip_set_chip(girq, &ws16c48_irqchip); /* This will let us handle the parent IRQ in the driver */ girq->parent_handler =3D NULL; girq->num_parents =3D 0; --=20 2.37.2