1
0
Fork 0
Commit Graph

30 Commits (redonkable)

Author SHA1 Message Date
Stephen Boyd 04d15d5cad staging: Remove dev_err() usage after platform_get_irq()
We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20190730181557.90391-43-swboyd@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 20:50:04 +02:00
Michael Straube d94e038910 staging: goldfish: remove GPL boiler plate text
The SPDX identifier is a legally binding shorthand,
which can be used instead of the full boiler plate text.

There is a SPDX identifier line in goldfish_audio.c.
Remove the GPL boiler plate text to reduce file size.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-15 16:08:04 +01:00
Rohit Sarkar 089257429d staging: goldfish: Add SPDX license identifier.
Fix checkpatch warning by adding the SPDX license identifier.

Signed-off-by: Rohit Sarkar <rohitsarkar5398@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-07 12:27:33 +01:00
Roman Kiryanov 24daa451c2 staging: goldfish: add a blank line into struct goldfish_audio
To separate data members and the comment for better readability.

Signed-off-by: Roman Kiryanov <rkir@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-12 21:49:24 +02:00
Roman Kiryanov 683a060a1d staging: goldfish: fix whitespace in goldfish_audio
Linux kernel coding style: spaces are never used for
indentation.

Signed-off-by: Roman Kiryanov <rkir@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-12 21:49:24 +02:00
Roman Kiryanov eee222db37 staging: goldfish: Fix checkpatch CHECK in goldfish_audio.c
Fix "CHECK: Alignment should match open parenthesis"

Signed-off-by: Roman Kiryanov <rkir@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-18 10:55:11 +02:00
Joshua Lang 3053339b17 staging: goldfish: Clear audio read buffer status after each read
The buffer_status field is interrupt updated. After every read request,
the buffer_status read field should be reset so that on the next loop
iteration we don't read a stale value and read data before the
device is ready.

Signed-off-by: Joshua Lang <joshualang@google.com>
Signed-off-by: Roman Kiryanov <rkir@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17 09:05:14 +02:00
Yu Ning 06e526f49b staging: goldfish: Enable ACPI-based enumeration for goldfish audio
Add an ACPI id to make goldfish audio to support ACPI enumeration.

Signed-off-by: Yu Ning <yu.ning@intel.com>
Signed-off-by: Roman Kiryanov <rkir@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17 09:05:14 +02:00
Roman Kiryanov a75647d1e7 staging: goldfish: Replace read and write macros with functions
Functions are less error-prone and generate cleaner compilation.

Signed-off-by: Roman Kiryanov <rkir@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17 09:05:14 +02:00
Greg Hackmann 4532150762 staging: goldfish: audio: fix compiliation on arm
We do actually need slab.h, by luck we get it on other platforms but not
always on ARM. Include it properly.

Signed-off-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Jin Qian <jinqian@android.com>
Signed-off-by: Alan <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Greg Hackmann 283ded1031 staging: goldfish: audio: add devicetree bindings
Introduce devicetree bindings to the Goldfish staging audio driver.

Signed-off-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Jin Qian <jinqian@android.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Christian Colic 269ad6e018 staging: goldfish: (coding style) Rewrite comparisons to NULL as "!data->reg_base"
Rewrite comparisons to NULL "data->reg_base == NULL" as "!data->reg_base" to conform to checkpatch.

Signed-off-by: Christian Colic <colic.christian@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:29:00 -08:00
Christian Colic 2ce601b033 staging: goldfish: (coding style) Add spaces around the "+" to conform to checkpatch
Added a space around the "+" at: "reg_base+addr2" to clear up a checkpatch check.

Signed-off-by: Christian Colic <colic.christian@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:29:00 -08:00
Peter Senna Tschudin 07d783fd83 staging: goldfish: Fix pointer cast for 32 bits
As the first argument of gf_write64() was of type unsigned long, and as
some calls to gf_write64() were casting the first argument from void *
to u64 the compiler and/or sparse were printing warnings for casts of
wrong sizes when compiling for i386.

This patch changes the type of the first argument of gf_write64() to
const void *, and update calls to the function. This change fixed the
warnings and allowed to remove casts from 3 calls to gf_write64().

In addition gf_write64() was renamed to gf_write_ptr() as the name was
misleading because it only writes 32 bits on 32 bit systems.

gf_write_dma_addr() was added to handle dma_addr_t values which is
used at drivers/staging/goldfish/goldfish_audio.c.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:40:14 +09:00
Ricardo Ribalda Delgado 82fdb8dd11 staging/goldfish/goldfish_audio: Fix annotations
dmam_alloc_coherent does not return a __iomem pointer.
here is its prototype:

void * dmam_alloc_coherent(struct device *dev, size_t size,
			   dma_addr_t *dma_handle, gfp_t gfp)

This fixes these sparse warnings:

