@@ -2452,6 +2452,9 @@ static int of_dev_hwmod_lookup(struct device_node *np,
24522452 * registers. This address is needed early so the OCP registers that
24532453 * are part of the device's address space can be ioremapped properly.
24542454 *
2455+ * If SYSC access is not needed, the registers will not be remapped
2456+ * and non-availability of MPU access is not treated as an error.
2457+ *
24552458 * Returns 0 on success, -EINVAL if an invalid hwmod is passed, and
24562459 * -ENXIO on absent or invalid register target address space.
24572460 */
@@ -2466,6 +2469,11 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
24662469
24672470 _save_mpu_port_index (oh );
24682471
2472+ /* if we don't need sysc access we don't need to ioremap */
2473+ if (!oh -> class -> sysc )
2474+ return 0 ;
2475+
2476+ /* we can't continue without MPU PORT if we need sysc access */
24692477 if (oh -> _int_flags & _HWMOD_NO_MPU_PORT )
24702478 return - ENXIO ;
24712479
@@ -2475,8 +2483,10 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
24752483 oh -> name );
24762484
24772485 /* Extract the IO space from device tree blob */
2478- if (!np )
2486+ if (!np ) {
2487+ pr_err ("omap_hwmod: %s: no dt node\n" , oh -> name );
24792488 return - ENXIO ;
2489+ }
24802490
24812491 va_start = of_iomap (np , index + oh -> mpu_rt_idx );
24822492 } else {
@@ -2535,13 +2545,11 @@ static int __init _init(struct omap_hwmod *oh, void *data)
25352545 oh -> name , np -> name );
25362546 }
25372547
2538- if (oh -> class -> sysc ) {
2539- r = _init_mpu_rt_base (oh , NULL , index , np );
2540- if (r < 0 ) {
2541- WARN (1 , "omap_hwmod: %s: doesn't have mpu register target base\n" ,
2542- oh -> name );
2543- return 0 ;
2544- }
2548+ r = _init_mpu_rt_base (oh , NULL , index , np );
2549+ if (r < 0 ) {
2550+ WARN (1 , "omap_hwmod: %s: doesn't have mpu register target base\n" ,
2551+ oh -> name );
2552+ return 0 ;
25452553 }
25462554
25472555 r = _init_clocks (oh , NULL );
0 commit comments