Commit graph

118 commits

Author SHA1 Message Date
Himanshu Jha
39cdc62b1b ALSA: ctxfi: Remove null check before kfree
kfree on NULL pointer is a no-op and therefore checking is redundant.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-08-31 20:10:30 +02:00
Bhumika Goyal
faa119099e ALSA: ctxfi: make hw structures const
Make these const as they are only used in a copy operation.
Done using Coccinelle:

@match disable optional_qualifier@
identifier s;
@@
static struct hw s = {...};

@ref@
position p;
identifier match.s;
@@
s@p

@good1@
position ref.p;
identifier match.s,f,c;
expression e;
@@
(
e = s@p
|
e = s@p.f
|
c(...,s@p.f,...)
|
c(...,s@p,...)
)

@bad depends on  !good1@
position ref.p;
identifier match.s;
@@
s@p

@depends on forall !bad disable optional_qualifier@
identifier match.s;
@@
static
+ const
struct hw s;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-08-23 15:55:18 +02:00
Markus Elfring
cbb7eb20bb ALSA: ctxfi: Use common error handling code in two functions
Add jump targets so that a bit of exception handling can be better reused
at the end of these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-08-22 19:43:29 +02:00
Bhumika Goyal
4f8f04e8bd ALSA: ctxfi: make snd_pcm_hardware const
Make these const as they are only used during a copy operation.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-08-12 23:31:50 +02:00
Takashi Iwai
f363a06642 ALSA: ctxfi: Fix the incorrect check of dma_set_mask() call
In the commit [15c75b09f8: ALSA: ctxfi: Fallback DMA mask to 32bit],
I forgot to put "!" at dam_set_mask() call check in cthw20k1.c (while
cthw20k2.c is OK).  This patch fixes that obvious bug.

(As a side note: although the original commit was completely wrong,
 it's still working for most of machines, as it sets to 32bit DMA mask
 in the end.  So the bug severity is low.)

Fixes: 15c75b09f8 ("ALSA: ctxfi: Fallback DMA mask to 32bit")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-20 10:08:19 +01:00
Takashi Iwai
15c75b09f8 ALSA: ctxfi: Fallback DMA mask to 32bit
Currently ctxfi driver tries to set only the 64bit DMA mask on 64bit
architectures, and bails out if it fails.  This causes a problem on
some platforms since the 64bit DMA isn't always guaranteed.  We should
fall back to the default 32bit DMA when 64bit DMA fails.

Fixes: 6d74b86d3c ("ALSA: ctxfi - Allow 64bit DMA")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-28 17:58:02 +01:00
Julia Lawall
071f1344f4 ALSA: pci: constify local structures
For structure types defined in the same file or local header files, find
top-level static structure declarations that have the following
properties:
1. Never reassigned.
2. Address never taken
3. Not passed to a top-level macro call
4. No pointer or array-typed field passed to a function or stored in a
variable.
Declare structures having all of these properties as const.

Done using Coccinelle.
Based on a suggestion by Joe Perches <joe@perches.com>.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-12 08:17:19 +02:00
Masahiro Yamada
44cc4a017e ALSA: squash lines for simple wrapper functions
Remove unneeded variables and assignments.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-07 20:35:29 +02:00
Julia Lawall
6769e988b0 ALSA: constify snd_pcm_ops structures
Check for snd_pcm_ops structures that are only stored in the ops field of a
snd_soc_platform_driver structure or passed as the third argument to
snd_pcm_set_ops.  The corresponding field or parameter is declared const,
so snd_pcm_ops structures that have this property can be declared as const
also.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct snd_pcm_ops i@p = { ... };

@ok1@
identifier r.i;
struct snd_soc_platform_driver e;
position p;
@@
e.ops = &i@p;

@ok2@
identifier r.i;
expression e1, e2;
position p;
@@
snd_pcm_set_ops(e1, e2, &i@p)

@bad@
position p != {r.p,ok1.p,ok2.p};
identifier r.i;
struct snd_pcm_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct snd_pcm_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-09-02 11:49:10 +02:00
Amitoj Kaur Chawla
d169133889 ALSA: ctxfi: Change structure initialisation to C99 style
For readability and to allow for structure randomisation, replace the
in order struct initialisation style with explicit field style.

