]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/staging/lirc/lirc_serial.c
Merge branch 'fix/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[mv-sheeva.git] / drivers / staging / lirc / lirc_serial.c
index 971844bbee284a141f36d6221a29fb793a6574a9..1c3099b388e0acefd601621dbe05a9c6b78451b7 100644 (file)
@@ -377,7 +377,7 @@ static int init_timing_params(unsigned int new_duty_cycle,
        duty_cycle = new_duty_cycle;
        freq = new_freq;
 
-       loops_per_sec = current_cpu_data.loops_per_jiffy;
+       loops_per_sec = __this_cpu_read(cpu.info.loops_per_jiffy);
        loops_per_sec *= HZ;
 
        /* How many clocks in a microsecond?, avoiding long long divide */
@@ -398,7 +398,7 @@ static int init_timing_params(unsigned int new_duty_cycle,
        dprintk("in init_timing_params, freq=%d, duty_cycle=%d, "
                "clk/jiffy=%ld, pulse=%ld, space=%ld, "
                "conv_us_to_clocks=%ld\n",
-               freq, duty_cycle, current_cpu_data.loops_per_jiffy,
+               freq, duty_cycle, __this_cpu_read(cpu_info.loops_per_jiffy),
                pulse_width, space_width, conv_us_to_clocks);
        return 0;
 }
@@ -966,7 +966,7 @@ static ssize_t lirc_write(struct file *file, const char *buf,
        if (n % sizeof(int) || count % 2 == 0)
                return -EINVAL;
        wbuf = memdup_user(buf, n);
-       if (PTR_ERR(wbuf))
+       if (IS_ERR(wbuf))
                return PTR_ERR(wbuf);
        spin_lock_irqsave(&hardware[type].lock, flags);
        if (type == LIRC_IRDEO) {
@@ -981,6 +981,7 @@ static ssize_t lirc_write(struct file *file, const char *buf,
        }
        off();
        spin_unlock_irqrestore(&hardware[type].lock, flags);
+       kfree(wbuf);
        return n;
 }