Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip/davinci-cp-intc: Remove public header

There are no more users of irq-davinci-cp-intc.h (da830.c doesn't use
any of its symbols). Remove the header and make the driver stop using the
config structure.

[ tglx: Mop up coding style ]

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250304131815.86549-1-brgl@bgdev.pl

authored by

Bartosz Golaszewski and committed by
Thomas Gleixner
71cbbb71 399b2799

+21 -62
-1
arch/arm/mach-davinci/da830.c
··· 11 11 #include <linux/gpio.h> 12 12 #include <linux/init.h> 13 13 #include <linux/io.h> 14 - #include <linux/irqchip/irq-davinci-cp-intc.h> 15 14 16 15 #include <clocksource/timer-davinci.h> 17 16
+21 -36
drivers/irqchip/irq-davinci-cp-intc.c
··· 11 11 #include <linux/init.h> 12 12 #include <linux/irq.h> 13 13 #include <linux/irqchip.h> 14 - #include <linux/irqchip/irq-davinci-cp-intc.h> 15 14 #include <linux/irqdomain.h> 16 15 #include <linux/io.h> 17 16 #include <linux/of.h> ··· 153 154 .xlate = irq_domain_xlate_onetwocell, 154 155 }; 155 156 156 - static int __init 157 - davinci_cp_intc_do_init(const struct davinci_cp_intc_config *config, 158 - struct device_node *node) 157 + static int __init davinci_cp_intc_do_init(struct resource *res, unsigned int num_irqs, 158 + struct device_node *node) 159 159 { 160 - unsigned int num_regs = BITS_TO_LONGS(config->num_irqs); 160 + unsigned int num_regs = BITS_TO_LONGS(num_irqs); 161 161 int offset, irq_base; 162 162 void __iomem *req; 163 163 164 - req = request_mem_region(config->reg.start, 165 - resource_size(&config->reg), 166 - "davinci-cp-intc"); 164 + req = request_mem_region(res->start, resource_size(res), "davinci-cp-intc"); 167 165 if (!req) { 168 166 pr_err("%s: register range busy\n", __func__); 169 167 return -EBUSY; 170 168 } 171 169 172 - davinci_cp_intc_base = ioremap(config->reg.start, 173 - resource_size(&config->reg)); 170 + davinci_cp_intc_base = ioremap(res->start, resource_size(res)); 174 171 if (!davinci_cp_intc_base) { 175 172 pr_err("%s: unable to ioremap register range\n", __func__); 176 173 return -EINVAL; ··· 179 184 180 185 /* Disable system interrupts */ 181 186 for (offset = 0; offset < num_regs; offset++) 182 - davinci_cp_intc_write(~0, 183 - DAVINCI_CP_INTC_SYS_ENABLE_CLR(offset)); 187 + davinci_cp_intc_write(~0, DAVINCI_CP_INTC_SYS_ENABLE_CLR(offset)); 184 188 185 189 /* Set to normal mode, no nesting, no priority hold */ 186 190 davinci_cp_intc_write(0, DAVINCI_CP_INTC_CTRL); ··· 187 193 188 194 /* Clear system interrupt status */ 189 195 for (offset = 0; offset < num_regs; offset++) 190 - davinci_cp_intc_write(~0, 191 - DAVINCI_CP_INTC_SYS_STAT_CLR(offset)); 196 + davinci_cp_intc_write(~0, DAVINCI_CP_INTC_SYS_STAT_CLR(offset)); 192 197 193 198 /* Enable nIRQ (what about nFIQ?) */ 194 199 davinci_cp_intc_write(1, DAVINCI_CP_INTC_HOST_ENABLE_IDX_SET); 195 200 201 + /* 4 channels per register */ 202 + num_regs = (num_irqs + 3) >> 2; 196 203 /* Default all priorities to channel 7. */ 197 - num_regs = (config->num_irqs + 3) >> 2; /* 4 channels per register */ 198 204 for (offset = 0; offset < num_regs; offset++) 199 - davinci_cp_intc_write(0x07070707, 200 - DAVINCI_CP_INTC_CHAN_MAP(offset)); 205 + davinci_cp_intc_write(0x07070707, DAVINCI_CP_INTC_CHAN_MAP(offset)); 201 206 202 - irq_base = irq_alloc_descs(-1, 0, config->num_irqs, 0); 207 + irq_base = irq_alloc_descs(-1, 0, num_irqs, 0); 203 208 if (irq_base < 0) { 204 - pr_err("%s: unable to allocate interrupt descriptors: %d\n", 205 - __func__, irq_base); 209 + pr_err("%s: unable to allocate interrupt descriptors: %d\n", __func__, irq_base); 206 210 return irq_base; 207 211 } 208 212 209 - davinci_cp_intc_irq_domain = irq_domain_add_legacy( 210 - node, config->num_irqs, irq_base, 0, 211 - &davinci_cp_intc_irq_domain_ops, NULL); 213 + davinci_cp_intc_irq_domain = irq_domain_add_legacy(node, num_irqs, irq_base, 0, 214 + &davinci_cp_intc_irq_domain_ops, NULL); 212 215 213 216 if (!davinci_cp_intc_irq_domain) { 214 217 pr_err("%s: unable to create an interrupt domain\n", __func__); ··· 220 229 return 0; 221 230 } 222 231 223 - int __init davinci_cp_intc_init(const struct davinci_cp_intc_config *config) 224 - { 225 - return davinci_cp_intc_do_init(config, NULL); 226 - } 227 - 228 232 static int __init davinci_cp_intc_of_init(struct device_node *node, 229 233 struct device_node *parent) 230 234 { 231 - struct davinci_cp_intc_config config = { }; 235 + unsigned int num_irqs; 236 + struct resource res; 232 237 int ret; 233 238 234 - ret = of_address_to_resource(node, 0, &config.reg); 239 + ret = of_address_to_resource(node, 0, &res); 235 240 if (ret) { 236 - pr_err("%s: unable to get the register range from device-tree\n", 237 - __func__); 241 + pr_err("%s: unable to get the register range from device-tree\n", __func__); 238 242 return ret; 239 243 } 240 244 241 - ret = of_property_read_u32(node, "ti,intc-size", &config.num_irqs); 245 + ret = of_property_read_u32(node, "ti,intc-size", &num_irqs); 242 246 if (ret) { 243 - pr_err("%s: unable to read the 'ti,intc-size' property\n", 244 - __func__); 247 + pr_err("%s: unable to read the 'ti,intc-size' property\n", __func__); 245 248 return ret; 246 249 } 247 250 248 - return davinci_cp_intc_do_init(&config, node); 251 + return davinci_cp_intc_do_init(&res, num_irqs, node); 249 252 } 250 253 IRQCHIP_DECLARE(cp_intc, "ti,cp-intc", davinci_cp_intc_of_init);
-25
include/linux/irqchip/irq-davinci-cp-intc.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Copyright (C) 2019 Texas Instruments 4 - */ 5 - 6 - #ifndef _LINUX_IRQ_DAVINCI_CP_INTC_ 7 - #define _LINUX_IRQ_DAVINCI_CP_INTC_ 8 - 9 - #include <linux/ioport.h> 10 - 11 - /** 12 - * struct davinci_cp_intc_config - configuration data for davinci-cp-intc 13 - * driver. 14 - * 15 - * @reg: register range to map 16 - * @num_irqs: number of HW interrupts supported by the controller 17 - */ 18 - struct davinci_cp_intc_config { 19 - struct resource reg; 20 - unsigned int num_irqs; 21 - }; 22 - 23 - int davinci_cp_intc_init(const struct davinci_cp_intc_config *config); 24 - 25 - #endif /* _LINUX_IRQ_DAVINCI_CP_INTC_ */