The Coccinelle semantic patch used to make this change is as follows:

@decl@
identifier i1,fld;
type T;
field list[n] fs;
@@

struct i1 {
 fs
 T fld;
 ...};

@@
identifier decl.i1,i2,decl.fld;
expression e;
position bad.p, bad.fix;
@@

struct i1 i2@p = { ...,
+ .fld = e
- e@fix
 ,...};

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-06-17 16:58:45 +02:00
Julia Lawall
5305239312 ALSA: constify ct_timer_ops structures
The ct_timer_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-04-09 10:58:04 +02:00
Julia Lawall
43f2cdeb7a ALSA: ctxfi: constify rsc ops structures
The various rsc ops structures are never modified, so declare them as
const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-11-11 08:40:56 +01:00
Quentin Lambert
412b979ccc ALSA: remove deprecated use of pci api
Replace occurences of the pci api by appropriate call to the dma api.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr)

@deprecated@
idexpression id;
position p;
@@

(
  pci_dma_supported@p ( id, ...)
|
  pci_alloc_consistent@p ( id, ...)
)

@bad1@
idexpression id;
position deprecated.p;
@@
...when != &id->dev
   when != pci_get_drvdata ( id )
   when != pci_enable_device ( id )
(
  pci_dma_supported@p ( id, ...)
|
  pci_alloc_consistent@p ( id, ...)
)

@depends on !bad1@
idexpression id;
expression direction;
position deprecated.p;
@@

