PCI/MSI: Rename "struct msi_chip" to "struct msi_controller"
"msi_chip" isn't very descriptive, so rename it to "msi_controller". That tells a little more about what it does and is already used in device tree bindings. No functional change. [bhelgaas: changelog, change *only* the struct name so it's reviewable] Suggested-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
parent
f833869427
commit
c2791b8069
@ -129,7 +129,7 @@ static void armada_370_xp_free_msi(int hwirq)
|
||||
mutex_unlock(&msi_used_lock);
|
||||
}
|
||||
|
||||
static int armada_370_xp_setup_msi_irq(struct msi_chip *chip,
|
||||
static int armada_370_xp_setup_msi_irq(struct msi_controller *chip,
|
||||
struct pci_dev *pdev,
|
||||
struct msi_desc *desc)
|
||||
{
|
||||
@ -160,7 +160,7 @@ static int armada_370_xp_setup_msi_irq(struct msi_chip *chip,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void armada_370_xp_teardown_msi_irq(struct msi_chip *chip,
|
||||
static void armada_370_xp_teardown_msi_irq(struct msi_controller *chip,
|
||||
unsigned int irq)
|
||||
{
|
||||
struct irq_data *d = irq_get_irq_data(irq);
|
||||
@ -195,7 +195,7 @@ static const struct irq_domain_ops armada_370_xp_msi_irq_ops = {
|
||||
static int armada_370_xp_msi_init(struct device_node *node,
|
||||
phys_addr_t main_int_phys_base)
|
||||
{
|
||||
struct msi_chip *msi_chip;
|
||||
struct msi_controller *msi_chip;
|
||||
u32 reg;
|
||||
int ret;
|
||||
|
||||
|
@ -236,7 +236,7 @@ EXPORT_SYMBOL_GPL(of_pci_get_host_bridge_resources);
|
||||
static LIST_HEAD(of_pci_msi_chip_list);
|
||||
static DEFINE_MUTEX(of_pci_msi_chip_mutex);
|
||||
|
||||
int of_pci_msi_chip_add(struct msi_chip *chip)
|
||||
int of_pci_msi_chip_add(struct msi_controller *chip)
|
||||
{
|
||||
if (!of_property_read_bool(chip->of_node, "msi-controller"))
|
||||
return -EINVAL;
|
||||
@ -249,7 +249,7 @@ int of_pci_msi_chip_add(struct msi_chip *chip)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(of_pci_msi_chip_add);
|
||||
|
||||
void of_pci_msi_chip_remove(struct msi_chip *chip)
|
||||
void of_pci_msi_chip_remove(struct msi_controller *chip)
|
||||
{
|
||||
mutex_lock(&of_pci_msi_chip_mutex);
|
||||
list_del(&chip->list);
|
||||
@ -257,9 +257,9 @@ void of_pci_msi_chip_remove(struct msi_chip *chip)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(of_pci_msi_chip_remove);
|
||||
|
||||
struct msi_chip *of_pci_find_msi_chip_by_node(struct device_node *of_node)
|
||||
struct msi_controller *of_pci_find_msi_chip_by_node(struct device_node *of_node)
|
||||
{
|
||||
struct msi_chip *c;
|
||||
struct msi_controller *c;
|
||||
|
||||
mutex_lock(&of_pci_msi_chip_mutex);
|
||||
list_for_each_entry(c, &of_pci_msi_chip_list, list) {
|
||||
|
@ -205,7 +205,7 @@ const struct irq_domain_ops ks_dw_pcie_msi_domain_ops = {
|
||||
.map = ks_dw_pcie_msi_map,
|
||||
};
|
||||
|
||||
int ks_dw_pcie_msi_host_init(struct pcie_port *pp, struct msi_chip *chip)
|
||||
int ks_dw_pcie_msi_host_init(struct pcie_port *pp, struct msi_controller *chip)
|
||||
{
|
||||
struct keystone_pcie *ks_pcie = to_keystone_pcie(pp);
|
||||
int i;
|
||||
|
@ -55,4 +55,4 @@ void ks_dw_pcie_msi_set_irq(struct pcie_port *pp, int irq);
|
||||
void ks_dw_pcie_msi_clear_irq(struct pcie_port *pp, int irq);
|
||||
void ks_dw_pcie_v3_65_scan_bus(struct pcie_port *pp);
|
||||
int ks_dw_pcie_msi_host_init(struct pcie_port *pp,
|
||||
struct msi_chip *chip);
|
||||
struct msi_controller *chip);
|
||||
|
@ -99,7 +99,7 @@ struct mvebu_pcie_port;
|
||||
struct mvebu_pcie {
|
||||
struct platform_device *pdev;
|
||||
struct mvebu_pcie_port *ports;
|
||||
struct msi_chip *msi;
|
||||
struct msi_controller *msi;
|
||||
struct resource io;
|
||||
char io_name[30];
|
||||
struct resource realio;
|
||||
|
@ -238,7 +238,7 @@
|
||||
)
|
||||
|
||||
struct tegra_msi {
|
||||
struct msi_chip chip;
|
||||
struct msi_controller chip;
|
||||
DECLARE_BITMAP(used, INT_PCI_MSI_NR);
|
||||
struct irq_domain *domain;
|
||||
unsigned long pages;
|
||||
@ -259,7 +259,7 @@ struct tegra_pcie_soc_data {
|
||||
bool has_gen2;
|
||||
};
|
||||
|
||||
static inline struct tegra_msi *to_tegra_msi(struct msi_chip *chip)
|
||||
static inline struct tegra_msi *to_tegra_msi(struct msi_controller *chip)
|
||||
{
|
||||
return container_of(chip, struct tegra_msi, chip);
|
||||
}
|
||||
@ -1283,8 +1283,8 @@ static irqreturn_t tegra_pcie_msi_irq(int irq, void *data)
|
||||
return processed > 0 ? IRQ_HANDLED : IRQ_NONE;
|
||||
}
|
||||
|
||||
static int tegra_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
|
||||
struct msi_desc *desc)
|
||||
static int tegra_msi_setup_irq(struct msi_controller *chip,
|
||||
struct pci_dev *pdev, struct msi_desc *desc)
|
||||
{
|
||||
struct tegra_msi *msi = to_tegra_msi(chip);
|
||||
struct msi_msg msg;
|
||||
@ -1313,7 +1313,8 @@ static int tegra_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void tegra_msi_teardown_irq(struct msi_chip *chip, unsigned int irq)
|
||||
static void tegra_msi_teardown_irq(struct msi_controller *chip,
|
||||
unsigned int irq)
|
||||
{
|
||||
struct tegra_msi *msi = to_tegra_msi(chip);
|
||||
struct irq_data *d = irq_get_irq_data(irq);
|
||||
|
@ -276,7 +276,7 @@ no_valid_irq:
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
||||
static int dw_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
|
||||
static int dw_msi_setup_irq(struct msi_controller *chip, struct pci_dev *pdev,
|
||||
struct msi_desc *desc)
|
||||
{
|
||||
int irq, pos;
|
||||
@ -303,7 +303,7 @@ static int dw_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dw_msi_teardown_irq(struct msi_chip *chip, unsigned int irq)
|
||||
static void dw_msi_teardown_irq(struct msi_controller *chip, unsigned int irq)
|
||||
{
|
||||
struct irq_data *data = irq_get_irq_data(irq);
|
||||
struct msi_desc *msi = irq_data_get_msi(data);
|
||||
@ -312,7 +312,7 @@ static void dw_msi_teardown_irq(struct msi_chip *chip, unsigned int irq)
|
||||
clear_irq_range(pp, irq, 1, data->hwirq);
|
||||
}
|
||||
|
||||
static struct msi_chip dw_pcie_msi_chip = {
|
||||
static struct msi_controller dw_pcie_msi_chip = {
|
||||
.setup_irq = dw_msi_setup_irq,
|
||||
.teardown_irq = dw_msi_teardown_irq,
|
||||
};
|
||||
|
@ -73,7 +73,7 @@ struct pcie_host_ops {
|
||||
u32 (*get_msi_addr)(struct pcie_port *pp);
|
||||
u32 (*get_msi_data)(struct pcie_port *pp, int pos);
|
||||
void (*scan_bus)(struct pcie_port *pp);
|
||||
int (*msi_host_init)(struct pcie_port *pp, struct msi_chip *chip);
|
||||
int (*msi_host_init)(struct pcie_port *pp, struct msi_controller *chip);
|
||||
};
|
||||
|
||||
int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val);
|
||||
|
@ -111,14 +111,14 @@
|
||||
struct rcar_msi {
|
||||
DECLARE_BITMAP(used, INT_PCI_MSI_NR);
|
||||
struct irq_domain *domain;
|
||||
struct msi_chip chip;
|
||||
struct msi_controller chip;
|
||||
unsigned long pages;
|
||||
struct mutex lock;
|
||||
int irq1;
|
||||
int irq2;
|
||||
};
|
||||
|
||||
static inline struct rcar_msi *to_rcar_msi(struct msi_chip *chip)
|
||||
static inline struct rcar_msi *to_rcar_msi(struct msi_controller *chip)
|
||||
{
|
||||
return container_of(chip, struct rcar_msi, chip);
|
||||
}
|
||||
@ -622,7 +622,7 @@ static irqreturn_t rcar_pcie_msi_irq(int irq, void *data)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static int rcar_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
|
||||
static int rcar_msi_setup_irq(struct msi_controller *chip, struct pci_dev *pdev,
|
||||
struct msi_desc *desc)
|
||||
{
|
||||
struct rcar_msi *msi = to_rcar_msi(chip);
|
||||
@ -652,7 +652,7 @@ static int rcar_msi_setup_irq(struct msi_chip *chip, struct pci_dev *pdev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rcar_msi_teardown_irq(struct msi_chip *chip, unsigned int irq)
|
||||
static void rcar_msi_teardown_irq(struct msi_controller *chip, unsigned int irq)
|
||||
{
|
||||
struct rcar_msi *msi = to_rcar_msi(chip);
|
||||
struct irq_data *d = irq_get_irq_data(irq);
|
||||
|
@ -335,7 +335,8 @@ static int xilinx_pcie_assign_msi(struct xilinx_pcie_port *port)
|
||||
* @chip: MSI Chip descriptor
|
||||
* @irq: MSI IRQ to destroy
|
||||
*/
|
||||
static void xilinx_msi_teardown_irq(struct msi_chip *chip, unsigned int irq)
|
||||
static void xilinx_msi_teardown_irq(struct msi_controller *chip,
|
||||
unsigned int irq)
|
||||
{
|
||||
xilinx_pcie_destroy_msi(irq);
|
||||
}
|
||||
@ -348,7 +349,7 @@ static void xilinx_msi_teardown_irq(struct msi_chip *chip, unsigned int irq)
|
||||
*
|
||||
* Return: '0' on success and error value on failure
|
||||
*/
|
||||
static int xilinx_pcie_msi_setup_irq(struct msi_chip *chip,
|
||||
static int xilinx_pcie_msi_setup_irq(struct msi_controller *chip,
|
||||
struct pci_dev *pdev,
|
||||
struct msi_desc *desc)
|
||||
{
|
||||
@ -380,7 +381,7 @@ static int xilinx_pcie_msi_setup_irq(struct msi_chip *chip,
|
||||
}
|
||||
|
||||
/* MSI Chip Descriptor */
|
||||
static struct msi_chip xilinx_pcie_msi_chip = {
|
||||
static struct msi_controller xilinx_pcie_msi_chip = {
|
||||
.setup_irq = xilinx_pcie_msi_setup_irq,
|
||||
.teardown_irq = xilinx_msi_teardown_irq,
|
||||
};
|
||||
|
@ -32,7 +32,7 @@ int pci_msi_ignore_mask;
|
||||
|
||||
int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
|
||||
{
|
||||
struct msi_chip *chip = dev->bus->msi;
|
||||
struct msi_controller *chip = dev->bus->msi;
|
||||
int err;
|
||||
|
||||
if (!chip || !chip->setup_irq)
|
||||
@ -49,7 +49,7 @@ int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
|
||||
|
||||
void __weak arch_teardown_msi_irq(unsigned int irq)
|
||||
{
|
||||
struct msi_chip *chip = irq_get_chip_data(irq);
|
||||
struct msi_controller *chip = irq_get_chip_data(irq);
|
||||
|
||||
if (!chip || !chip->teardown_irq)
|
||||
return;
|
||||
|
@ -65,15 +65,15 @@ void arch_restore_msi_irqs(struct pci_dev *dev);
|
||||
void default_teardown_msi_irqs(struct pci_dev *dev);
|
||||
void default_restore_msi_irqs(struct pci_dev *dev);
|
||||
|
||||
struct msi_chip {
|
||||
struct msi_controller {
|
||||
struct module *owner;
|
||||
struct device *dev;
|
||||
struct device_node *of_node;
|
||||
struct list_head list;
|
||||
|
||||
int (*setup_irq)(struct msi_chip *chip, struct pci_dev *dev,
|
||||
int (*setup_irq)(struct msi_controller *chip, struct pci_dev *dev,
|
||||
struct msi_desc *desc);
|
||||
void (*teardown_irq)(struct msi_chip *chip, unsigned int irq);
|
||||
void (*teardown_irq)(struct msi_controller *chip, unsigned int irq);
|
||||
};
|
||||
|
||||
#endif /* LINUX_MSI_H */
|
||||
|
@ -59,13 +59,13 @@ int of_pci_get_host_bridge_resources(struct device_node *dev,
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_OF) && defined(CONFIG_PCI_MSI)
|
||||
int of_pci_msi_chip_add(struct msi_chip *chip);
|
||||
void of_pci_msi_chip_remove(struct msi_chip *chip);
|
||||
struct msi_chip *of_pci_find_msi_chip_by_node(struct device_node *of_node);
|
||||
int of_pci_msi_chip_add(struct msi_controller *chip);
|
||||
void of_pci_msi_chip_remove(struct msi_controller *chip);
|
||||
struct msi_controller *of_pci_find_msi_chip_by_node(struct device_node *of_node);
|
||||
#else
|
||||
static inline int of_pci_msi_chip_add(struct msi_chip *chip) { return -EINVAL; }
|
||||
static inline void of_pci_msi_chip_remove(struct msi_chip *chip) { }
|
||||
static inline struct msi_chip *
|
||||
static inline int of_pci_msi_chip_add(struct msi_controller *chip) { return -EINVAL; }
|
||||
static inline void of_pci_msi_chip_remove(struct msi_controller *chip) { }
|
||||
static inline struct msi_controller *
|
||||
of_pci_find_msi_chip_by_node(struct device_node *of_node) { return NULL; }
|
||||
#endif
|
||||
|
||||
|
@ -449,7 +449,7 @@ struct pci_bus {
|
||||
struct resource busn_res; /* bus numbers routed to this bus */
|
||||
|
||||
struct pci_ops *ops; /* configuration access functions */
|
||||
struct msi_chip *msi; /* MSI controller */
|
||||
struct msi_controller *msi; /* MSI controller */
|
||||
void *sysdata; /* hook for sys-specific extension */
|
||||
struct proc_dir_entry *procdir; /* directory entry in /proc/bus/pci */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user