Merge tag 'module_init-device_initcall-v4.1-rc8' of git://git.kernel.org/pub/scm...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 2 Jul 2015 17:30:48 +0000 (10:30 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 2 Jul 2015 17:30:48 +0000 (10:30 -0700)
Pull module_init replacement part one from Paul Gortmaker:
 "Replace module_init with equivalent device_initcall in non modules.

  This series of commits converts non-modular code that is using the
  module_init() call to hook itself into the system to instead use
  device_initcall().

  The conversion is a runtime no-op, since module_init actually becomes
  __initcall in the non-modular case, and that in turn gets mapped onto
  device_initcall.  A couple files show a larger negative diffstat,
  representing ones that had a module_exit function that we remove here
  vs previously relying on the linker to dispose of it.

  We make this conversion now, so that we can relocate module_init from
  init.h into module.h in the future.

  The files changed here are just limited to those that would otherwise
  have to add module.h to obviously non-modular code, in order to avoid
  a compile fail, as testing has shown"

* tag 'module_init-device_initcall-v4.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
  MIPS: don't use module_init in non-modular cobalt/mtd.c file
  drivers/leds: don't use module_init in non-modular leds-cobalt-raq.c
  cris: don't use module_init for non-modular core eeprom.c code
  tty/metag_da: Avoid module_init/module_exit in non-modular code
  drivers/clk: don't use module_init in clk-nomadik.c which is non-modular
  xtensa: don't use module_init for non-modular core network.c code
  sh: don't use module_init in non-modular psw.c code
  mn10300: don't use module_init in non-modular flash.c code
  parisc64: don't use module_init for non-modular core perf code
  parisc: don't use module_init for non-modular core pdc_cons code
  cris: don't use module_init for non-modular core intmem.c code
  ia64: don't use module_init in non-modular sim/simscsi.c code
  ia64: don't use module_init for non-modular core kernel/mca.c code
  arm: don't use module_init in non-modular mach-vexpress/spc.c code
  powerpc: don't use module_init in non-modular 83xx suspend code
  powerpc: use device_initcall for registering rtc devices
  x86: don't use module_init in non-modular devicetree.c code
  x86: don't use module_init in non-modular intel_mid_vrtc.c

1  2 
arch/x86/kernel/devicetree.c

index 5ee771859b6f6e144090efe8f315e0c7707978b3,3743b92089deced28f4fe6e150499fe97cbab201..1f4acd68b98bccb7bf4032bc6ff2bde3f4efecdb
@@@ -4,6 -4,7 +4,6 @@@
  #include <linux/bootmem.h>
  #include <linux/export.h>
  #include <linux/io.h>
 -#include <linux/irqdomain.h>
  #include <linux/interrupt.h>
  #include <linux/list.h>
  #include <linux/of.h>
@@@ -16,7 -17,6 +16,7 @@@
  #include <linux/of_pci.h>
  #include <linux/initrd.h>
  
 +#include <asm/irqdomain.h>
  #include <asm/hpet.h>
  #include <asm/apic.h>
  #include <asm/pci_x86.h>
@@@ -65,7 -65,7 +65,7 @@@ static int __init add_bus_probe(void
  
        return of_platform_bus_probe(NULL, ce4100_ids, NULL);
  }
module_init(add_bus_probe);
device_initcall(add_bus_probe);
  
  #ifdef CONFIG_PCI
  struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus)
@@@ -196,31 -196,38 +196,31 @@@ static struct of_ioapic_type of_ioapic_
        },
  };
  
 -static int ioapic_xlate(struct irq_domain *domain,
 -                      struct device_node *controller,
 -                      const u32 *intspec, u32 intsize,
 -                      irq_hw_number_t *out_hwirq, u32 *out_type)
 +static int dt_irqdomain_alloc(struct irq_domain *domain, unsigned int virq,
 +                            unsigned int nr_irqs, void *arg)
  {
 +      struct of_phandle_args *irq_data = (void *)arg;
        struct of_ioapic_type *it;
 -      u32 line, idx, gsi;
 +      struct irq_alloc_info tmp;
  
 -      if (WARN_ON(intsize < 2))
 +      if (WARN_ON(irq_data->args_count < 2))
                return -EINVAL;
 -
 -      line = intspec[0];
 -
 -      if (intspec[1] >= ARRAY_SIZE(of_ioapic_type))
 +      if (irq_data->args[1] >= ARRAY_SIZE(of_ioapic_type))
                return -EINVAL;
  
 -      it = &of_ioapic_type[intspec[1]];
 +      it = &of_ioapic_type[irq_data->args[1]];
 +      ioapic_set_alloc_attr(&tmp, NUMA_NO_NODE, it->trigger, it->polarity);
 +      tmp.ioapic_id = mpc_ioapic_id(mp_irqdomain_ioapic_idx(domain));
 +      tmp.ioapic_pin = irq_data->args[0];
  
 -      idx = (u32)(long)domain->host_data;
 -      gsi = mp_pin_to_gsi(idx, line);
 -      if (mp_set_gsi_attr(gsi, it->trigger, it->polarity, cpu_to_node(0)))
 -              return -EBUSY;
 -
 -      *out_hwirq = line;
 -      *out_type = it->out_type;
 -      return 0;
 +      return mp_irqdomain_alloc(domain, virq, nr_irqs, &tmp);
  }
  
 -const struct irq_domain_ops ioapic_irq_domain_ops = {
 -      .map = mp_irqdomain_map,
 -      .unmap = mp_irqdomain_unmap,
 -      .xlate = ioapic_xlate,
 +static const struct irq_domain_ops ioapic_irq_domain_ops = {
 +      .alloc          = dt_irqdomain_alloc,
 +      .free           = mp_irqdomain_free,
 +      .activate       = mp_irqdomain_activate,
 +      .deactivate     = mp_irqdomain_deactivate,
  };
  
  static void __init dtb_add_ioapic(struct device_node *dn)