static int hsmp_test(u16 sock_ind, u32 value)
 {
        struct hsmp_message msg = { 0 };
-       struct amd_northbridge *nb;
-       int ret = -ENODEV;
-
-       nb = node_to_amd_nb(sock_ind);
-       if (!nb || !nb->root)
-               return ret;
+       int ret;
 
        /*
         * Test the hsmp port by performing TEST command. The test message
        msg.args[0]     = value;
        msg.sock_ind    = sock_ind;
 
-       ret = __hsmp_send_message(nb->root, &msg);
+       ret = hsmp_send_message(&msg);
        if (ret)
                return ret;
 
        for (i = 0; i < plat_dev.num_sockets; i++) {
                sema_init(&plat_dev.sock[i].hsmp_sem, 1);
                plat_dev.sock[i].sock_ind = i;
+
+               /* Test the hsmp interface on each socket */
+               ret = hsmp_test(i, 0xDEADBEEF);
+               if (ret) {
+                       pr_err("HSMP test message failed on Fam:%x model:%x\n",
+                              boot_cpu_data.x86, boot_cpu_data.x86_model);
+                       pr_err("Is HSMP disabled in BIOS ?\n");
+                       return ret;
+               }
        }
 
        plat_dev.hsmp_device.name       = HSMP_CDEV_NAME;
 static int __init hsmp_plt_init(void)
 {
        int ret = -ENODEV;
-       int i;
 
        if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD || boot_cpu_data.x86 < 0x19) {
                pr_err("HSMP is not supported on Family:%x model:%x\n",
        if (plat_dev.num_sockets == 0)
                return ret;
 
-       /* Test the hsmp interface on each socket */
-       for (i = 0; i < plat_dev.num_sockets; i++) {
-               ret = hsmp_test(i, 0xDEADBEEF);
-               if (ret) {
-                       pr_err("HSMP test message failed on Fam:%x model:%x\n",
-                              boot_cpu_data.x86, boot_cpu_data.x86_model);
-                       pr_err("Is HSMP disabled in BIOS ?\n");
-                       return ret;
-               }
-       }
-
        ret = platform_driver_register(&amd_hsmp_driver);
        if (ret)
                return ret;