[PATCH 8/8] soc: sunxi: mbus: don't access of_root directly

Bartosz Golaszewski posted 8 patches 3 weeks ago
[PATCH 8/8] soc: sunxi: mbus: don't access of_root directly
Posted by Bartosz Golaszewski 3 weeks ago
Don't access of_root directly as it reduces the build test coverage for
this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
to retrieve the relevant information.

Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/soc/sunxi/sunxi_mbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/sunxi/sunxi_mbus.c b/drivers/soc/sunxi/sunxi_mbus.c
index 1734da357ca21b249740e089698275507ea98a8a..8bc5f62ff258837d3f3b30cb84b60d1872b31c27 100644
--- a/drivers/soc/sunxi/sunxi_mbus.c
+++ b/drivers/soc/sunxi/sunxi_mbus.c
@@ -118,7 +118,7 @@ static const char * const sunxi_mbus_platforms[] __initconst = {
 
 static int __init sunxi_mbus_init(void)
 {
-	if (!of_device_compatible_match(of_root, sunxi_mbus_platforms))
+	if (!of_machine_compatible_match(sunxi_mbus_platforms))
 		return 0;
 
 	bus_register_notifier(&platform_bus_type, &sunxi_mbus_nb);

-- 
2.47.3
Re: [PATCH 8/8] soc: sunxi: mbus: don't access of_root directly
Posted by Chen-Yu Tsai 2 weeks, 6 days ago
On Mon, Jan 19, 2026 at 6:40 PM Bartosz Golaszewski
<bartosz.golaszewski@oss.qualcomm.com> wrote:
>
> Don't access of_root directly as it reduces the build test coverage for
> this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
> to retrieve the relevant information.

I was somewhat expecting a matching change to the Kconfig to add
COMPILE_TEST to the "depends on" line.

But maybe the case is already hit with ARM=y && USE_OF=n ?

ChenYu

> Suggested-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
>  drivers/soc/sunxi/sunxi_mbus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/sunxi/sunxi_mbus.c b/drivers/soc/sunxi/sunxi_mbus.c
> index 1734da357ca21b249740e089698275507ea98a8a..8bc5f62ff258837d3f3b30cb84b60d1872b31c27 100644
> --- a/drivers/soc/sunxi/sunxi_mbus.c
> +++ b/drivers/soc/sunxi/sunxi_mbus.c
> @@ -118,7 +118,7 @@ static const char * const sunxi_mbus_platforms[] __initconst = {
>
>  static int __init sunxi_mbus_init(void)
>  {
> -       if (!of_device_compatible_match(of_root, sunxi_mbus_platforms))
> +       if (!of_machine_compatible_match(sunxi_mbus_platforms))
>                 return 0;
>
>         bus_register_notifier(&platform_bus_type, &sunxi_mbus_nb);
>
> --
> 2.47.3
>
Re: [PATCH 8/8] soc: sunxi: mbus: don't access of_root directly
Posted by Bartosz Golaszewski 2 weeks, 6 days ago
On Tue, Jan 20, 2026 at 9:05 AM Chen-Yu Tsai <wens@kernel.org> wrote:
>
> On Mon, Jan 19, 2026 at 6:40 PM Bartosz Golaszewski
> <bartosz.golaszewski@oss.qualcomm.com> wrote:
> >
> > Don't access of_root directly as it reduces the build test coverage for
> > this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
> > to retrieve the relevant information.
>
> I was somewhat expecting a matching change to the Kconfig to add
> COMPILE_TEST to the "depends on" line.
>
> But maybe the case is already hit with ARM=y && USE_OF=n ?
>

Yeah, that would be the next step but there may be more weird
dependencies hidden in here so let's do it separately after this is
addressed or we'll get stuck looking and buildbot reports.

Bart
Re: [PATCH 8/8] soc: sunxi: mbus: don't access of_root directly
Posted by Jernej Škrabec 3 weeks ago
Dne ponedeljek, 19. januar 2026 ob 11:40:19 Srednjeevropski standardni čas je Bartosz Golaszewski napisal(a):
> Don't access of_root directly as it reduces the build test coverage for
> this driver with COMPILE_TEST=y and OF=n. Use existing helper functions
> to retrieve the relevant information.
> 
> Suggested-by: Rob Herring <robh@kernel.org>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej