Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4410919imu; Tue, 29 Jan 2019 00:46:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN7KlUCdDixSBvPKY2W+jV/ctOJOXgtu6e4Wr/0k9QTf1vTK6B0WAcFgip0+GJ07w/R4bJXx X-Received: by 2002:a17:902:4503:: with SMTP id m3mr25468166pld.23.1548751568548; Tue, 29 Jan 2019 00:46:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548751568; cv=none; d=google.com; s=arc-20160816; b=m5qAxdumXSpC5TkCQk/j7ae1g/dSgah3nNLBwVNRLo/RzLnTd8M4Abn0jMgum6DPjh Qu5/h7WjDTNZWmUGEPYfs61q/TE0V1r1TH5hJ7uqYn7GgAlJ8/aT8BmEu0tCK1+MMTn2 Blpj7FA7QqZ7FlFJGpok5obWNTcRkCfdQsuSPI/30RioV/dUd00Vr3yJ3SeoEsOyOI4k L0yaTK0OuPUEltIf8ElhcS2oZTNTQd4jbg4lo1ZK3jyfTZSFdWEeQBTjiZ9n6joS/0Xb VtbjVe2/1pK1CA9Q91nB+C4tFZLI/3I28Gu0Dfc6xkR8PyQmpW3tsX1ZfFza3Nq6cGWD rBZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WQ66DLEKc/MG0DXybe6MWB+l9aGMWDp/DgE2ls7LES8=; b=qxRL6C6lKcDq1dzD33wpNGf3SPbYigTmj3ZI04k/dH75MeiZmProBSdep5pmnjPk+J TIG3tf0W56i/dpfOenYGW41FjFOHrbnbIAAtlqgvSa1z/7UEUVE9pIdr1/LdM2feQweF G/4DrPja/aLbcHfvXlIaJjsiPk0EJS63nea09rKamXr6sQrb4IZMyMrMRrDsD0MsXwCq /MkONNcKBbOzZFVNW5H/VcLdvJWt5Eh9IxY3Z+wP2rEsj4oZBfyB9wRDjDXRVruixcak XAwPX5zHKFNHPa8hvrXnFds7NpsHwGAp6k2VBw3yRoee2qxTJvuyxSB0pHLXdmpA49NZ BrZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=19J9WBAu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7si35466338pgc.236.2019.01.29.00.45.53; Tue, 29 Jan 2019 00:46:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=19J9WBAu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728219AbfA2IpM (ORCPT + 99 others); Tue, 29 Jan 2019 03:45:12 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45036 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727890AbfA2IoV (ORCPT ); Tue, 29 Jan 2019 03:44:21 -0500 Received: by mail-wr1-f65.google.com with SMTP id z5so20987780wrt.11 for ; Tue, 29 Jan 2019 00:44:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WQ66DLEKc/MG0DXybe6MWB+l9aGMWDp/DgE2ls7LES8=; b=19J9WBAujCPa7W+q9JrzLjm9Yhpyp2rgsVO/LGDMaJWej8bxfAE4VsiDijFnRGmJp/ L5ZSePWmnW3NdTZzFURQcmu14xnZGv1D5z0J2/Cwj9TKIZliemYMhTGnnPykpRsI7Lyy BsoyZeWP9ZT9XMIPg6HKmKjbxuE5xDo613/Gy1zRQHiusUcoXQKLP0eZjd4Up3iQ8AiM 7CMa9r/cKarVpsIlKWF8gSGTVJNVwMbFxJ44DHdsucwxvrsr276GqQElzzcQyQl+eSLA 3tM8+YgsH2gqKvwfUdFwy1oib1nfKHjPbT8isuRUyBTwpuyzE/CPxlfwK7WDkZpjDFrj nppg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WQ66DLEKc/MG0DXybe6MWB+l9aGMWDp/DgE2ls7LES8=; b=Sj3aPedtUUYwvRqx6v96eYOBlrupGg4QjowpYzlZVc3N5Rk2Ej59XxgQ6YE+88VzE4 SCnkbIoQn9FlTt/+1N/xBKUdzMepTWXBsafIe50AZLHcCMkykH4vb1gYOgfPrCAEYxoz 8Ygc98eXVZpBy/X5qEIf31NpQgDn5yBBllL+hbq1VJO95Bp9OhAsNpQSxVsxI7q21Lbv /CYYQ6GR1Z8mAgEGFZOP1h/froy3S0hsmNWtQ4sYoogQNNORgL9c0iyAQ90dOHUXAOVp R3fmfTBscmsLw8PxFmOw09F4DsRCUzCrQTEk0QjfXPdaakYF+LPzeEcC/uoLCv4N5eSq B7aw== X-Gm-Message-State: AJcUukeZfCY4Kn0qBQVV3inzohM7sBqkCFgawIN6gY5DRnzy2S5BxWBe +4wSZfXUikREMtVUvPkxmDp13Q== X-Received: by 2002:adf:a1d2:: with SMTP id v18mr23835506wrv.87.1548751459446; Tue, 29 Jan 2019 00:44:19 -0800 (PST) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id c1sm3979319wmb.14.2019.01.29.00.44.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 00:44:18 -0800 (PST) From: Bartosz Golaszewski To: Linus Walleij , Thomas Gleixner , Marc Zyngier , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 1/9] irq/irq_sim: don't share the irq_chip structure between simulators Date: Tue, 29 Jan 2019 09:44:03 +0100 Message-Id: <20190129084411.30495-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190129084411.30495-1-brgl@bgdev.pl> References: <20190129084411.30495-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski We want to support multiple instances of irq_sim. Make struct irq_chip part of the irq_sim structure. Signed-off-by: Bartosz Golaszewski --- include/linux/irq_sim.h | 2 ++ kernel/irq/irq_sim.c | 12 +++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/irq_sim.h b/include/linux/irq_sim.h index 4500d453a63e..eda132c22b57 100644 --- a/include/linux/irq_sim.h +++ b/include/linux/irq_sim.h @@ -6,6 +6,7 @@ #ifndef _LINUX_IRQ_SIM_H #define _LINUX_IRQ_SIM_H +#include #include #include @@ -25,6 +26,7 @@ struct irq_sim_irq_ctx { }; struct irq_sim { + struct irq_chip chip; struct irq_sim_work_ctx work_ctx; int irq_base; unsigned int irq_count; diff --git a/kernel/irq/irq_sim.c b/kernel/irq/irq_sim.c index 98a20e1594ce..b732e4e2e45b 100644 --- a/kernel/irq/irq_sim.c +++ b/kernel/irq/irq_sim.c @@ -25,12 +25,6 @@ static void irq_sim_irqunmask(struct irq_data *data) irq_ctx->enabled = true; } -static struct irq_chip irq_sim_irqchip = { - .name = "irq_sim", - .irq_mask = irq_sim_irqmask, - .irq_unmask = irq_sim_irqunmask, -}; - static void irq_sim_handle_irq(struct irq_work *work) { struct irq_sim_work_ctx *work_ctx; @@ -74,6 +68,10 @@ int irq_sim_init(struct irq_sim *sim, unsigned int num_irqs) return sim->irq_base; } + sim->chip.name = "irq_sim"; + sim->chip.irq_mask = irq_sim_irqmask; + sim->chip.irq_unmask = irq_sim_irqunmask; + sim->work_ctx.pending = bitmap_zalloc(num_irqs, GFP_KERNEL); if (!sim->work_ctx.pending) { kfree(sim->irqs); @@ -84,7 +82,7 @@ int irq_sim_init(struct irq_sim *sim, unsigned int num_irqs) for (i = 0; i < num_irqs; i++) { sim->irqs[i].irqnum = sim->irq_base + i; sim->irqs[i].enabled = false; - irq_set_chip(sim->irq_base + i, &irq_sim_irqchip); + irq_set_chip(sim->irq_base + i, &sim->chip); irq_set_chip_data(sim->irq_base + i, &sim->irqs[i]); irq_set_handler(sim->irq_base + i, &handle_simple_irq); irq_modify_status(sim->irq_base + i, -- 2.19.1