Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp978615rwb; Thu, 18 Aug 2022 16:14:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR5TaOP5XDP1p53CrXJj2DnEzwmnBEKsuauVIqHBsV7EnaThJxjRB/QsCZQQg17yqHuwBeJf X-Received: by 2002:a17:902:f641:b0:172:9642:1bf1 with SMTP id m1-20020a170902f64100b0017296421bf1mr4662990plg.36.1660864453167; Thu, 18 Aug 2022 16:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660864453; cv=none; d=google.com; s=arc-20160816; b=E4qaH4dAUlzhAuPf0h/duU8URvVp5PPPPUydkBw+e4Tr5kWh5+88JWSCAuR2aYM12y jhKDeG0NhdeVWqoP5wu5rhsByYLcOoDe0OyJVgH3bi3ERWRy/3R4pVFjQ+s16zDG9QuM aMLKkElsVLbTRSjm8ySGRo9RZkljO5YXRFTc5UKdcbgdy2zCW1SEkPDvFrKV0ew6JF02 2x8DJIinEORt5wn1oDdaYdL0e5IMshDcyiTu2aGC4WUQ6LaUCzc6tr7uQmjRN6K1hT2y eEIi1F4s/KBQDLm8Pm7cDAosrF4f9r1z3CnkSpUbhqpkkDQ5Qnp/Bs4fbspbxb4ByTRp zUOQ== 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=qjb4UgDhX3ydD5kec1iqNaG0SI9GdLWkjzQByMg9NrQ=; b=UCrMsqHArJEzO/Lz4D/1tWWxjRATeAfsMae49i1K3hjRAm6eZ7WaNIX0PyGuXjMM0J 5QTvknJh4LSZ8CZtUMaZYmvJchx3k94qcSrcseledHSRcDhYH+MB1+VMa7iF+l2/CaT/ Es3Ceh2lSucZEY8kEFjf7IHqmuohIc783+ayeuGZ94rA4sku1QCkmAlunFvHpG9UgLRK 6HgewNaE1VRVQMXZ2sCB3l0PcOf2UQshiZu0RkF1/1FoBmcz5S08cTjEbBKloSncntRi b+P+MLNqMgl8UgnRyDAXn7+YHABoBDwXAPIbpkOPXUYwz/hfkSB3X2ExbXAG49RKzs4A al9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="g8/ws7q7"; 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 o6-20020a1709026b0600b0016a3102f8dbsi2304323plk.0.2022.08.18.16.14.01; Thu, 18 Aug 2022 16:14:13 -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="g8/ws7q7"; 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 S245051AbiHRXM0 (ORCPT + 99 others); Thu, 18 Aug 2022 19:12:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241453AbiHRXMC (ORCPT ); Thu, 18 Aug 2022 19:12:02 -0400 Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A5D0CE4B1 for ; Thu, 18 Aug 2022 16:12:02 -0700 (PDT) Received: by mail-qv1-xf30.google.com with SMTP id c5so1851938qvt.11 for ; Thu, 18 Aug 2022 16:12:02 -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=qjb4UgDhX3ydD5kec1iqNaG0SI9GdLWkjzQByMg9NrQ=; b=g8/ws7q79GlxKc5ucYMbw++jeXfp2K0Zi95QP/YtmX6Yfo1D77X9pgZaA364BqaTb0 tVbbfNI29WLDLiND5lK2Pd01q/I4AOvpmhmwjeNrzZNE2RMwF9py4MGc8rpP4XA1PO5x y+4f5NwFlti42304Z37C0BiqrocI2QmE9PCxKjEGirzad6jfdow9Xg6UdJwev86mqXjl CqFmaHeAYSOO+Amv2C+q4uTsN+QA5j4jeOz+feIoApm9MlAKnssj2B4EcH5jfWGQlyom +xw9eCaxrGNFgtU5NHwGacbTLUUPgVSnW7lq4iTeKvc51EWdanartn3UFWU5QNpEoLbh b5gA== 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=qjb4UgDhX3ydD5kec1iqNaG0SI9GdLWkjzQByMg9NrQ=; b=3OTy0EARI2N8WCW7uHJ6hkKCKtDqJTsWcW5hdNxj/egLzb4YLZqR6J8bSiwUAULSfV dGvBe3SC8QErp6chm+LnuGBmFcQ+3+1YB5wuaBcTCjyHLSyT8XxwYv7RruzNRJgSpgfK BB5h6SgYXBrtCJnawMr0Syku0NWLHBVUd10z1gLaW3t1OBdniYnPKYg2x6O0ImuN51gL n4zLB+6LYZrZEgo5bYolvXEkgHRwNpgsxRIBwHbAD7mzqTVRYLMtA7dZ8cSboY/A0QN2 L0F2+avShltXq/qsV0sS+dZb3K0HVFvf+A7lLpSRFUNQSNBLvGXBPFKK+78OPHbYPCAQ ivGg== X-Gm-Message-State: ACgBeo03XqlWuQtV0UAIwZAVPV5n1BnziKjQJRT6jDdDmcDgpN0hwgja EPzfsiGQB2uoN/a/VcasO93GXg== X-Received: by 2002:a0c:e246:0:b0:491:d36e:e3c9 with SMTP id x6-20020a0ce246000000b00491d36ee3c9mr4445052qvl.68.1660864321248; Thu, 18 Aug 2022 16:12:01 -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.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 16:12:01 -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 5/6] gpio: 104-idio-16: Ensure number of irq matches number of base Date: Thu, 18 Aug 2022 12:28:14 -0400 Message-Id: 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-idio-16 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-idio-16.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-104-idio-16.c b/drivers/gpio/gpio-104-idio-16.c index 65a5f581d981..73d95b55a8c5 100644 --- a/drivers/gpio/gpio-104-idio-16.c +++ b/drivers/gpio/gpio-104-idio-16.c @@ -30,7 +30,8 @@ module_param_hw_array(base, uint, ioport, &num_idio_16, 0); MODULE_PARM_DESC(base, "ACCES 104-IDIO-16 base addresses"); static unsigned int irq[MAX_NUM_IDIO_16]; -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-IDIO-16 interrupt line numbers"); /** @@ -333,7 +334,7 @@ static struct isa_driver idio_16_driver = { }, }; -module_isa_driver(idio_16_driver, num_idio_16); +module_isa_driver_with_irq(idio_16_driver, num_idio_16, num_irq); MODULE_AUTHOR("William Breathitt Gray "); MODULE_DESCRIPTION("ACCES 104-IDIO-16 GPIO driver"); -- 2.37.2