net: wireless: bcmdhd: Skip country setting if unnecessary
authorDmitry Shmidt <dimitrysh@google.com>
Thu, 28 Jun 2012 23:38:27 +0000 (16:38 -0700)
committerDmitry Shmidt <dimitrysh@google.com>
Thu, 12 Jul 2012 17:45:48 +0000 (10:45 -0700)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcmdhd/wldev_common.c

index 8270331850354c516e7245e02d55f2d4212eed9f..a1156fffe7e6ee7fd5122c6538d35419ebc3fb8f 100644 (file)
@@ -349,21 +349,22 @@ int wldev_set_country(
                                __FUNCTION__, error));
                        return error;
                }
-       }
-       cspec.rev = -1;
-       memcpy(cspec.country_abbrev, country_code, WLC_CNTRY_BUF_SZ);
-       memcpy(cspec.ccode, country_code, WLC_CNTRY_BUF_SZ);
-       get_customized_country_code((char *)&cspec.country_abbrev, &cspec);
-       error = wldev_iovar_setbuf(dev, "country", &cspec, sizeof(cspec),
-               smbuf, sizeof(smbuf), NULL);
-       if (error < 0) {
-               WLDEV_ERROR(("%s: set country for %s as %s rev %d failed\n",
+
+               cspec.rev = -1;
+               memcpy(cspec.country_abbrev, country_code, WLC_CNTRY_BUF_SZ);
+               memcpy(cspec.ccode, country_code, WLC_CNTRY_BUF_SZ);
+               get_customized_country_code((char *)&cspec.country_abbrev, &cspec);
+               error = wldev_iovar_setbuf(dev, "country", &cspec, sizeof(cspec),
+                       smbuf, sizeof(smbuf), NULL);
+               if (error < 0) {
+                       WLDEV_ERROR(("%s: set country for %s as %s rev %d failed\n",
+                               __FUNCTION__, country_code, cspec.ccode, cspec.rev));
+                       return error;
+               }
+               dhd_bus_country_set(dev, &cspec);
+               WLDEV_ERROR(("%s: set country for %s as %s rev %d\n",
                        __FUNCTION__, country_code, cspec.ccode, cspec.rev));
-               return error;
        }
-       dhd_bus_country_set(dev, &cspec);
-       WLDEV_ERROR(("%s: set country for %s as %s rev %d\n",
-               __FUNCTION__, country_code, cspec.ccode, cspec.rev));
        return 0;
 }