(
- pci_dma_supported@p ( id,
+ dma_supported ( &id->dev,
...
+ , GFP_ATOMIC
  )
|
- pci_alloc_consistent@p ( id,
+ dma_alloc_coherent ( &id->dev,
...
+ , GFP_ATOMIC
  )
)

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-04-16 12:19:52 +02:00
Takashi Iwai
9e5947465d Merge branch 'topic/pci-cleanup' into for-next 2015-01-11 11:26:48 +01:00
Takashi Iwai
7247aabd5a ALSA: ctxfi: Simplify PM callbacks
This is a similar cleanup like the commit [3db084fd0a: ALSA: fm801:
PCI core handles power state for us].

Since pci_set_power_state(), pci_save_state() and pci_restore_state()
are already done in the PCI core side, so we don't need to it doubly.

Also, pci_enable_device(), pci_disable_device() and pci_set_master()
calls in PM callbacks are superfluous nowadays, too, so get rid of
them as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-09 16:24:20 +01:00
Markus Elfring
ff6defa6a8 ALSA: Deletion of checks before the function call "iounmap"
The iounmap() function performs also input parameter validation.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-04 15:13:45 +01:00
Joe Perches
5395103dcc ALSA: ctxfi: Neaten get_daio_rsc
Move the pointer declarations into the blocks that use them.
Neaten the kfree calls when the _init functions fail.

Trivially reduces object size (defconfig x86-64)

$ size sound/pci/ctxfi/ctdaio.o.*
   text	   data	    bss	    dec	    hex	filename
   5287	    224	      0	   5511	   1587	sound/pci/ctxfi/ctdaio.o.new
   5319	    224	      0	   5543	   15a7	sound/pci/ctxfi/ctdaio.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Noticed-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-12-03 20:30:04 +01:00
Takashi Iwai
2e6705c090 ALSA: ctxfi: Kill the rest snd_print*()
Use the standard dev_*() instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-28 17:40:42 +01:00
Sudip Mukherjee
cf6814f2b5 ALSA: ctxfi: remove unused variable
As of now the pointer to struct dai is not being used anywhere in the
function. So it is safe to remove the variable.
If we are ever doing anything with the container_of(daio, struct dai, daio),
then at that time we can again add the variable.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-21 16:06:13 +02:00
Sudip Mukherjee
0cae90a96c ALSA: ctxfi: pr_* replaced with dev_*
pr_* macros replaced with dev_* as they are more preffered over pr_*.
each file which had pr_* was reviewed manually and replaced with dev_*.
here we have actually used the various snd_card which was added to some
structures of ctxfi via a previous patch of this series.

in the ctvmem.c file we have passed a reference of ct_atc as an
argument to get_vm_block function so that it can be used from
dev_*.

since dev_* will print the device information , so the prefix of
"ctxfi" from the various pr_* were also removed.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-30 10:36:59 +02:00
Sudip Mukherjee
a45c4d5142 ALSA: ctxfi: ctatc: added reference to snd_card
added reference of the card in the convert_format function
so that we can know which card has called the function.
this reference of the snd_card will actually be used in a later patch
to convert the pr_* macro to dev_*.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-30 10:36:36 +02:00
Sudip Mukherjee
e5347f9ab7 ALSA: ctxfi: initialized snd_card
initialized the reference of snd_card which was added to the various
structures through the previous patch of the series.
these references of snd_card will be used in a later patch to convert
the pr_* macros to dev_*

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-30 10:36:12 +02:00
Sudip Mukherjee
3d0fdc86e4 ALSA: ctxfi: added reference of snd_card
added a pointer of snd_card in some of the structures to get a
reference of the card from other functions.
these references of snd_card will be initialised in the next patch
of this series and as of now these snd_card will be used to print the
the device information when we convert the pr_* macros to dev_* in a
later patch of this series.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-30 10:35:48 +02:00
Sudip Mukherjee
b6bfe86fd2 ALSA: ctxfi: removed typecast to (struct hw *)
the previous patch of the series has converted the void * to
struct hw * . Now this patch removes the typecasting to (struct hw *)
which is not needed any more.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-30 10:35:21 +02:00
Sudip Mukherjee
66640898ed ALSA: ctxfi: changed void * to struct hw *
in the code we have void *hw and while using we are always typecasting
it to (struct hw *). it is better to use void type of pointer when we
store different types of pointer , but in this code we are only having
struct hw.
So changed all the relevant reference of void *hw to struct hw *hw,
without any modification of the existing code logic.
the next patch of the series will remove the typecasting which is
not required now.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-30 10:34:29 +02:00
Sudip Mukherjee
7a7686bd0d ALSA: ctxfi: sparse warning
fixed sparse warning of incorrect type (different address spaces) in
cthw20k1.c and cthw20k2.c which was being actually caused as mem_base
was of the type unsigned long.

Again as mem_base was previously unsigned long , so it required many
typecasts in the code to convert interger to pointer.

Now after giving the correct type of mem_base as void __iomem *
we can also remove those typecasts maintaining the same functionality
and logic of the code.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-09-23 16:00:31 +02:00
Takashi Iwai
998052b745 Merge branch 'for-linus' into for-next
Merging for-linus branch for syncing the latest STAC/IDT codec
changes to be affected by the upcoming hda-jack rewrites.
2014-09-11 13:43:49 +02:00
Linus Torvalds
521bd5e4d9 sound fixes for 3.17-rc3
Here contains not many exciting changes but just a few minor ones:
 An off-by-one proc write fix, a couple of trivial incldue guard
 fixes, Acer laptop pinconfig fix, and a fix for DSD formats that
 are still rarely used.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJT/w1wAAoJEGwxgFQ9KSmkkMAQAKlRFjLRrcM+y4ly8Gjr1ZTe
 QjkdPBdkQlWiMIPLlX1Xr+pWG5kZiUMiAl5lBkiF6ubcjVYl6KoJGzGzwcAdYkor
 H0tY2+mqinOS9gi3qwnTQjvlhGeTwLqs7hIkIjfaaUHSBn5I6TYsMgMQ2I6Rmo82
 Ox6bhJbunNRhCpyebzTjzgcruGej8FkzpJullWs6XTdxCY2rtFpVn0b6FUgdbab+
 uTgfBeckvtIA327s7qRmWyAOn5t73tCqV3CJ/PnBCXByODiMRrkaM0OLb/O7QvN5
 VTrKyGQyUhf3WNT6R1nuGPbC24ajxu5p0GkSZNuHWoerMIgNobtoBNplzL+P8UUs
 s83Sm21Y7n2jSXPs+rJdjy4MdLng6QcXH/ZoCnpZeIeVxs4qU4O9Q7HMDJZCYS7M
 EEutl8/gt43su4wHO2RGfU3DOIFnjtPQzqqkkwzdwoxB9jhMHfq73qRTrAHC3biB
 hqjRQRcX++Z5C0PPuVUvRSwidWTbeEfot3MvXKXaHyWTojyGRqfKsCXhudFLCNYU
 BlwAxrLI8kWaKdr9oVe+KS1XoBVQJIIar62plwFozTEuHuQ2P0FNpP6MFViPNoFf
 UOHvXCTHi8JaVSBjhlKHrtto2Zcak1tIlQ1Ewog0Wg1cJrDOdWxHEwJ2tUI0N7aC
 fZ3lwxhRarA9URNrjNqV
 =raXL
 -----END PGP SIGNATURE-----

Merge tag 'sound-3.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Here contains not many exciting changes but just a few minor ones: An
  off-by-one proc write fix, a couple of trivial incldue guard fixes,
  Acer laptop pinconfig fix, and a fix for DSD formats that are still
  rarely used"

* tag 'sound-3.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - Set up initial pins for Acer Aspire V5
  ALSA: pcm: Fix the silence data for DSD formats
  ALSA: ctxfi: ct20k1reg: Fix typo in include guard
  ALSA: hda: ca0132_regs.h: Fix typo in include guard
  ALSA: core: fix buffer overflow in snd_info_get_line()
2014-08-28 09:44:25 -07:00
Sudip Mukherjee
62afa853cb ALSA: ctxfi: fix broken user-visible string
as broken user-visible strings breaks the ability to grep for them , so this patch fixes the broken user-visible strings

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-26 15:41:07 +02:00
Sudip Mukherjee
e720b82027 ALSA: ctxfi: prink replacement
as pr_* macros are more preffered over printk, so printk replaced with corresponding pr_err and pr_alert
this patch will generate a warning from checkpatch for an unnecessary space before new line and has not been fixed as this patch is only for printk replacement.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-26 15:40:54 +02:00
Sudip Mukherjee
57f2d8b797 ALSA: ctxfi: ctpcm.c: printk replacement
replaced printk with corresponding pr_err

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-25 16:02:18 +02:00
Rasmus Villemoes
ee3043b2d7 ALSA: ctxfi: ct20k1reg: Fix typo in include guard
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-08-22 11:24:57 +02:00
Benoit Taine
9baa3c34ac PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use
We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to
meet kernel coding style guidelines.  This issue was reported by checkpatch.

A simplified version of the semantic patch that makes this change is as
follows (http://coccinelle.lip6.fr/):

// <smpl>

@@
identifier i;
declarer name DEFINE_PCI_DEVICE_TABLE;
initializer z;
@@

- DEFINE_PCI_DEVICE_TABLE(i)
+ const struct pci_device_id i[]
= z;

// </smpl>

[bhelgaas: add semantic patch]
Signed-off-by: Benoit Taine <benoit.taine@lip6.fr>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2014-08-12 12:15:14 -06:00
Takashi Iwai
60c5772b50 ALSA: pci: Convert to snd_card_new() with a device pointer
Also remove superfluous snd_card_set_dev() calls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-12 11:17:52 +01:00
Sarah Bessmer
e240a46965 ALSA: ctxfi - Work around emu20k1 glitch to prevent buffered sound data loss
Occasionally, on playback stream ringbuffer wraparound, the EMU20K1
hardware will momentarily return 0 instead of the proper current(loop)
address. This patch handles that case, fixing the problem of playback
position corruption and subsequent loss of buffered sound data, that
occurs with some common buffering layout patterns(e.g. multiple
simultaneous output streams with differently-sized or
non-power-of-2-sized buffers).

An alternate means of fixing the problem would be to read the ca
register continuously, until two sequential reads return the same
value; however, that would be a more invasive change, has performance
implications, and isn't necessary unless there are also issues with the
value not being updated atomically in regards to individual bits or
something similar(which I have not encountered through light testing).

I have no EMU20K2 hardware to confirm if the issue is present there,
but even if it's not, this change shouldn't break anything that's not
already broken.

Signed-off-by: Sarah Bessmer <aotos@fastmail.fm>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-10 10:10:41 +01:00
Takashi Iwai
29fa957804 ALSA: ctxfi: Use WARN_ON() instead of BUG_ON()
BUG_ON() is rather useless for debugging as it leads to panic().
Use WARN_ON() and handle the error cases accordingly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-06 08:34:49 +01:00
Sachin Kamat
b71495ee42 ALSA: ctxfi: Staticize local symbols
Local symbols used only in this file are made static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-09-13 14:36:09 +02:00
Takashi Iwai
20a24225d8 ALSA: PCI: Remove superfluous pci_set_drvdata(pci, NULL) at remove
As drvdata is cleared to NULL at probe failure or at removal by the
driver core, we don't have to call pci_set_drvdata(pci, NULL) any
longer in each driver.

The only remaining pci_set_drvdata(NULL) is in azx_firmware_cb() in
hda_intel.c.  Since this function itself releases the card instance,
we need to clear drvdata here as well, so that it won't be released
doubly in the remove callback.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-29 12:37:32 +02:00
Bill Pemberton
e23e7a1436 ALSA: pci: remove __dev* attributes
CONFIG_HOTPLUG is going away as an option.  As result the __dev*
markings will be going away.

Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst,
and __devexit.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-07 07:20:55 +01:00
Takashi Iwai
7b31d0095e ALSA: Define more channel map positions
For following the standard, define more channel map positions and
shuffle the items a bit:

- As both PulseAudio and gstreamer define MONO channel position
  explicitly, we should follow that, too.  The mono streams point to
  this channel position unless they are explicitly assigned to certain
  channel positions.

- Top-front-* and Top-rear-* positions are added, carried from
  PulseAudio's definitions.

- Move NA and MONO definitions at the top of table right after
  UNKNOWN, since these are more abstract in comparison with other
  practical positions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-12 18:13:03 +02:00
Takashi Iwai
7e8d613b53 ALSA: ctxfi: Fix mono channel map to UNKNOWN
To follow the previous commit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-12 15:19:23 +02:00
Takashi Iwai
8d50cdc1f5 ALSA: ctxfi: Implement channel maps
Assign the multi-channel map to front PCM, and other channel map to
each other channel PCM.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:08:33 +02:00
Takashi Iwai
ddf83485d7 Merge branch 'for-linus' into for-next
Conflicts:
	sound/pci/hda/hda_codec.c

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20 22:14:26 +02:00
Julia Lawall
4d8ce1c996 ALSA: sound/pci/ctxfi/ctatc.c: fix error return code
Initialize err before returning on failure, as done elsewhere in the
function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20 10:57:30 +02:00
Takashi Iwai
c7561cd804 ALSA: PCI: Replace CONFIG_PM with CONFIG_PM_SLEEP
Otherwise we may get compile warnings due to unused functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-14 18:12:04 +02:00
Takashi Iwai
68cb2b5592 ALSA: Convert to new pm_ops for PCI drivers
Straightforward conversion to the new pm_ops from the legacy
suspend/resume ops.

Since we change vx222, vx_core and vxpocket have to be converted,
too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-03 08:23:03 +02:00
Takashi Iwai
e9f66d9b9c ALSA: pci: clean up using module_pci_driver()
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-24 12:25:00 +02:00
Masanari Iida
8a236f3f1a ALSA: ctxfi: Fix typo in ctvmem.c
Correct spelling "virtural" to "virtual" in
sound/pci/ctxfi/ctvmem.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-02-23 18:28:49 +01:00
Rusty Russell
a67ff6a540 ALSA: module_param: make bool parameters really bool
module_param(bool) used to counter-intuitively take an int.  In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option.  For this version
it'll simply give a warning, but it'll break next kernel version.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-19 10:34:41 +01:00
Thomas Meyer
1d5d37f408 ALSA: ctxf: Use kcalloc instead of kzalloc to allocate array
The advantage of kcalloc is, that will prevent integer overflows which could
result from the multiplication of number of elements and size and it is also
a bit nicer to read.

The semantic patch that makes this change is available
in https://lkml.org/lkml/2011/11/25/107

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-12-06 13:27:22 +01:00