From patchwork Tue Jun 9 08:23:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 187634 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp313352ilo; Tue, 9 Jun 2020 01:23:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5iR7XMfLjlLOxsSQO5F35IhXq/ylntg1OfQ0B6ZZuggKg9HR66+lfGvTc+M6tEhxje2Vv X-Received: by 2002:a17:907:2072:: with SMTP id qp18mr23554783ejb.179.1591691029466; Tue, 09 Jun 2020 01:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591691029; cv=none; d=google.com; s=arc-20160816; b=UDRpNZkpxs3PdqUf0ovVX5BByUHHx6TFodVeAxCNVa+d062/C5JBMghfL8/WGkVzap 9KV1NMxbsHlY7SAKTJ4Vvcj7Ob7hZmGVaJDhlVxljUScaB2hXxT5rA9OJw3gKfZAuOJf 07sTnXGCtIcI4BlI9NA1b5QXthnEUMaj9mF/B4Ym/gF232ds7kxWxGF/mIUfoGRMdqu3 h7BKB7hNDo4/1vrUSHzmH367ZDqOa+yCI4u6lFhRzOQet15z5NGiJBe3diXykpH0CAdL gxnJPy7cnc/yaCN7eA0h21Gxig0C51fckBOJEvwhaeSqP2gLH++/vNJEESsKrusvy3k6 UmrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=BGalV4SWoQktnTM1smyzt1YMdWYXcGcpHw/UIPU9QfY=; b=UAu7PXciQJ72lZ2k1zMaFQyUZNPGxZ0eVAiTTLkjXTPQh1iVzzLs8Clbveae3Rah8M 1e/6PynelOGAlZE4UpnuaP5xELLSaUznqVWznrQFz8twQucfuTiWR0AAKUcqBcy5wxK8 9KIo1mugPI4S9iQGCeA2qkgNSj0HCy7+smCE5xkp1EvvSnKHKMMOAJPDZBvX/xa9FOja jfvLYtzMd+ibtwK6GhvskcEuRr3ejHLdm7KBHLqpiR+Fshxmj2s9+QM9ZzwpBYH4WoL2 i361lGHdr0UxQ/PebsGRIfnOYsLUCVhKh7C4xZFsQmkjJm7+1IRHfZ1bnhhcaS6Dk9Kw b2dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=DDtw0tA9; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di25si10159195edb.539.2020.06.09.01.23.49; Tue, 09 Jun 2020 01:23:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=DDtw0tA9; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728116AbgFIIXq (ORCPT + 3 others); Tue, 9 Jun 2020 04:23:46 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:58739 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728105AbgFIIXo (ORCPT ); Tue, 9 Jun 2020 04:23:44 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200609082342euoutp014143bab597f3c9acf6207c0705549087~W0o0ydy521660516605euoutp01I for ; Tue, 9 Jun 2020 08:23:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200609082342euoutp014143bab597f3c9acf6207c0705549087~W0o0ydy521660516605euoutp01I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1591691022; bh=BGalV4SWoQktnTM1smyzt1YMdWYXcGcpHw/UIPU9QfY=; h=From:To:Cc:Subject:Date:References:From; b=DDtw0tA9I3zr0EpRkI94+4tgsN+oC4v+GjIsyjhL2qzhHNtQpyOkvQQWUkWwBSqhq B+5GlI4STrhx09lViCvdqTSa4Eqa8xjp3dTWbM3/RBxYKgYVmjNW/TkfVlE5XKDAOo FYO8Gz8B+iunAkkK6UhY1x5Gt+cgkSp37pfO1z/M= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200609082341eucas1p2c3a4166cdabbe42dffa2247274efd3aa~W0o0baGNz0783307833eucas1p2P; Tue, 9 Jun 2020 08:23:41 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 08.72.60698.D074FDE5; Tue, 9 Jun 2020 09:23:41 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200609082341eucas1p2e24e71598af14d994520b79494e96b15~W0oz-h0we0586405864eucas1p22; Tue, 9 Jun 2020 08:23:41 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200609082341eusmtrp13f3232debefbe006bf5db6b998b6c47d~W0oz_vRrt1700117001eusmtrp1H; Tue, 9 Jun 2020 08:23:41 +0000 (GMT) X-AuditID: cbfec7f5-a29ff7000001ed1a-4d-5edf470d9af8 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id FB.74.08375.D074FDE5; Tue, 9 Jun 2020 09:23:41 +0100 (BST) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200609082340eusmtip174a5d456d5afdee3c869087bc138ef55~W0ozjWR9q1237712377eusmtip1T; Tue, 9 Jun 2020 08:23:40 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz , Chanwoo Choi Subject: [PATCH] pinctrl: samsung: Use bank name as irqchip name Date: Tue, 9 Jun 2020 10:23:29 +0200 Message-Id: <20200609082329.10184-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBIsWRmVeSWpSXmKPExsWy7djPc7q87vfjDFaf1rXYOGM9q8X1L89Z Lc6f38BuMeXPciaLzfP/MFrMOL+PyWLtkbvsFofftLNarNr1h9GB02PnrLvsHptWdbJ53Lm2 h82jb8sqRo/Pm+QCWKO4bFJSczLLUov07RK4Ms78ucxY8Fy84uX9lywNjA+Euhg5OSQETCRa H01l6WLk4hASWMEosenvU2YI5wujxOQ3h5lAqoQEPjNKvHgmD9PxbuE7qI7lQPFTN1nhOia2 /mcGqWITMJToetvFBmKLCDhK/NywCqyIWWAbk8T5rkNACQ4OYQEHiasPGUFqWARUJe6v3AG2 jVfAVmLbimYWiG3yEqs3HAA7SULgOZvE08UXGSESLhIn2m+zQdjCEq+Ob2GHsGUkTk/uYYFo aGaUeHhuLTuE08MocblpBlS3tcSdc7/ArmAW0JRYv0sfIuwo0f1zFztIWEKAT+LGW0GQMDOQ OWnbdGaIMK9ERxs07NQkZh1fB7f24IVLzBC2h8TSp9fApggJxErMP1s/gVFuFsKqBYyMqxjF U0uLc9NTi43zUsv1ihNzi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rabePrJ21pCU53/Ri7tZz1+NE7069tYjvSqOkYv0VXwmBMyvinsgosRRn JBpqMRcVJwIAgt8GL2ECAAA= X-CMS-MailID: 20200609082341eucas1p2e24e71598af14d994520b79494e96b15 X-Msg-Generator: CA X-RootMTR: 20200609082341eucas1p2e24e71598af14d994520b79494e96b15 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200609082341eucas1p2e24e71598af14d994520b79494e96b15 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Use the bank name as the irqchip name. This name is later visible in /proc/interrupts, what makes it possible to easily identify each GPIO interrupt. /proc/interrupts before this patch: 143: 0 exynos4210_wkup_irq_chip 7 Edge hdmi 144: 0 exynos4210_wkup_irq_chip 6 Level wm8994 145: 1 exynos4210_wkup_irq_chip 7 Edge max77686-pmic, max77686-rtc 146: 1 exynos_gpio_irq_chip 3 Edge 3-0048 /proc/interrupts after this patch: 143: 0 gpx3 7 Edge hdmi 144: 0 gpx3 6 Level wm8994 145: 1 gpx0 7 Edge max77686-pmic, max77686-rtc 146: 1 gpm2 3 Edge 3-0048 Signed-off-by: Marek Szyprowski --- drivers/pinctrl/samsung/pinctrl-exynos.c | 27 +++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-) -- 2.17.1 Reported-by: kernel test robot diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 84501c785473..1c87cf41602a 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -207,7 +207,7 @@ static void exynos_irq_release_resources(struct irq_data *irqd) /* * irq_chip for gpio interrupts. */ -static struct exynos_irq_chip exynos_gpio_irq_chip = { +static const struct exynos_irq_chip exynos_gpio_irq_chip __initconst = { .chip = { .name = "exynos_gpio_irq_chip", .irq_unmask = exynos_irq_unmask, @@ -313,7 +313,13 @@ int exynos_eint_gpio_init(struct samsung_pinctrl_drv_data *d) goto err_domains; } - bank->irq_chip = &exynos_gpio_irq_chip; + bank->irq_chip = kmemdup(&exynos_gpio_irq_chip, + sizeof(*bank->irq_chip), GFP_KERNEL); + if (!bank->irq_chip) { + ret = -ENOMEM; + goto err_domains; + } + bank->irq_chip->chip.name = bank->name; } return 0; @@ -521,7 +527,7 @@ int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) struct samsung_pin_bank *bank; struct exynos_weint_data *weint_data; struct exynos_muxed_weint_data *muxed_data; - struct exynos_irq_chip *irq_chip; + const struct exynos_irq_chip *irq_chip; unsigned int muxed_banks = 0; unsigned int i; int idx, irq; @@ -531,12 +537,7 @@ int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) match = of_match_node(exynos_wkup_irq_ids, np); if (match) { - irq_chip = kmemdup(match->data, - sizeof(*irq_chip), GFP_KERNEL); - if (!irq_chip) { - of_node_put(np); - return -ENOMEM; - } + irq_chip = match->data; wkup_np = np; break; } @@ -557,7 +558,13 @@ int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) return -ENXIO; } - bank->irq_chip = irq_chip; + bank->irq_chip = kmemdup(irq_chip, sizeof(*irq_chip), + GFP_KERNEL); + if (!bank->irq_chip) { + of_node_put(wkup_np); + return -ENOMEM; + } + bank->irq_chip->chip.name = bank->name; if (!of_find_property(bank->of_node, "interrupts", NULL)) { bank->eint_type = EINT_TYPE_WKUP_MUX;