Commit 80d6e96b authored by Christian Lamparter's avatar Christian Lamparter Committed by John W. Linville

carl9170: Use do_div for 64-bit division to fix 32-bit kernels

Use the do_div macro for 64-bit division. Otherwise, the module will
reference __udivdi3 under 32-bit kernels, which is not allowed in
kernel space.

drivers/built-in.o: In function `carl9170_collect_tally':
cmd.c:191: undefined reference to `__udivdi3'
cmd.c:192: undefined reference to `__udivdi3'
cmd.c:193: undefined reference to `__udivdi3'
Reported-by: default avatarKalle Valo <kvalo@adurom.com>
Signed-off-by: default avatarChristian Lamparter <chunkeey@googlemail.com>
Tested-by: default avatarKalle Valo <kvalo@adurom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5a63ef0f
......@@ -36,6 +36,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <asm/div64.h>
#include "carl9170.h"
#include "cmd.h"
......@@ -187,10 +188,12 @@ int carl9170_collect_tally(struct ar9170 *ar)
if (ar->channel) {
info = &ar->survey[ar->channel->hw_value];
info->channel_time = ar->tally.active / 1000;
info->channel_time_busy = ar->tally.cca / 1000;
info->channel_time_tx = ar->tally.tx_time / 1000;
info->channel_time = ar->tally.active;
info->channel_time_busy = ar->tally.cca;
info->channel_time_tx = ar->tally.tx_time;
do_div(info->channel_time, 1000);
do_div(info->channel_time_busy, 1000);
do_div(info->channel_time_tx, 1000);
}
}
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment