aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/networking
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-10-24 14:32:20 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:02:30 -0400
commitd2372b315289aec9f565a855023c40654a5bff68 (patch)
treecfc73e74dfdea854dd27b747d68224076d8e8d90 /Documentation/networking
parent7dddaf1a36a372c14ca96a0b5fdfbe2015c43841 (diff)
wireless: make regdom passing semantics simpler
The regdom struct is given to the core, so it might as well free it in error conditions. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'Documentation/networking')
-rw-r--r--Documentation/networking/regulatory.txt13
1 files changed, 3 insertions, 10 deletions
diff --git a/Documentation/networking/regulatory.txt b/Documentation/networking/regulatory.txt
index a96989a8ff35..357d4ba4f135 100644
--- a/Documentation/networking/regulatory.txt
+++ b/Documentation/networking/regulatory.txt
@@ -167,7 +167,6 @@ struct ieee80211_regdomain mydriver_jp_regdom = {
167 167
168Then in some part of your code after your wiphy has been registered: 168Then in some part of your code after your wiphy has been registered:
169 169
170 int r;
171 struct ieee80211_regdomain *rd; 170 struct ieee80211_regdomain *rd;
172 int size_of_regd; 171 int size_of_regd;
173 int num_rules = mydriver_jp_regdom.n_reg_rules; 172 int num_rules = mydriver_jp_regdom.n_reg_rules;
@@ -178,17 +177,11 @@ Then in some part of your code after your wiphy has been registered:
178 177
179 rd = kzalloc(size_of_regd, GFP_KERNEL); 178 rd = kzalloc(size_of_regd, GFP_KERNEL);
180 if (!rd) 179 if (!rd)
181 return -ENOMEM; 180 return -ENOMEM;
182 181
183 memcpy(rd, &mydriver_jp_regdom, sizeof(struct ieee80211_regdomain)); 182 memcpy(rd, &mydriver_jp_regdom, sizeof(struct ieee80211_regdomain));
184 183
185 for (i=0; i < num_rules; i++) { 184 for (i=0; i < num_rules; i++)
186 memcpy(&rd->reg_rules[i], &mydriver_jp_regdom.reg_rules[i], 185 memcpy(&rd->reg_rules[i], &mydriver_jp_regdom.reg_rules[i],
187 sizeof(struct ieee80211_reg_rule)); 186 sizeof(struct ieee80211_reg_rule));
188 } 187 return regulatory_hint(hw->wiphy, NULL, rd);
189 r = regulatory_hint(hw->wiphy, NULL, rd);
190 if (r) {
191 kfree(rd);
192 return r;
193 }
194