From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E4C1C4332B for ; Mon, 15 Mar 2021 15:34:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE34964EE3 for ; Mon, 15 Mar 2021 15:34:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230433AbhCOPeZ (ORCPT ); Mon, 15 Mar 2021 11:34:25 -0400 Received: from foss.arm.com ([217.140.110.172]:50638 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230389AbhCOPeQ (ORCPT ); Mon, 15 Mar 2021 11:34:16 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DEC8A1FB; Mon, 15 Mar 2021 08:34:15 -0700 (PDT) Received: from localhost.localdomain (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 93E6A3F792; Mon, 15 Mar 2021 08:34:14 -0700 (PDT) From: Andre Przywara To: Will Deacon , Julien Thierry Cc: Alexandru Elisei , kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, Marc Zyngier , Sami Mujawar Subject: [PATCH kvmtool v3 03/22] ioport: Retire .generate_fdt_node functionality Date: Mon, 15 Mar 2021 15:33:31 +0000 Message-Id: <20210315153350.19988-4-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20210315153350.19988-1-andre.przywara@arm.com> References: <20210315153350.19988-1-andre.przywara@arm.com> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The ioport routines support a special way of registering FDT node generator functions. There is no reason to have this separate from the already existing way via the device header. Now that the only user of this special ioport variety has been transferred, we can retire this code, to simplify ioport handling. Signed-off-by: Andre Przywara Reviewed-by: Alexandru Elisei --- include/kvm/ioport.h | 4 ---- ioport.c | 34 ---------------------------------- 2 files changed, 38 deletions(-) diff --git a/include/kvm/ioport.h b/include/kvm/ioport.h index d0213541..a61038e2 100644 --- a/include/kvm/ioport.h +++ b/include/kvm/ioport.h @@ -29,10 +29,6 @@ struct ioport { struct ioport_operations { bool (*io_in)(struct ioport *ioport, struct kvm_cpu *vcpu, u16 port, void *data, int size); bool (*io_out)(struct ioport *ioport, struct kvm_cpu *vcpu, u16 port, void *data, int size); - void (*generate_fdt_node)(struct ioport *ioport, void *fdt, - void (*generate_irq_prop)(void *fdt, - u8 irq, - enum irq_type)); }; void ioport__map_irq(u8 *irq); diff --git a/ioport.c b/ioport.c index a6972179..e0123f27 100644 --- a/ioport.c +++ b/ioport.c @@ -56,7 +56,6 @@ static struct ioport *ioport_get(struct rb_root *root, u64 addr) /* Called with ioport_lock held. */ static void ioport_unregister(struct rb_root *root, struct ioport *data) { - device__unregister(&data->dev_hdr); ioport_remove(root, data); free(data); } @@ -70,30 +69,6 @@ static void ioport_put(struct rb_root *root, struct ioport *data) mutex_unlock(&ioport_lock); } -#ifdef CONFIG_HAS_LIBFDT -static void generate_ioport_fdt_node(void *fdt, - struct device_header *dev_hdr, - void (*generate_irq_prop)(void *fdt, - u8 irq, - enum irq_type)) -{ - struct ioport *ioport = container_of(dev_hdr, struct ioport, dev_hdr); - struct ioport_operations *ops = ioport->ops; - - if (ops->generate_fdt_node) - ops->generate_fdt_node(ioport, fdt, generate_irq_prop); -} -#else -static void generate_ioport_fdt_node(void *fdt, - struct device_header *dev_hdr, - void (*generate_irq_prop)(void *fdt, - u8 irq, - enum irq_type)) -{ - die("Unable to generate device tree nodes without libfdt\n"); -} -#endif - int ioport__register(struct kvm *kvm, u16 port, struct ioport_operations *ops, int count, void *param) { struct ioport *entry; @@ -107,10 +82,6 @@ int ioport__register(struct kvm *kvm, u16 port, struct ioport_operations *ops, i .node = RB_INT_INIT(port, port + count), .ops = ops, .priv = param, - .dev_hdr = (struct device_header) { - .bus_type = DEVICE_BUS_IOPORT, - .data = generate_ioport_fdt_node, - }, /* * Start from 0 because ioport__unregister() doesn't decrement * the reference count. @@ -123,15 +94,10 @@ int ioport__register(struct kvm *kvm, u16 port, struct ioport_operations *ops, i r = ioport_insert(&ioport_tree, entry); if (r < 0) goto out_free; - r = device__register(&entry->dev_hdr); - if (r < 0) - goto out_remove; mutex_unlock(&ioport_lock); return port; -out_remove: - ioport_remove(&ioport_tree, entry); out_free: free(entry); mutex_unlock(&ioport_lock); -- 2.17.5