ARM: OMAP2+: Remove unused legacy code for PRM
authorTony Lindgren <tony@atomide.com>
Wed, 31 May 2017 22:51:36 +0000 (15:51 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 8 Jun 2017 11:15:10 +0000 (04:15 -0700)
We are now booting all mach-omap2 in device tree only mode.
Any code that is only called in legacy boot mode where
of_have_populated_dt() is not set is safe to remove now.

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/prm3xxx.c
arch/arm/mach-omap2/prm44xx.c
arch/arm/mach-omap2/prm_common.c

index 718981bb80cdf594d77c6b0d5d5067c806729862..395cf43b5c5e46b80e26e276bfd272c14da509a9 100644 (file)
@@ -690,6 +690,8 @@ static const struct of_device_id omap3_prm_dt_match_table[] = {
 
 static int omap3xxx_prm_late_init(void)
 {
+       struct device_node *np;
+       int irq_num;
        int ret;
 
        if (!(prm_features & PRM_HAS_IO_WAKEUP))
@@ -702,16 +704,11 @@ static int omap3xxx_prm_late_init(void)
                omap3_prcm_irq_setup.reconfigure_io_chain =
                        omap3430_pre_es3_1_reconfigure_io_chain;
 
-       if (of_have_populated_dt()) {
-               struct device_node *np;
-               int irq_num;
-
-               np = of_find_matching_node(NULL, omap3_prm_dt_match_table);
-               if (np) {
-                       irq_num = of_irq_get(np, 0);
-                       if (irq_num >= 0)
-                               omap3_prcm_irq_setup.irq = irq_num;
-               }
+       np = of_find_matching_node(NULL, omap3_prm_dt_match_table);
+       if (np) {
+               irq_num = of_irq_get(np, 0);
+               if (irq_num >= 0)
+                       omap3_prcm_irq_setup.irq = irq_num;
        }
 
        omap3xxx_prm_enable_io_wakeup();
index 30768003f8543b4b9080db78c91ea9a3f919a38a..b045f974dc47b55e4b32f0218ed154b144b26259 100644 (file)
@@ -336,27 +336,6 @@ static void omap44xx_prm_reconfigure_io_chain(void)
        return;
 }
 
-/**
- * omap44xx_prm_enable_io_wakeup - enable wakeup events from I/O wakeup latches
- *
- * Activates the I/O wakeup event latches and allows events logged by
- * those latches to signal a wakeup event to the PRCM.  For I/O wakeups
- * to occur, WAKEUPENABLE bits must be set in the pad mux registers, and
- * omap44xx_prm_reconfigure_io_chain() must be called.  No return value.
- */
-static void __init omap44xx_prm_enable_io_wakeup(void)
-{
-       s32 inst = omap4_prmst_get_prm_dev_inst();
-
-       if (inst == PRM_INSTANCE_UNKNOWN)
-               return;
-
-       omap4_prm_rmw_inst_reg_bits(OMAP4430_GLOBAL_WUEN_MASK,
-                                   OMAP4430_GLOBAL_WUEN_MASK,
-                                   inst,
-                                   omap4_prcm_irq_setup.pm_ctrl);
-}
-
 /**
  * omap44xx_prm_read_reset_sources - return the last SoC reset source
  *
@@ -689,8 +668,6 @@ struct pwrdm_ops omap4_pwrdm_operations = {
        .pwrdm_has_voltdm       = omap4_check_vcvp,
 };
 
-static int omap44xx_prm_late_init(void);
-
 /*
  * XXX document
  */
@@ -698,7 +675,6 @@ static struct prm_ll_data omap44xx_prm_ll_data = {
        .read_reset_sources = &omap44xx_prm_read_reset_sources,
        .was_any_context_lost_old = &omap44xx_prm_was_any_context_lost_old,
        .clear_context_loss_flags_old = &omap44xx_prm_clear_context_loss_flags_old,
-       .late_init = &omap44xx_prm_late_init,
        .assert_hardreset       = omap4_prminst_assert_hardreset,
        .deassert_hardreset     = omap4_prminst_deassert_hardreset,
        .is_hardreset_asserted  = omap4_prminst_is_hardreset_asserted,
@@ -735,41 +711,6 @@ int __init omap44xx_prm_init(const struct omap_prcm_init_data *data)
        return prm_register(&omap44xx_prm_ll_data);
 }
 
-static int omap44xx_prm_late_init(void)
-{
-       int irq_num;
-
-       if (!(prm_features & PRM_HAS_IO_WAKEUP))
-               return 0;
-
-       /* OMAP4+ is DT only now */
-       if (!of_have_populated_dt())
-               return 0;
-
-       irq_num = of_irq_get(prm_init_data->np, 0);
-       /*
-        * Already have OMAP4 IRQ num. For all other platforms, we need
-        * IRQ numbers from DT
-        */
-       if (irq_num < 0 && !(prm_init_data->flags & PRM_IRQ_DEFAULT)) {
-               if (irq_num == -EPROBE_DEFER)
-                       return irq_num;
-
-               /* Have nothing to do */
-               return 0;
-       }
-
-       /* Once OMAP4 DT is filled as well */
-       if (irq_num >= 0) {
-               omap4_prcm_irq_setup.irq = irq_num;
-               omap4_prcm_irq_setup.xlate_irq = NULL;
-       }
-
-       omap44xx_prm_enable_io_wakeup();
-
-       return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup);
-}
-
 static void __exit omap44xx_prm_exit(void)
 {
        prm_unregister(&omap44xx_prm_ll_data);
index 2b138b65129a5d609ff2ae02a55181c10154113b..538980ee20d43090765f3f9d025318d7a1ac7159 100644 (file)
@@ -267,10 +267,9 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup)
 {
        int nr_regs;
        u32 mask[OMAP_PRCM_MAX_NR_PENDING_REG];
-       int offset, i;
+       int offset, i, irq;
        struct irq_chip_generic *gc;
        struct irq_chip_type *ct;
-       unsigned int irq;
 
        if (!irq_setup)
                return -EINVAL;
@@ -344,10 +343,8 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup)
                prcm_irq_chips[i] = gc;
        }
 
-       if (of_have_populated_dt()) {
-               int irq = omap_prcm_event_to_irq("io");
-               omap_pcs_legacy_init(irq, irq_setup->reconfigure_io_chain);
-       }
+       irq = omap_prcm_event_to_irq("io");
+       omap_pcs_legacy_init(irq, irq_setup->reconfigure_io_chain);
 
        return 0;