Skip to content

Commit 4093b0e

Browse files
chenhuacaiThomas Gleixner
authored andcommitted
irqchip/loongson-pch-msi: Adjust irqchip driver for 32BIT/64BIT
irq_domain_alloc_fwnode() takes a parameter with the phys_addr_t type. Currently the code passe acpi_pchmsi->msg_address to it. This can only work on 64BIT platform because its type is u64, so cast it to phys_addr_t and then the driver works on both 32BIT and 64BIT platform. [ tglx: Make the cast explicit and fixup coding style. ] Co-developed-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260113085940.3344837-6-chenhuacai@loongson.cn
1 parent 04f1f17 commit 4093b0e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/irqchip/irq-loongson-pch-msi.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,13 @@ struct fwnode_handle *get_pch_msi_handle(int pci_segment)
263263

264264
int __init pch_msi_acpi_init(struct irq_domain *parent, struct acpi_madt_msi_pic *acpi_pchmsi)
265265
{
266-
int ret;
266+
phys_addr_t msg_address = (phys_addr_t)acpi_pchmsi->msg_address;
267267
struct fwnode_handle *domain_handle;
268+
int ret;
268269

269-
domain_handle = irq_domain_alloc_fwnode(&acpi_pchmsi->msg_address);
270-
ret = pch_msi_init(acpi_pchmsi->msg_address, acpi_pchmsi->start,
271-
acpi_pchmsi->count, parent, domain_handle);
270+
domain_handle = irq_domain_alloc_fwnode(&msg_address);
271+
ret = pch_msi_init(msg_address, acpi_pchmsi->start, acpi_pchmsi->count,
272+
parent, domain_handle);
272273
if (ret < 0)
273274
irq_domain_free_fwnode(domain_handle);
274275

0 commit comments

Comments
 (0)