clk: rockchip: rk3288: fix up the clk register for hclk_vio
[firefly-linux-kernel-4.4.55.git] / drivers / usb / gadget / function / f_audio_source.c
index bcd817439dbf92efdc24885629a16a3de07bd261..db7903d19c435e4c5b08c09270baa44c5c48b6b2 100644 (file)
@@ -310,6 +310,7 @@ static struct device_attribute *audio_source_function_attributes[] = {
 static struct usb_request *audio_request_new(struct usb_ep *ep, int buffer_size)
 {
        struct usb_request *req = usb_ep_alloc_request(ep, GFP_KERNEL);
+
        if (!req)
                return NULL;
 
@@ -377,10 +378,9 @@ static void audio_send(struct audio_dev *audio)
 
        /* compute number of frames to send */
        now = ktime_get();
-       msecs = ktime_to_ns(now) - ktime_to_ns(audio->start_time);
-       do_div(msecs, 1000000);
-       frames = msecs * SAMPLE_RATE;
-       do_div(frames, 1000);
+       msecs = div_s64((ktime_to_ns(now) - ktime_to_ns(audio->start_time)),
+                       1000000);
+       frames = div_s64((msecs * SAMPLE_RATE), 1000);
 
        /* Readjust our frames_sent if we fall too far behind.
         * If we get too far behind it is better to drop some frames than