From patchwork Tue Sep 12 09:45:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 721895 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 B88EBCA0EC3 for ; Tue, 12 Sep 2023 09:45:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231986AbjILJpa (ORCPT ); Tue, 12 Sep 2023 05:45:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231653AbjILJpa (ORCPT ); Tue, 12 Sep 2023 05:45:30 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C7C4E5F for ; Tue, 12 Sep 2023 02:45:26 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4018af1038cso58996775e9.0 for ; Tue, 12 Sep 2023 02:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1694511924; x=1695116724; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QUhS3M1t0YAyFz1IeQjV7tM/jIx87sSwaSY8W7cUf6Q=; b=YB7M7QUuZ72DzNgN9ZL1r95h7PdJ8CVKpPl8pTbxt9IXW4eE1+8fFBc+F/Bbz8rmJN HJGdgj+YSim4igJtPeugyDP9MPAgGszjn6jwiOfGpaxAwToh7opWF9AvZj7cK0OryA3P NdIXKMumyvFNNG4zlDDfOtKFGHXKa3nsBKgy36bjO4mGu+EY0sAJ1qBQZn+PrsBiK0j8 kw2pT2/sd3p6ELAIOsjv9+c7ArxeZMuAfQUl7864qfz7XSByX6CxcqWHck9gvZTGF1Xl 8Qnm8sKhNhFPO/YlN9zxac88wZut0WzwHORKxoLLx58Kg0O7PJlpTIMavGeVnqgaoUGK Kmsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694511924; x=1695116724; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QUhS3M1t0YAyFz1IeQjV7tM/jIx87sSwaSY8W7cUf6Q=; b=AgH3e8orHaVChY78WQkKf734YO7MT1x8DiPjbm4GJcbOEnWmLrks7deS/j1QzMDfJo rx85oYcX3o4j/SXdip7pLOcIiK4g76JSNsIO6TXk7nwDht+HTz42SDEAW0iLrRJQXzKt yFlB2rzmrPeSBWPXS/y037m7/VA2RZVPvDm8BJgMLQE0dIS/aB/Uz+1hUgHe9z0fCjaM HqpwngT+kILa494cM7C0sOyQet3HRH6eZlzpn4Sx9VDsQSYKrrRME6FgdrnCuBdXatmn SYhfm/7u0P+KIcQVjNprQZSHV7yROOcaougk+q+8/pyTjN9eqyXvwXQ5DNbxHLRGi+RV CS5w== X-Gm-Message-State: AOJu0YwqkG3zsLMdnFFpmXPuKgU7uDPKT/r949/zhfb+06RaS4n6b/D9 w6ryIZB31IrL7FztSqN/EFZcvA== X-Google-Smtp-Source: AGHT+IFnpsyjAydzu7TqtVX3XHlz40yYZmEQhdjvwMmZf6t4zmYWORi8e2LUbKdkvsfumGt1b7GWdg== X-Received: by 2002:a1c:7516:0:b0:401:519:c5 with SMTP id o22-20020a1c7516000000b00401051900c5mr11209589wmc.41.1694511924547; Tue, 12 Sep 2023 02:45:24 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:907f:4cd7:f0ae:6b2a]) by smtp.gmail.com with ESMTPSA id f11-20020a7bc8cb000000b003fefb94ccc9sm12321621wml.11.2023.09.12.02.45.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 02:45:24 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Andy Shevchenko , Orson Zhai , Baolin Wang , Chunyan Zhang Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [RFT PATCH 1/3] gpio: eic-sprd: unregister from the irq notifier on remove() Date: Tue, 12 Sep 2023 11:45:17 +0200 Message-Id: <20230912094519.22769-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Bartosz Golaszewski This is a tristate module, it can be unloaded. We need to cleanup properly and unregister from the interrupt notifier on driver detach. Fixes: b32415652a4d ("gpio: eic-sprd: use atomic notifiers to notify all chips about irqs") Signed-off-by: Bartosz Golaszewski Reviewed-by: Baolin Wang --- drivers/gpio/gpio-eic-sprd.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c index 21a1afe358d6..9b2f9ccf8d77 100644 --- a/drivers/gpio/gpio-eic-sprd.c +++ b/drivers/gpio/gpio-eic-sprd.c @@ -580,6 +580,14 @@ static const struct irq_chip sprd_eic_irq = { .flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_IMMUTABLE, GPIOCHIP_IRQ_RESOURCE_HELPERS, }; + +static void sprd_eic_unregister_notifier(void *data) +{ + struct notifier_block *nb = data; + + atomic_notifier_chain_unregister(&sprd_eic_irq_notifier, nb); +} + static int sprd_eic_probe(struct platform_device *pdev) { const struct sprd_eic_variant_data *pdata; @@ -658,8 +666,15 @@ static int sprd_eic_probe(struct platform_device *pdev) } sprd_eic->irq_nb.notifier_call = sprd_eic_irq_notify; - return atomic_notifier_chain_register(&sprd_eic_irq_notifier, - &sprd_eic->irq_nb); + ret = atomic_notifier_chain_register(&sprd_eic_irq_notifier, + &sprd_eic->irq_nb); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "Failed to register with the interrupt notifier"); + + return devm_add_action_or_reset(&pdev->dev, + sprd_eic_unregister_notifier, + &sprd_eic->irq_nb); } static const struct of_device_id sprd_eic_of_match[] = { From patchwork Tue Sep 12 09:45:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 722359 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 2ACE1CA0ECA for ; Tue, 12 Sep 2023 09:45:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229447AbjILJpc (ORCPT ); Tue, 12 Sep 2023 05:45:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231653AbjILJpb (ORCPT ); Tue, 12 Sep 2023 05:45:31 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 059BC1BE for ; Tue, 12 Sep 2023 02:45:27 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-402d499580dso57234805e9.1 for ; Tue, 12 Sep 2023 02:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1694511925; x=1695116725; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YRfuFIUTW49Hn8fWElGMAq5X0mzuQbDvwqoF+LsNH1c=; b=AzCvBvRlzzVCBYkRQXi+Zr0BEPi2LfpY2SCVXGSST5wtVcYv0UqHjjaOw8ojdfhzRX IClnlLFkyYS6QcXQxmSfKAxseC1fCRhayVWbFZwq0puFZm0BoOnlmMg8sHKrcVEGgGR0 esceqyKjImswr7arpwBTW7mEJOCe7wSFHgFw902cFOrGnRXkDYCpFjGlUVx96jU+Ydm+ o+YRw+JYDe1I9gJv6hqIguhIQA1pCRu+iJGrTXpL+moNpeUWwr8XRttAcDMmUpxKJcdm pPTF4PMAa3Yj2D8pJ/AMmMLAAKk89J8kys3sCCaxS9oCydtHKNzfitnnqYvSscWnzIJ6 +8aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694511925; x=1695116725; 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:message-id:reply-to; bh=YRfuFIUTW49Hn8fWElGMAq5X0mzuQbDvwqoF+LsNH1c=; b=bKS3nSYw49toxQyLWRfxpE8hNd7imh870BqzG41JyPH2j3FAlUO/IlQ9jWnnZjjri4 AYyterEVkAqSyscv92k7xxvhjvvyMHPCJ7/APUSqf8mC0nVihs83iZq46cOgWTlTgHiD AR1Oj34gdhf9LQWx16CQOVq1w3nPTDcA0BFodQ6fM//ipoPaLwMn7vZu9aBOa3HeoHBp rwQMQSCD5muCeF6lkH63V6mVz+3ice1M8Tlk5W6S7i1sUBxZBjUAy4U1vA0k05EhkFCz LLE67H16FFKW4e6HEy4mFOZYhwXNpEpgiPKGpINiZtOOaCoLpIosMntNMWYcdUBdAhsr UEpw== X-Gm-Message-State: AOJu0YyGVM7mTgMp4h6wx/qUOlW8BbSWipmGteEb+SHLjPK1RGyBmYxv EKWs7qUIO4LojMB4oNAr6M6Zkg== X-Google-Smtp-Source: AGHT+IHtU50UsHXBxjl0VqDc3YeHj5oGlnYl90snSXH3GDk9o6Txx8JXskrddyi08MxGXuanMqYylA== X-Received: by 2002:a1c:7206:0:b0:402:ceb:ca5b with SMTP id n6-20020a1c7206000000b004020cebca5bmr9583099wmc.20.1694511925379; Tue, 12 Sep 2023 02:45:25 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:907f:4cd7:f0ae:6b2a]) by smtp.gmail.com with ESMTPSA id f11-20020a7bc8cb000000b003fefb94ccc9sm12321621wml.11.2023.09.12.02.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 02:45:24 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Andy Shevchenko , Orson Zhai , Baolin Wang , Chunyan Zhang Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [RFT PATCH 2/3] gpio: eic-sprd: use a helper variable for &pdev->dev Date: Tue, 12 Sep 2023 11:45:18 +0200 Message-Id: <20230912094519.22769-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230912094519.22769-1-brgl@bgdev.pl> References: <20230912094519.22769-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Bartosz Golaszewski Instead of dereferencing pdev everywhere, just store the address of the underlying struct device in a local variable. Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpio-eic-sprd.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c index 9b2f9ccf8d77..be7f2fa5aa7b 100644 --- a/drivers/gpio/gpio-eic-sprd.c +++ b/drivers/gpio/gpio-eic-sprd.c @@ -591,18 +591,19 @@ static void sprd_eic_unregister_notifier(void *data) static int sprd_eic_probe(struct platform_device *pdev) { const struct sprd_eic_variant_data *pdata; + struct device *dev = &pdev->dev; struct gpio_irq_chip *irq; struct sprd_eic *sprd_eic; struct resource *res; int ret, i; - pdata = of_device_get_match_data(&pdev->dev); + pdata = of_device_get_match_data(dev); if (!pdata) { - dev_err(&pdev->dev, "No matching driver data found.\n"); + dev_err(dev, "No matching driver data found.\n"); return -EINVAL; } - sprd_eic = devm_kzalloc(&pdev->dev, sizeof(*sprd_eic), GFP_KERNEL); + sprd_eic = devm_kzalloc(dev, sizeof(*sprd_eic), GFP_KERNEL); if (!sprd_eic) return -ENOMEM; @@ -624,7 +625,7 @@ static int sprd_eic_probe(struct platform_device *pdev) if (!res) break; - sprd_eic->base[i] = devm_ioremap_resource(&pdev->dev, res); + sprd_eic->base[i] = devm_ioremap_resource(dev, res); if (IS_ERR(sprd_eic->base[i])) return PTR_ERR(sprd_eic->base[i]); } @@ -632,7 +633,7 @@ static int sprd_eic_probe(struct platform_device *pdev) sprd_eic->chip.label = sprd_eic_label_name[sprd_eic->type]; sprd_eic->chip.ngpio = pdata->num_eics; sprd_eic->chip.base = -1; - sprd_eic->chip.parent = &pdev->dev; + sprd_eic->chip.parent = dev; sprd_eic->chip.direction_input = sprd_eic_direction_input; switch (sprd_eic->type) { case SPRD_EIC_DEBOUNCE: @@ -659,9 +660,9 @@ static int sprd_eic_probe(struct platform_device *pdev) irq->num_parents = 1; irq->parents = &sprd_eic->irq; - ret = devm_gpiochip_add_data(&pdev->dev, &sprd_eic->chip, sprd_eic); + ret = devm_gpiochip_add_data(dev, &sprd_eic->chip, sprd_eic); if (ret < 0) { - dev_err(&pdev->dev, "Could not register gpiochip %d.\n", ret); + dev_err(dev, "Could not register gpiochip %d.\n", ret); return ret; } @@ -669,11 +670,10 @@ static int sprd_eic_probe(struct platform_device *pdev) ret = atomic_notifier_chain_register(&sprd_eic_irq_notifier, &sprd_eic->irq_nb); if (ret) - return dev_err_probe(&pdev->dev, ret, + return dev_err_probe(dev, ret, "Failed to register with the interrupt notifier"); - return devm_add_action_or_reset(&pdev->dev, - sprd_eic_unregister_notifier, + return devm_add_action_or_reset(dev, sprd_eic_unregister_notifier, &sprd_eic->irq_nb); } From patchwork Tue Sep 12 09:45:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 721894 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 1D73ACA0ECE for ; Tue, 12 Sep 2023 09:45:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232487AbjILJpc (ORCPT ); Tue, 12 Sep 2023 05:45:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232406AbjILJpb (ORCPT ); Tue, 12 Sep 2023 05:45:31 -0400 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 E4B6CE67 for ; Tue, 12 Sep 2023 02:45:27 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-401da71b7c5so61097175e9.2 for ; Tue, 12 Sep 2023 02:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1694511926; x=1695116726; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UafgOnXtuKh9m65/RPTh4Y2p9AF6HuTxWc4dq2+OROA=; b=P9ntPn5y3ViXGsTUSe4nqvuU6z+so9DFl+2H4p0YGox9aTlzh3PJ/aNi1Th2D63ZDz LkVDZSJOqa9gWD5v/YRCWjYOVO5mmPMDObGO996aWw+qZdCrZVOW9hKhaZGvHlpKUNBJ N4q4rmJMcHELIdDB+AxXU/9m7gt2JphpS0bPzU0Stvbs0piZRoLU8n4omKuW19fyO5tH uXDvHsY1ns7d8FnXzXIP02Dh6qIswUfacIrSB7moIvoPIldjARH2ezd4eYfkJH2WJh+N eEzYdlAfziDWaSN0jdHny84De4t0uzMMsvUVRkIr5Fsean1Ykf6n3fTynBslu+y5r5W5 MC7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694511926; x=1695116726; 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:message-id:reply-to; bh=UafgOnXtuKh9m65/RPTh4Y2p9AF6HuTxWc4dq2+OROA=; b=apSPG4j5Vf5ZdNCNqyGOnMikAGJl2qDVsFFk3CaQMhANpVatkNK8btOWlmNAD1fXCe hvVx4IsvtS+BySmbELvsmm9uogrWIDuR68Cb5ugVHx0DGOqZ7ieSeEpnfROpww0T3LW2 KrjnGL77jdwlHDYEG6SCfS9h0lWSNNBSj2BMUY6A4f5cK10diXH7TUFV+noDLltHvdLp kQMW2rx5+YtKukrbRjsXPRRzIBKQ5pARN+yOEcIt2UmbiDTKK0jCu028Ey90Ze3EHy8N hO3t3qtSxTA7sPDgMfptSLuKM4SWIfa0QddeKW/x2ZXsdyns2wb9r3iY67E6s1U8zeS5 7e/Q== X-Gm-Message-State: AOJu0YwPdgkdM8EzczzSVLVqnXiZI01bDo9r6Cwaox9DcA5kkJOSMm8i QfNbBA+RKK/rhGaXCBEUlz+v4bioxTU13vzCrng= X-Google-Smtp-Source: AGHT+IHfTi5tcH7CVZjdKGOzUnrCN0zFPiSYfWMyALIyvaA9NW8oMfpgk0XlqIzyxv5gap0GXugeQA== X-Received: by 2002:a05:600c:3b1e:b0:402:f536:41c5 with SMTP id m30-20020a05600c3b1e00b00402f53641c5mr10218128wms.3.1694511926409; Tue, 12 Sep 2023 02:45:26 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:907f:4cd7:f0ae:6b2a]) by smtp.gmail.com with ESMTPSA id f11-20020a7bc8cb000000b003fefb94ccc9sm12321621wml.11.2023.09.12.02.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 02:45:26 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Andy Shevchenko , Orson Zhai , Baolin Wang , Chunyan Zhang Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [RFT PATCH 3/3] gpio: eic-sprd: use devm_platform_ioremap_resource() Date: Tue, 12 Sep 2023 11:45:19 +0200 Message-Id: <20230912094519.22769-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230912094519.22769-1-brgl@bgdev.pl> References: <20230912094519.22769-1-brgl@bgdev.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Bartosz Golaszewski Make two calls into one by using devm_platform_ioremap_resource(). Signed-off-by: Bartosz Golaszewski --- drivers/gpio/gpio-eic-sprd.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c index be7f2fa5aa7b..1e548e4e4cb8 100644 --- a/drivers/gpio/gpio-eic-sprd.c +++ b/drivers/gpio/gpio-eic-sprd.c @@ -594,7 +594,6 @@ static int sprd_eic_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct gpio_irq_chip *irq; struct sprd_eic *sprd_eic; - struct resource *res; int ret, i; pdata = of_device_get_match_data(dev); @@ -621,11 +620,7 @@ static int sprd_eic_probe(struct platform_device *pdev) * have one bank EIC, thus base[1] and base[2] can be * optional. */ - res = platform_get_resource(pdev, IORESOURCE_MEM, i); - if (!res) - break; - - sprd_eic->base[i] = devm_ioremap_resource(dev, res); + sprd_eic->base[i] = devm_platform_ioremap_resource(pdev, i); if (IS_ERR(sprd_eic->base[i])) return PTR_ERR(sprd_eic->base[i]); }