drivers/staging/goldfish/goldfish_audio.c:134:43: warning: incorrect
type in argument 2 (different address spaces)
drivers/staging/goldfish/goldfish_audio.c:134:43:    expected void const
*from
drivers/staging/goldfish/goldfish_audio.c:134:43:    got char [noderef]
<asn:2>*read_buffer
drivers/staging/goldfish/goldfish_audio.c:167:36: warning: incorrect
type in argument 1 (different address spaces)
drivers/staging/goldfish/goldfish_audio.c:167:36:    expected void *to
drivers/staging/goldfish/goldfish_audio.c:167:36:    got char [noderef]
<asn:2>*[assigned] kbuf
drivers/staging/goldfish/goldfish_audio.c:296:27: warning: incorrect
type in assignment (different address spaces)
drivers/staging/goldfish/goldfish_audio.c:296:27:    expected char
[noderef] <asn:2>*buffer_virt
drivers/staging/goldfish/goldfish_audio.c:296:27:    got void *

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20 14:13:17 +01:00
Somya Anand 6e3f3bb863 Staging: goldfish: use !x instead of x == NULL
Functions like devm_kzalloc, kmalloc_array, devm_ioremap,
usb_alloc_urb, alloc_netdev return NULL as a return value on failure.
Generally, When NULL represents failure, !x is commonly used.

This patch cleans up the tests on the results of these functions, thereby
using !x instead of x == NULL or NULL == x. This is done via following
coccinelle script:
@prob_7@
identifier x;
statement S;
@@

(
 x = devm_kzalloc(...);
|
 x = usb_alloc_urb(...);
|
 x = kmalloc_array(...);
|
 x = devm_ioremap(...);
|
 x = alloc_netdev(...);
)
 ...
- if(NULL == x)
+ if(!x)
        S
Further we have used isomorphism characteristics of coccinelle to
indicate x == NULL and NULL == x are equivalent. This is done via
following iso script.

Expression
@ is_null @ expression X; @@
X == NULL <=> NULL == X

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:28:47 +01:00
Aya Mahfouz d7d3e89858 staging: goldfish: remove extra parentheses around function arguments
Removes extra parentheses around function arguments. Issue
detected and resolved using the following coccinelle script:

@@
expression e;
identifier f;
@@

f(...,
-(
e
-)
,...)

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-15 18:41:14 +01:00
Loic Pefferkorn 8f52e264e8 staging: goldfish: fix alignment to match open parenthesis
Coding style: fix alignment to match open parenthesis

Signed-off-by: Loic Pefferkorn <loic@loicp.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06 21:54:57 -07:00
Loic Pefferkorn 9b61f085eb staging: goldfish: document spinlock usage
Coding style: document spinlock usage

Signed-off-by: Loic Pefferkorn <loic@loicp.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06 21:54:57 -07:00
Loic Pefferkorn 1f21b0c8ac staging: goldfish: suppress consecutive blank lines
Coding style: suppress consecutive blank lines

Signed-off-by: Loic Pefferkorn <loic@loicp.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-06 21:51:09 -07:00
Robin Schroer 22d3970de0 staging/goldfish/goldfish_audio: fix a sparse warning
Fix a pointer check to use NULL instead of 0

Warning:
drivers/staging/goldfish/goldfish_audio.c:300:34: warning: Using plain
integer as NULL pointer

Signed-off-by: Robin Schroer <sulamiification@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-23 18:12:23 -07:00
Himangi Saraogi 85f28332e3 staging: goldfish: Introduce the use of managed interfaces
This patch introduces the use of managed interfaces like devm_kzalloc,
devm_ioremap, dmam_alloc_coherent, devm_request_irq and does away with
the calls to functions to free the allocated memory in the probe and
remove functions. Also, the labels are removed in the probe function.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 12:18:21 -07:00
Hoang Tran 92271551b6 staging: goldfish: fix coding style.
Using an else following a break or return can unnecessarily
indent code blocks.

This patch fixes coding style reported by checkpatch.pl, a part
of eudyptula challenge.

Signed-off-by: Hoang Tran <hoangtran.gwr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18 15:01:35 -07:00
Alan f6279717bb goldfish: clean up staging ifdefs
Use the write helpers and add an audio helper

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-15 13:20:41 -07:00
Jun Tian c3c1ba6640 goldfish: 64-bit audio driver for goldfish platform
Enable the 64-bit goldfish audio driver.
Support 64-bit buffer address and data read/write.

Signed-off-by: Jun Tian <jun.j.tian@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-03 19:47:18 -04:00
Greg Kroah-Hartman 3eb9992caf Merge 3.15-rc2 into staging-next
This resolves a bunch of merge errors with other fixes that are already
in Linus's tree.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-22 10:08:40 -07:00
Garret Kelly ef323812c9 staging: goldfish: Fix missing blank lines
Fix two instances of the following checkpatch warning:
WARNING: Missing a blank line after declarations

Signed-off-by: Garret Kelly <garret.kelly@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16 20:14:33 -07:00
Tuomas Tynkkynen ff8ebe6448 staging: goldfish: Call free_irq in error path
If misc_register failed in goldfish_audio_probe, the already requested
IRQ wouldn't get freed. Add a call to free_irq() like there is in
goldfish_audio_remove().

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16 11:41:44 -07:00
Sara Bird ad28497cdb staging/goldfish: Fixed up incorrect formatted comments.
The existing comments are using an odd style. Fixed them up to adhereto the
StyleGuide. No code changes.

Signed-off-by: Sara Bird <sara.bird.iar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-21 10:30:10 -07:00
Alan Cox 2e82b83dc3 goldfish: audio support
(remove change to another file that escaped into the patch set)

From: Mike Lockwood <lockwood@google.com>

Provide a simple audio channel between the kernel and the emulator that host
sit. Queued for staging right now as this ought to be an ALSA driver not
just a dumb device of its own making.

Signed-off-by: Mike A. Chan <mikechan@google.com>
[x86 support]
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
[Clean up]
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-24 13:51:38 -08:00