mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-04-13 22:31:38 +01:00
lib: sbi_irqchip: Use chip as variable name for irqchip device
The irqchip device represents an interrupt controller so use chip as variable name instead of dev. This will avoid confusion as the sbi_irqchip framework grows. Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260213055342.3124872-2-anup.patel@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -21,7 +21,7 @@ struct sbi_irqchip_device {
|
|||||||
struct sbi_dlist node;
|
struct sbi_dlist node;
|
||||||
|
|
||||||
/** Initialize per-hart state for the current hart */
|
/** Initialize per-hart state for the current hart */
|
||||||
int (*warm_init)(struct sbi_irqchip_device *dev);
|
int (*warm_init)(struct sbi_irqchip_device *chip);
|
||||||
|
|
||||||
/** Handle an IRQ from this irqchip */
|
/** Handle an IRQ from this irqchip */
|
||||||
int (*irq_handle)(void);
|
int (*irq_handle)(void);
|
||||||
@@ -38,7 +38,7 @@ struct sbi_irqchip_device {
|
|||||||
int sbi_irqchip_process(void);
|
int sbi_irqchip_process(void);
|
||||||
|
|
||||||
/** Register an irqchip device to receive callbacks */
|
/** Register an irqchip device to receive callbacks */
|
||||||
void sbi_irqchip_add_device(struct sbi_irqchip_device *dev);
|
void sbi_irqchip_add_device(struct sbi_irqchip_device *chip);
|
||||||
|
|
||||||
/** Initialize interrupt controllers */
|
/** Initialize interrupt controllers */
|
||||||
int sbi_irqchip_init(struct sbi_scratch *scratch, bool cold_boot);
|
int sbi_irqchip_init(struct sbi_scratch *scratch, bool cold_boot);
|
||||||
|
|||||||
@@ -25,19 +25,19 @@ int sbi_irqchip_process(void)
|
|||||||
return ext_irqfn();
|
return ext_irqfn();
|
||||||
}
|
}
|
||||||
|
|
||||||
void sbi_irqchip_add_device(struct sbi_irqchip_device *dev)
|
void sbi_irqchip_add_device(struct sbi_irqchip_device *chip)
|
||||||
{
|
{
|
||||||
sbi_list_add_tail(&dev->node, &irqchip_list);
|
sbi_list_add_tail(&chip->node, &irqchip_list);
|
||||||
|
|
||||||
if (dev->irq_handle)
|
if (chip->irq_handle)
|
||||||
ext_irqfn = dev->irq_handle;
|
ext_irqfn = chip->irq_handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sbi_irqchip_init(struct sbi_scratch *scratch, bool cold_boot)
|
int sbi_irqchip_init(struct sbi_scratch *scratch, bool cold_boot)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
const struct sbi_platform *plat = sbi_platform_ptr(scratch);
|
const struct sbi_platform *plat = sbi_platform_ptr(scratch);
|
||||||
struct sbi_irqchip_device *dev;
|
struct sbi_irqchip_device *chip;
|
||||||
|
|
||||||
if (cold_boot) {
|
if (cold_boot) {
|
||||||
rc = sbi_platform_irqchip_init(plat);
|
rc = sbi_platform_irqchip_init(plat);
|
||||||
@@ -45,10 +45,10 @@ int sbi_irqchip_init(struct sbi_scratch *scratch, bool cold_boot)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
sbi_list_for_each_entry(dev, &irqchip_list, node) {
|
sbi_list_for_each_entry(chip, &irqchip_list, node) {
|
||||||
if (!dev->warm_init)
|
if (!chip->warm_init)
|
||||||
continue;
|
continue;
|
||||||
rc = dev->warm_init(dev);
|
rc = chip->warm_init(chip);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user