ALSA: sound/atmel/ac97c.c: Fix device index for pcm

chip->pdev->id is -1 by default. This is an invalid index resulting in
device file names like /dev/snd/pcmC0D-1p.

Signed-off-by: Alexander Stein <alexanders83@web.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'for-next'
ALSA: hda - Fix built-in mic at resume on Lenovo Ideapad S210

The built-in mic boost volume gets almost muted after suspend/resume
on Lenovo Ideapad S210.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88121
Reported-and-tested-by: Roman Kagan <rkagan@mail.ru>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'for-linus'
ALSA: sound/atmel/ac97c.c: Add missing clock prepare

Clocks must be prepared before enabling them. Do this in one step.
Replace clk_enable with clk_prepare_enable and clk_disable with
clk_disable_unprepare. This fixes the following warning:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:895 __clk_enable+0x24/0x9c()
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Tainted: G        W      3.18.0-rc7+ #245
[<c000dce8>] (unwind_backtrace) from [<c000bcf0>] (show_stack+0x10/0x14)
[<c000bcf0>] (show_stack) from [<c001664c>] (warn_slowpath_common+0x60/0x80)
[<c001664c>] (warn_slowpath_common) from [<c00166fc>] (warn_slowpath_null+0x18/0x20)
[<c00166fc>] (warn_slowpath_null) from [<c02fd7ac>] (__clk_enable+0x24/0x9c)
[<c02fd7ac>] (__clk_enable) from [<c02fdbb4>] (clk_enable+0x18/0x2c)
[<c02fdbb4>] (clk_enable) from [<c0322688>] (atmel_ac97c_probe+0x154/0x694)
[<c0322688>] (atmel_ac97c_probe) from [<c0235e08>] (platform_drv_probe+0x48/0x94)
[<c0235e08>] (platform_drv_probe) from [<c02345f8>] (driver_probe_device+0x138/0x350)
[<c02345f8>] (driver_probe_device) from [<c02348bc>] (__driver_attach+0x68/0x8c)
[<c02348bc>] (__driver_attach) from [<c0232bd0>] (bus_for_each_dev+0x70/0x84)
[<c0232bd0>] (bus_for_each_dev) from [<c0233cd8>] (bus_add_driver+0xfc/0x1f8)
[<c0233cd8>] (bus_add_driver) from [<c0234f0c>] (driver_register+0x9c/0xe0)
[<c0234f0c>] (driver_register) from [<c0008ac4>] (do_one_initcall+0x110/0x1c8)
[<c0008ac4>] (do_one_initcall) from [<c053cd58>] (kernel_init_freeable+0xf8/0x1b8)
[<c053cd58>] (kernel_init_freeable) from [<c03c0414>] (kernel_init+0x8/0xe4)
[<c03c0414>] (kernel_init) from [<c00096d0>] (ret_from_fork+0x14/0x24)
---[ end trace cb88537fdc8fa201 ]---
atmel_ac97c fffa0000.sound: AC'97 0 does not respond - RESET
atmel_ac97c fffa0000.sound: AC'97 0 access is not valid [0xffffffff], removing mixer.
------------[ cut here ]------------

Signed-off-by: Alexander Stein <alexanders83@web.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: atmel_abdac: Add missing clock prepare

Clocks must be prepared before enabling them. Do this in one step.
Replace clk_enable with clk_prepare_enable and clk_disable with
clk_disable_unprepare.

Signed-off-by: Alexander Stein <alexanders83@web.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'for-next'
ALSA: usb-audio: Don't resubmit pending URBs at MIDI error recovery

In snd_usbmidi_error_timer(), the driver tries to resubmit MIDI input
URBs to reactivate the MIDI stream, but this causes the error when
some of URBs are still pending like:

 WARNING: CPU: 0 PID: 0 at ../drivers/usb/core/urb.c:339 usb_submit_urb+0x5f/0x70()
 URB ef705c40 submitted while active
 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.16.6-2-desktop #1
 Hardware name: FOXCONN TPS01/TPS01, BIOS 080015  03/23/2010
  c0984bfa f4009ed4 c078deaf f4009ee4 c024c884 c09a135c f4009f00 00000000
  c0984bfa 00000153 c061ac4f c061ac4f 00000009 00000001 ef705c40 e854d1c0
  f4009eec c024c8d3 00000009 f4009ee4 c09a135c f4009f00 f4009f04 c061ac4f
 Call Trace:
  [<c0205df6>] try_stack_unwind+0x156/0x170
  [<c020482a>] dump_trace+0x5a/0x1b0
  [<c0205e56>] show_trace_log_lvl+0x46/0x50
  [<c02049d1>] show_stack_log_lvl+0x51/0xe0
  [<c0205eb7>] show_stack+0x27/0x50
  [<c078deaf>] dump_stack+0x45/0x65
  [<c024c884>] warn_slowpath_common+0x84/0xa0
  [<c024c8d3>] warn_slowpath_fmt+0x33/0x40
  [<c061ac4f>] usb_submit_urb+0x5f/0x70
  [<f7974104>] snd_usbmidi_submit_urb+0x14/0x60 [snd_usbmidi_lib]
  [<f797483a>] snd_usbmidi_error_timer+0x6a/0xa0 [snd_usbmidi_lib]
  [<c02570c0>] call_timer_fn+0x30/0x130
  [<c0257442>] run_timer_softirq+0x1c2/0x260
  [<c0251493>] __do_softirq+0xc3/0x270
  [<c0204732>] do_softirq_own_stack+0x22/0x30
  [<c025186d>] irq_exit+0x8d/0xa0
  [<c0795228>] smp_apic_timer_interrupt+0x38/0x50
  [<c0794a3c>] apic_timer_interrupt+0x34/0x3c
  [<c0673d9e>] cpuidle_enter_state+0x3e/0xd0
  [<c028bb8d>] cpu_idle_loop+0x29d/0x3e0
  [<c028bd23>] cpu_startup_entry+0x53/0x60
  [<c0bfac1e>] start_kernel+0x415/0x41a

For avoiding these errors, check the pending URBs and skip
resubmitting such ones.

Reported-and-tested-by: Stefan Seyfried <stefan.seyfried@googlemail.com>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'for-linus'