Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp978266rwb; Thu, 18 Aug 2022 16:13:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR523joHlAXD8S0UHJuaM6UUZI8w4sBlCI0DnNLWM7eD/OJSqsCL0+nov9ok77lHb2ZhIWyN X-Received: by 2002:a17:90a:d02:b0:1fa:c715:30dc with SMTP id t2-20020a17090a0d0200b001fac71530dcmr5260356pja.120.1660864424489; Thu, 18 Aug 2022 16:13:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660864424; cv=none; d=google.com; s=arc-20160816; b=ItVe9zrKcY3+OSInIQ2yEQ730fgpDYgY+BJymY0a9jHzNyXx4uaK1Aax3Ez59zwxel KmCWPOSXqYGOBouRkEuFjwSArU4vT+teaNrA4Qv5BbEg34S1EsgSx/tbZ3ndjHwK8G6G FjSlA8+AoEyre1wIoPZ3qNLYbjyA8bLflwBELsO4hcnjw0tAePO95d2zFxiWRRr9jk2G ss39gFkHbPW+5s5I8DqlpzX4O6Fms/rtopIAS9fMZ2LlCisPpfaQvqOqvAixLaMPKcd3 t0dY6q0J8kJcZBbwx55SSkBuFr86nAqik5o/eiePkuT3LJJ6qa9cEie1iO9gsMQQVxYo W9Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MsO4YVqRB/LxYJYvW/oS7wwQWO4uPdmi9GWambEMbVo=; b=lNTeNcJJchoJzZl9FzmsD2WkB2UGbhE4Rm1c+EIcr0VQLx1UUPeaY0PTPteLURkFJf jD3X1CLuZKq+X0xaue2KwbyyZKcOLt7oPVdfKXiNjkFWuC/BahUbT/XDaXQnl3fJpGKW cDTTBmPlc8eUgIygd9oynXeUbQUh5NkZCtMkqdcrcnxKi/ZMW/Tj0DEE+hvQ5a2RhRJ1 3tgVtWlOADy/8dfehV50jeXFas1V4O/TiTCTy8s9fXF8bwfNGljRULblat0r6H0i3ROK oB/01wejnY2i5G2KWGAF3LYPPO0BdHg7R+d0UyMMtBV3Z4EWdIswQbGrRKX5sXInvS6i hRfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=naQCv8X6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x10-20020a65538a000000b0041286c0c381si126691pgq.270.2022.08.18.16.13.33; Thu, 18 Aug 2022 16:13:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=naQCv8X6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S1345726AbiHRXMU (ORCPT + 99 others); Thu, 18 Aug 2022 19:12:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344032AbiHRXMB (ORCPT ); Thu, 18 Aug 2022 19:12:01 -0400 Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47E07CE474 for ; Thu, 18 Aug 2022 16:12:01 -0700 (PDT) Received: by mail-qv1-xf2f.google.com with SMTP id mz1so2278918qvb.4 for ; Thu, 18 Aug 2022 16:12:01 -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; bh=MsO4YVqRB/LxYJYvW/oS7wwQWO4uPdmi9GWambEMbVo=; b=naQCv8X64zCQp8iIgBZaU+rAQz2523+/kBGlVj5Q/er2cqxiqXtVK/rttKDQlgSFAp 5zY081jcutGekPFCjJC3mdWkjxpiYXKUyc0ZYDvkrtW+Vg+x/WANRZ0hlIU6uwWpNwuz RrrDt1N/XTjrTkqZTIFrNZ7/cjjNUeUOeGz8DCfUVgoBhV+fZPEpWJsOXQzTQCahcqkO o8r0Z16LHk7vzB65br/pItrm+Z4Es9BBXZOEl93h9SmX+nhTME44hKQv+JAoC5FEd6b5 vTd3ZR0MaEr8ViEVZpbwiWlIWXWdIHCGboGIeRVbI0NZAuXqo3360OGeyu4UFe1QrV7G x0ZA== 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; bh=MsO4YVqRB/LxYJYvW/oS7wwQWO4uPdmi9GWambEMbVo=; b=PxdGJbFN9EY04kOV2Okn09GvGfrW0nitsww1NGkp3+Mw2xNhmAgOzPsHkcD+CrjOJf ez3sFR/qXiferdUxJl3KXV4Zn3+FhrGDtCM9zW+XepH0nsEn4CnpjL853NbxvgFLDlH/ AKkmGHOV6rkHp6NMbG8zZQvUMVw0czmNjAsgDN1mqJkcy7vT+/Rh7BDN/V1yR1bkGVxZ NjSCDiuHqrY2ZYpBbjCYvAqKd3xZyUP8D9EbI25K8Z/bjmuFUZ6JvLJoKkOPvf3XN/Dk 0UrPxmS2rEFNmKorZUomE8G542cJj5VZGPfo4cfzcamxfz+5LTjIJNA5oFQYNqv5Tcw0 VfQg== X-Gm-Message-State: ACgBeo1Y1eWMIVq6+JPcDiv5cwObucPgreUVjyo9539CB9674SQ8IkSM QExqzgNDCGGsrtnN8qW0AjyVog== X-Received: by 2002:a05:6214:5287:b0:476:7938:5b76 with SMTP id kj7-20020a056214528700b0047679385b76mr4454411qvb.131.1660864320495; Thu, 18 Aug 2022 16:12:00 -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 h16-20020a05620a245000b006b5f06186aesm2864801qkn.65.2022.08.18.16.11.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 16:12:00 -0700 (PDT) From: William Breathitt Gray To: linux-iio@vger.kernel.or, linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linus.walleij@linaro.org, brgl@bgdev.pl, William Breathitt Gray Subject: [PATCH 4/6] gpio: 104-idi-48: Ensure number of irq matches number of base Date: Thu, 18 Aug 2022 12:28:13 -0400 Message-Id: <0b7dbb8b35bc2b685fae5ce66ccee5b7c4a1fdc6.1660839809.git.william.gray@linaro.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DATE_IN_PAST_06_12, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 104-idi-48 module calls devm_request_irq() for each device. If the number of irq passed to the module does not match the number of base, a default value of 0 is passed to devm_request_irq(). IRQ 0 is probably not what the user wants, so utilize the module_isa_driver_with_irq macro to ensure the number of irq matches the number of base. Signed-off-by: William Breathitt Gray --- drivers/gpio/gpio-104-idi-48.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-104-idi-48.c b/drivers/gpio/gpio-104-idi-48.c index 40be76efeed7..2b0256eefb70 100644 --- a/drivers/gpio/gpio-104-idi-48.c +++ b/drivers/gpio/gpio-104-idi-48.c @@ -34,7 +34,8 @@ module_param_hw_array(base, uint, ioport, &num_idi_48, 0); MODULE_PARM_DESC(base, "ACCES 104-IDI-48 base addresses"); static unsigned int irq[MAX_NUM_IDI_48]; -module_param_hw_array(irq, uint, irq, NULL, 0); +static unsigned int num_irq; +module_param_hw_array(irq, uint, irq, &num_irq, 0); MODULE_PARM_DESC(irq, "ACCES 104-IDI-48 interrupt line numbers"); /** @@ -300,7 +301,7 @@ static struct isa_driver idi_48_driver = { .name = "104-idi-48" }, }; -module_isa_driver(idi_48_driver, num_idi_48); +module_isa_driver_with_irq(idi_48_driver, num_idi_48, num_irq); MODULE_AUTHOR("William Breathitt Gray "); MODULE_DESCRIPTION("ACCES 104-IDI-48 GPIO driver"); -- 2.37.2