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=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 D11C5C433E0 for ; Wed, 17 Feb 2021 16:07:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 90B8E64DA1 for ; Wed, 17 Feb 2021 16:07:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233968AbhBQQHV (ORCPT ); Wed, 17 Feb 2021 11:07:21 -0500 Received: from foss.arm.com ([217.140.110.172]:33206 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233740AbhBQQHV (ORCPT ); Wed, 17 Feb 2021 11:07:21 -0500 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 A2E3D113E; Wed, 17 Feb 2021 08:06:35 -0800 (PST) Received: from [192.168.0.110] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A65573F694; Wed, 17 Feb 2021 08:06:34 -0800 (PST) Subject: Re: [PATCH kvmtool 03/21] ioport: Retire .generate_fdt_node functionality To: Andre Przywara Cc: Will Deacon , Julien Thierry , kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Marc Zyngier References: <20201210142908.169597-1-andre.przywara@arm.com> <20201210142908.169597-4-andre.przywara@arm.com> <3f1cf056-1913-cbbf-b9cd-12d1a840c468@arm.com> <20210217155428.1574884b@slackpad.fritz.box> From: Alexandru Elisei Message-ID: <7a22b213-af6f-adca-612c-225e12b5cd6e@arm.com> Date: Wed, 17 Feb 2021 16:06:42 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210217155428.1574884b@slackpad.fritz.box> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Andre, On 2/17/21 3:54 PM, Andre Przywara wrote: > On Thu, 11 Feb 2021 14:05:27 +0000 > Alexandru Elisei wrote: > >> Hi Andre, >> >> On 12/10/20 2:28 PM, Andre Przywara wrote: >>> 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. >> One comment below, but otherwise very nice cleanup. >> >>> Signed-off-by: Andre Przywara >>> --- >>> 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 667e8386..b98836d3 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, >>> - }, >> Since the dev_hdr field is not used anymore, maybe it could also be removed from >> struct ioport in include/kvm/ioport.h? > I could (seems to indeed still work without it), but this whole > structure will go away with a later patch, so I didn't bother so far. > That's why I am not sure it's useful to do this at this point then. Yes, you're totally right, no need to fiddle too much with it now because it will removed later: Reviewed-by: Alexandru Elisei Thanks, Alex > > Cheers, > Andre > >>> /* >>> * 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); 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=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 A77C7C433DB for ; Wed, 17 Feb 2021 16:06:43 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 18C9464DFF for ; Wed, 17 Feb 2021 16:06:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18C9464DFF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 7E6224B5AB; Wed, 17 Feb 2021 11:06:42 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z4dgURnDBoj9; Wed, 17 Feb 2021 11:06:41 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2C1F14B46C; Wed, 17 Feb 2021 11:06:41 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 5BFC74B44C for ; Wed, 17 Feb 2021 11:06:40 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GqvEOLlw54y1 for ; Wed, 17 Feb 2021 11:06:36 -0500 (EST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 0BF164B3C5 for ; Wed, 17 Feb 2021 11:06:36 -0500 (EST) 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 A2E3D113E; Wed, 17 Feb 2021 08:06:35 -0800 (PST) Received: from [192.168.0.110] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A65573F694; Wed, 17 Feb 2021 08:06:34 -0800 (PST) Subject: Re: [PATCH kvmtool 03/21] ioport: Retire .generate_fdt_node functionality To: Andre Przywara References: <20201210142908.169597-1-andre.przywara@arm.com> <20201210142908.169597-4-andre.przywara@arm.com> <3f1cf056-1913-cbbf-b9cd-12d1a840c468@arm.com> <20210217155428.1574884b@slackpad.fritz.box> From: Alexandru Elisei Message-ID: <7a22b213-af6f-adca-612c-225e12b5cd6e@arm.com> Date: Wed, 17 Feb 2021 16:06:42 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210217155428.1574884b@slackpad.fritz.box> Content-Language: en-US Cc: kvm@vger.kernel.org, Marc Zyngier , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Hi Andre, On 2/17/21 3:54 PM, Andre Przywara wrote: > On Thu, 11 Feb 2021 14:05:27 +0000 > Alexandru Elisei wrote: > >> Hi Andre, >> >> On 12/10/20 2:28 PM, Andre Przywara wrote: >>> 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. >> One comment below, but otherwise very nice cleanup. >> >>> Signed-off-by: Andre Przywara >>> --- >>> 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 667e8386..b98836d3 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, >>> - }, >> Since the dev_hdr field is not used anymore, maybe it could also be removed from >> struct ioport in include/kvm/ioport.h? > I could (seems to indeed still work without it), but this whole > structure will go away with a later patch, so I didn't bother so far. > That's why I am not sure it's useful to do this at this point then. Yes, you're totally right, no need to fiddle too much with it now because it will removed later: Reviewed-by: Alexandru Elisei Thanks, Alex > > Cheers, > Andre > >>> /* >>> * 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); _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-15.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 18AB8C433DB for ; Wed, 17 Feb 2021 16:08:27 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCE9864E0F for ; Wed, 17 Feb 2021 16:08:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCE9864E0F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tklJVyzQ3IHI6EgeRLGB0ojqvC9e4RlHwP5kFnspI9Q=; b=yaeC3XekjHBvF89nTP52f3o4b roWgz6tOIUIPMV1vZSPhpRls51P92aUqSrAXNDREBYgTRaFE6P0ACLFR0GMe1Jku0Gnn1gyfcmc/s RSeLGvm1Ink/Ut0Ripmraxnu1oKjIOHXzzCBUfrX8LV9qpvg/X92Sq7BC/UQOYFILZVfFHu1S5Iem YUezHkBrKYeda9R16nQziuyX1R92unqIaQzYGV+jaGY9R/2nrWd+pDkGG7a5jBK0VuCDaMN8v5asB 39DRMjAEl29PrB2kyjDsGm7DcI8oREVRWiWNLLs5Hmpgul3dCC+GrItQ5alhsCHyLauRWVg1iqPfL wPmZgY6fA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lCPLe-0001C2-1i; Wed, 17 Feb 2021 16:06:42 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lCPLa-0001Bh-RW for linux-arm-kernel@lists.infradead.org; Wed, 17 Feb 2021 16:06:39 +0000 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 A2E3D113E; Wed, 17 Feb 2021 08:06:35 -0800 (PST) Received: from [192.168.0.110] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A65573F694; Wed, 17 Feb 2021 08:06:34 -0800 (PST) Subject: Re: [PATCH kvmtool 03/21] ioport: Retire .generate_fdt_node functionality To: Andre Przywara References: <20201210142908.169597-1-andre.przywara@arm.com> <20201210142908.169597-4-andre.przywara@arm.com> <3f1cf056-1913-cbbf-b9cd-12d1a840c468@arm.com> <20210217155428.1574884b@slackpad.fritz.box> From: Alexandru Elisei Message-ID: <7a22b213-af6f-adca-612c-225e12b5cd6e@arm.com> Date: Wed, 17 Feb 2021 16:06:42 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210217155428.1574884b@slackpad.fritz.box> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210217_110639_030470_DF0510AF X-CRM114-Status: GOOD ( 19.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, Marc Zyngier , Julien Thierry , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Andre, On 2/17/21 3:54 PM, Andre Przywara wrote: > On Thu, 11 Feb 2021 14:05:27 +0000 > Alexandru Elisei wrote: > >> Hi Andre, >> >> On 12/10/20 2:28 PM, Andre Przywara wrote: >>> 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. >> One comment below, but otherwise very nice cleanup. >> >>> Signed-off-by: Andre Przywara >>> --- >>> 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 667e8386..b98836d3 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, >>> - }, >> Since the dev_hdr field is not used anymore, maybe it could also be removed from >> struct ioport in include/kvm/ioport.h? > I could (seems to indeed still work without it), but this whole > structure will go away with a later patch, so I didn't bother so far. > That's why I am not sure it's useful to do this at this point then. Yes, you're totally right, no need to fiddle too much with it now because it will removed later: Reviewed-by: Alexandru Elisei Thanks, Alex > > Cheers, > Andre > >>> /* >>> * 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); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel